‘source.c’ contains your source code.
To compile a C-program using the Intel compilers:
Sample Fortran source program:
To compile a Fortran-program using the Intel compilers:
Output can be viewed.
To compile the OpenMP program using Intel compilers:
Output of the program with 2 threads on a requested nodes.
The example MPI program in C++ :
The above program can be compiled with loading the latest openmpi moudule:
mpicc for C, mpicxx for C++, mpif90 for FORTRAN
The compiled program can be run by requesting 2 processors with –np flag:
Since the MPI process rank 1 buffer is not set because of the ‘if’ statement it is set to some random value. You should be careful about assigning values to your array elements before using them. Here it is shown to highlight the issue.
Note: Examples shown above do not use any compiler optimization flags. They should be included to run your programs efficiently.