Commit 648cd48c authored by Wesley Bland's avatar Wesley Bland Committed by Huiwei Lu
Browse files

Make anysource test more accurate



Test for the specific error code so it doesn't accidentally catch
MPI_ERR_OTHER.
Signed-off-by: default avatarHuiwei Lu <huiweilu@mcs.anl.gov>
parent f6cdb3c8
......@@ -37,8 +37,9 @@ int main(int argc, char **argv)
if (rank == 0) {
char buf[10];
err = MPI_Recv(buf, 10, MPI_CHAR, MPI_ANY_SOURCE, 0, MPI_COMM_WORLD, MPI_STATUS_IGNORE);
if (MPI_SUCCESS == err) {
fprintf(stderr, "Expected a failure for receive from ANY_SOURCE\n");
MPI_Error_class(err, &ec);
if (MPIX_ERR_PROC_FAILED != ec) {
fprintf(stderr, "Expected MPIX_ERR_PROC_FAILED for receive from ANY_SOURCE: %d\n", ec);
MPI_Abort(MPI_COMM_WORLD, 1);
}
......@@ -58,7 +59,6 @@ int main(int argc, char **argv)
MPI_Error_class(err, &ec);
if (MPIX_ERR_PROC_FAILED_PENDING != ec) {
fprintf(stderr, "Expected a MPIX_ERR_PROC_FAILED_PENDING (%d) for receive from ANY_SOURCE: %d\n", MPIX_ERR_PROC_FAILED_PENDING, ec);
fprintf(stderr, "BUF: %s\n", buf);
MPI_Abort(MPI_COMM_WORLD, 1);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment