Exercise: Hello World!
We start with a warm-up exercise.
Copy the HELLO folder from the teacher's account. In there you will find simple parallel "Hello World"-type programs in OpenMP and MPI for both C and Fortran. You will need the "intel" and "intelmpi" modules for this to work
$ module load intel intelmpi
Typing "make" will build the binaries.
- Compile and run the OpenMP version of the program:
$ cd ~/HELLO/omp
Something is obviously wrong. Fix it!
$ make
$ OMP_NUM_THREADS=4 ./HELLO_C.exe - Compile and run the MPI version of the program (this is only possible within a batch job - see the introduction):
$ cd ~/HELLO/mpi
Modify the code so that each process sends its own rank to process 0, which then prints all the ranks.
$ make
$ mpirun -np 4 ./HELLO_C.exe
Last modified: Monday, 19 February 2024, 5:57 PM