Is the following a standards-conformant MPI-3 C program?
#include <mpi.h>
int main(int argc, char** argv)
{
int dlocalouter=1, dglobalouter=0, dlocalinner=1, dglobalinner=0;
MPI_Request router, rinner;
MPI_Init(&argc,&argv);
MPI_Iallreduce(&dlocalouter,&dglobalouter,1,MPI_INT,MPI_SUM,MPI_COMM_WORLD,&router);
MPI_Iallreduce(&dlocalinner,&dglobalinner,1,MPI_INT,MPI_SUM,MPI_COMM_WORLD,&rinner);
MPI_Wait(&rinner,MPI_STATUS_IGNORE);
MPI_Wait(&router,MPI_STATUS_IGNORE);
MPI_Finalize();
return 0;
}
MPI_Wait
does not return using one MPI implementation, yet the code runs as expected with a different implementation, so I was curious whether the of code above might not be guaranteed to work by the standard, or if I should start looking for other reasons for the difference. $\endgroup$ – Patrick Sanan Apr 21 '15 at 16:07dglobalouter
anddglobalinner
. It probably doesn't affect the ability of the code to run to completion, but it will affect the answer. Also, you should grabierr
and check it from each MPI call. Most stacks abort on error by default, but who knows what you've got there. $\endgroup$ – Bill Barth Apr 21 '15 at 16:14