See how to use math-compute for the basics of building and running MPI programs in our environment.
Following https://computing.llnl.gov/tutorials/mpi/exercise.html with changes for our environment.
Compile and run MPI program
Make a directory in your account on Math compute cluster for the exercise and cd there. Find mpi_hello.f, right click on it and copy the link. Then back in your terminal window paste the link on the line to copy the file:
Compile the file and submit, following the instructions for Math compute cluster.
Identify the components of the MPI "Hello world" program
- Use the appropriate MPI include file
- Identify task 0 as the "master" task
- Initialize the MPI environment
- Get the total number of tasks
- Get the task's rank (who it is)
- Get the name of the processor it is executing on
- Print a hello message that includes its task rank and processor name
- Have the master task alone print the total number of tasks
- Terminate the MPI environment
See https://computing.llnl.gov/tutorials/mpi/exercise.html and scroll down.
Suggestion: do not look at the solution, look at a simpler example https://www.mcs.anl.gov/research/projects/mpi/tutorial/gropp/node50.html first: send a single message to another node that receives it.
You can do almost everything with just these 4: mpi_send, mpi_receive, mpi_allreduce, and mpi_bcast.
Graduating to fortran 90: https://github.com/janmandel/fortran90_test