Question: Select all correct outcomes when the program below is executed using 4 processes. You can assume that the program is syntactically correct ( no error
Select all correct outcomes when the program below is executed using processes. You can assume that the program is syntactically correct no error at compilation but no communication correctness is guaranteed. READ THE CODE CAREFULLY!!!
The syntax for MPISend and MPIRecv are as follow:
int MPISendvoid buf int count, MPIDatatype datatype, int dest, int tag, MPIComm comm
int MPIRecv void buf int count, MPIDatatype datatype, int source, int tag, MPIComm comm, MPIStatus status
CODE BEGINS
#include
#include
#include
int mainint argc, char argv
int myrank;
int size;
int tag;
int buf;
MPIStatus status;
MPIInit&argc, &argv;
MPICommrankMPICOMMWORLD, &myrank;
MPICommsizeMPICOMMWORLD, &size;
set up data
buf myrank;
printfProcess d has original value d
myrank,buf;
if myrank
MPIRecv&buf,MPIINT,MPICOMMWORLD,&status;
MPISend&buf,MPIINT,MPICOMMWORLD;
if myrank
MPISend&buf,MPIINT,tag,MPICOMMWORLD;
MPIRecv&buf,MPIINT,tag,MPICOMMWORLD,&status;
printfProcess d now has value d
myrank,buf;
MPIFinalize;
end main
CODE ENDS
The program runs and exits normally.
The program crashes as there are more processes than the number of processes being used in the code.
The "now has value" statements show s for both process and
The "now has value" statements show s for both process and
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
