Exercises on basic OpenMPI commands.
Exercises are a part of MPI tutorial
MPI_Init()
- start MPIMPI_Comm_size()
- get amount of threads in current communicatorMPI_Comm_rank()
- get thread ID within current communicatorMPI_Get_processor_name()
- get name of node and name's lengthMPI_Send()
- send message to the specified threadMPI_Recv()
- receive message from the specified threadMPI_Finalize()
- stop mpi communication
3_one2one_dynamic.c - receive a message without prior message length knowledge using a preallocated buffer
MPI_Get_count()
- get message length from MPI_Stat structure
4_one2one_dynamic_2.c - receive a message without prior message length knowledge without preallocated buffer
MPI_Probe()
- only receives message meta (MPI_Stat struct), used before actual message passing to figure message length
MPI_Bcast()
- distribute message from master thread to all threads in communicatorMPI_Barrier()
- wait for all threads from current communicator to reach this point
MPI_Scatter()
- distribute equal chunks of data among processesMPI_Gather()
- combine equal chunks of data into one array
MPI_Allgather()
- send chunk to all threads and receive chunks from all sthreads
MPI_Reduse()
- send available chuncs from each process to master process (all-to-one)MPI_Allreduce()
- send available chuncs from each process to all processes (all-to-all)
MPI_Comm_duplicate()
- duplicate a communicator to not manipulate original oneMPI_Comm_split()
- create a new communicator based on rank's color and keyMPI_Comm_create()
- create a new communicator based on group, involves all threads in communicatorMPI_Comm_create_group()
- create a new communicator based on group, involves only threads in groupMPI_Group_union()
- create a union group from two parameter groupsMPI_Group_intersection()
- create an intersection groupMPI_Group_incl()
- create a new group from an array of ranks
Each file is self contained to make it simpler to track what is going on, for easier compilation and execution. This means some of the helper functions repeat through files.