2 * (C) 2018 by Argonne National Laboratory.
3 * See COPYRIGHT in top-level directory.
5 * Portions of this code were written by Intel Corporation.
6 * Copyright (C) 2011-2018 Intel Corporation. Intel provides this material
7 * to Argonne National Laboratory subject to Software Grant and Corporate
8 * Contributor License Agreement dated February 8, 2012.
10 * This program checks if MPICH can correctly handle huge message sends
11 * over multiple different communicators simultaneously
21 #define COUNT (4*1024*1024)
24 int main(int argc, char *argv[])
29 MPI_Comm comms[NCOMMS];
30 MPI_Request reqs[NCOMMS];
32 MTest_Init(&argc, &argv);
34 MPI_Comm_rank(MPI_COMM_WORLD, &rank);
35 MPI_Comm_size(MPI_COMM_WORLD, &size);
38 fprintf(stderr, "Launch with two processes\n");
39 MPI_Abort(MPI_COMM_WORLD, 1);
42 buff = malloc(COUNT * NCOMMS * sizeof(int));
44 for (i = 0; i < NCOMMS; i++)
45 MPI_Comm_dup(MPI_COMM_WORLD, &comms[i]);
47 for (i = 0; i < NCOMMS; i++) {
49 MPI_Isend(buff + COUNT * i, COUNT, MPI_INT, 1 /* dest */ , 0 /* tag */ , comms[i],
52 MPI_Irecv(buff + COUNT * i, COUNT, MPI_INT, 0 /* src */ , 0 /* tag */ , comms[i],
55 MPI_Waitall(NCOMMS, reqs, MPI_STATUSES_IGNORE);
57 for (i = 0; i < NCOMMS; i++)
58 MPI_Comm_free(&comms[i]);