Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
fix the compilation of MPICH3 tests with the absolute paranoid flags (enable_maintainer)
[simgrid.git] / teshsuite / smpi / mpich3-test / pt2pt / issendselfcancel.c
1 /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
2 /*
3  *  (C) 2014 by Argonne National Laboratory.
4  *      See COPYRIGHT in top-level directory.
5  */
6 #include <stdio.h>
7 #include <stdlib.h>
8 #include <assert.h>
9 #include "mpi.h"
10
11 int main(int argc, char **argv)
12 {
13     MPI_Request req;
14     MPI_Status status;
15
16     MPI_Init(NULL, NULL);
17
18     MPI_Issend(NULL, 0, MPI_BYTE, 0, 123, MPI_COMM_SELF, &req);
19
20     MPI_Probe(MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_SELF, &status);
21     assert(status.MPI_SOURCE == 0);
22     assert(status.MPI_TAG == 123);
23
24     MPI_Cancel(&req);
25     assert(req != MPI_REQUEST_NULL);
26
27     MPI_Request_free(&req);
28
29     MPI_Irecv(NULL, 0, MPI_BYTE, 0, 123, MPI_COMM_SELF, &req);
30     MPI_Cancel(&req);
31     MPI_Wait(&req, &status);
32
33     printf(" No Errors\n");
34
35     MPI_Finalize();
36     return 0;
37 }