MPI Flashcards
What is the function used to initialize the MPI execution environment?
MPI_Init
int MPI_Init(int *argc, char ***argv)
What is the function used to finalise the MPI execution environment?
MPI_Finalize
int MPI_Finalize()
What does MPI_Comm_size
do?
Reports the number of MPI processes in the specified communicator
int MPI_Comm_size(MPI_Comm comm, int *size)
What does MPI_Comm_rank
do?
Reports the rank of the calling process in the specified communicator
int MPI_Comm_rank(MPI_Comm comm, int *rank)
What is the range of ranks for MPI processes?
From 0 to size-1
What is the predefined communicator that refers to all concurrent processes in an MPI program?
MPI_COMM_WORLD
What are the two basic functions for point-to-point communication in MPI?
MPI_Send
and MPI_Recv
What is the purpose of the MPI_Send
function?
Send a message to another process
int MPI_Send(void *buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm)
What is the purpose of the MPI_Recv
function?
Receive a message from another process
int MPI_Recv(void *buf, int count, MPI_Datatype datatype, int source, int tag, MPI_Comm comm, MPI_Status *status)
List some MPI C data types.
MPI_CHAR
MPI_INT
MPI_FLOAT
MPI_DOUBLE
- etc
What is the purpose of MPI_Bcast
?
It is the function used to broadcast data from one process to all others in a communicator
int MPI_Bcast(void *buffer, int count, MPI_Datatype datatype, int root, MPI_Comm comm)
What is the purpose of MPI_Scatter
?
It is the function used to scatter data from one process to all others in a communicator.
int MPI_Scatter(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm)
What is purpose of MPI_Gather
?
It is the function used to gather data from all processes in a communicator to one process.
int MPI_Gather(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm)
What is the purpose of MPI_Allgather
?
It is the function used to gather data from all processes in a communicator to all processes.
int MPI_Allgather(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, MPI_Comm comm)
What are the two types of reduction functions in MPI?
MPI_Reduce
MPI_Allreduce
What does MPI_Reduce
do?
Carries out reduction and returns result to the specified process
int MPI_Reduce(const void *sendbuf, void *recvbuf, int count, MPI_Datatype type, MPI_Op op, int root, MPI_Comm comm)
What does MPI_Allreduce
do?
Carries out reduction and returns result to all processes
True or False: MPI_COMM_SELF
refers to all processes in an MPI program.
False
What function is called to report the rank of this process?
MPI_Comm_rank
What command is used to compile an MPI program in C?
mpicc
What command is used to run an MPI process?
mpirun
What are reduction variables in OpenMP?
Variables used to perform reduction operations across multiple processes
Communication overhead is greater if we return result to all processes
What parameters are required for MPI_Reduce
?
- sendbuf
- recvbuf
- count
- type
- op
- root
- comm
What parameters are required for MPI_Allreduce
?
- sendbuf
- recvbuf
- count
- type
- op
- comm