In order to successfully complete this assignment you need to participate both individually and in groups during class. If you attend class in-person then have one of the instructors check your notebook and sign you out before leaving class on Monday February 15. If you are attending asynchronously, turn in your assignment using D2L no later than _11:59pm on Monday February 15.
Today we are going to submit OpenMP jobs to the cluster and verify they run properly by inspecting their output. To start lets use the classic OMP hello world program:
#include "omp.h"
#include "stdio.h"
int main()
{
#pragma omp parallel
{
int ID = omp_get_thread_num();
printf("hello(%d)",ID);
printf(" world(%d) \n",ID);
}
}
✅ DO THIS: Compile and test the above program on the command line. make a submission script and run the program with 7 cores on the HPCC.
HINT: Try adding the srun
command before your parallel commands. This command does some checks to make sure everything is running properly. Although not required for OpenMP (based on my tests), it definatly comes in handy with GPU and MPI jobs.
If you attend class in-person then have one of the instructors check your notebook and sign you out before leaving class. If you are attending asynchronously, turn in your assignment using D2L.
Written by Dr. Dirk Colbry, Michigan State University
This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.