2 * Copyright (C) by Argonne National Laboratory
3 * See COPYRIGHT in top-level directory
7 * This program checks the semantics of persistent synchronous send
12 int main(int argc, char *argv[])
19 MTest_Init(&argc, &argv);
21 MPI_Comm_rank(MPI_COMM_WORLD, &rank);
22 MPI_Comm_size(MPI_COMM_WORLD, &size);
25 fprintf(stderr, "Launch with two processes\n");
26 MPI_Abort(MPI_COMM_WORLD, 1);
30 MPI_Ssend_init(NULL, 0, MPI_INT, 1, 0, MPI_COMM_WORLD, &req);
33 /* ssend cannot be complete at this point */
34 MPI_Test(&req, &flag, MPI_STATUS_IGNORE);
37 fprintf(stderr, "ERROR: synchronous send completed before matching recv was posted\n");
41 MPI_Barrier(MPI_COMM_WORLD);
44 MPI_Wait(&req, MPI_STATUS_IGNORE);
45 MPI_Request_free(&req);
46 } else if (rank == 1) {
47 MPI_Recv(NULL, 0, MPI_INT, 0, 0, MPI_COMM_WORLD, MPI_STATUS_IGNORE);