Commit fa10eeaa authored by Charles J Archer's avatar Charles J Archer Committed by Kenneth Raffenetti
Browse files

Add ordering check to mprobe test case


Signed-off-by: Kenneth Raffenetti's avatarKen Raffenetti <raffenet@mcs.anl.gov>
parent 8f6b3cbb
......@@ -522,6 +522,62 @@ int main(int argc, char **argv)
}
MPI_Type_free(&vectype);
/* test 12: order test */
if (rank == 0) {
MPI_Request lrequest[2];
sendbuf[0] = 0xdeadbeef;
sendbuf[1] = 0xfeedface;
sendbuf[2] = 0xdeadbeef;
sendbuf[3] = 0xfeedface;
sendbuf[4] = 0xdeadbeef;
sendbuf[5] = 0xfeedface;
MPI_Isend(&sendbuf[0], 4, MPI_INT, 1, 6, MPI_COMM_WORLD,&lrequest[0]);
MPI_Isend(&sendbuf[4], 2, MPI_INT, 1, 6, MPI_COMM_WORLD,&lrequest[1]);
MPI_Waitall(2, &lrequest[0],MPI_STATUSES_IGNORE);
}
else {
memset(&s1, 0xab, sizeof(MPI_Status));
memset(&s2, 0xab, sizeof(MPI_Status));
/* the error field should remain unmodified */
s1.MPI_ERROR = MPI_ERR_DIMS;
s2.MPI_ERROR = MPI_ERR_TOPOLOGY;
msg = MPI_MESSAGE_NULL;
MPI_Mprobe(0, 6, MPI_COMM_WORLD, &msg, &s1);
check(s1.MPI_SOURCE == 0);
check(s1.MPI_TAG == 6);
check(s1.MPI_ERROR == MPI_ERR_DIMS);
check(msg != MPI_MESSAGE_NULL);
count = -1;
MPI_Get_count(&s1, MPI_INT, &count);
check(count == 4);
recvbuf[0] = 0x01234567;
recvbuf[1] = 0x89abcdef;
MPI_Recv(recvbuf, 2, MPI_INT, 0, 6, MPI_COMM_WORLD, &s2);
check(s2.MPI_SOURCE == 0);
check(s2.MPI_TAG == 6);
check(recvbuf[0] == 0xdeadbeef);
check(recvbuf[1] == 0xfeedface);
recvbuf[0] = 0x01234567;
recvbuf[1] = 0x89abcdef;
recvbuf[2] = 0x01234567;
recvbuf[3] = 0x89abcdef;
s2.MPI_ERROR = MPI_ERR_TOPOLOGY;
MPI_Mrecv(recvbuf, count, MPI_INT, &msg, &s2);
check(recvbuf[0] == 0xdeadbeef);
check(recvbuf[1] == 0xfeedface);
check(recvbuf[2] == 0xdeadbeef);
check(recvbuf[3] == 0xfeedface);
check(s2.MPI_SOURCE == 0);
check(s2.MPI_TAG == 6);
check(s2.MPI_ERROR == MPI_ERR_TOPOLOGY);
check(msg == MPI_MESSAGE_NULL);
}
free(sendbuf);
free(recvbuf);
......
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