2 * (C) 2017 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-2017 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 many outstanding large
11 * message transfers which use wildcard receives.
21 #define BLKSIZE (10*1024*1024)
23 int main(int argc, char *argv[])
29 MPI_Request reqs[N_TRY];
31 MPI_Init(&argc, &argv);
33 buff = malloc(N_TRY * BLKSIZE);
34 memset(buff, -1, N_TRY * BLKSIZE);
36 MPI_Comm_rank(MPI_COMM_WORLD, &rank);
37 MPI_Comm_size(MPI_COMM_WORLD, &size);
42 for (i = 0; i < N_TRY; i++)
43 MPI_Isend(buff + BLKSIZE*i, BLKSIZE, MPI_BYTE, dest, 0, MPI_COMM_WORLD, &reqs[i]);
44 MPI_Waitall(N_TRY, reqs, MPI_STATUSES_IGNORE);
46 else if (rank == dest) {
47 for (i = 0; i < N_TRY; i++)
48 MPI_Irecv(buff + BLKSIZE*i, BLKSIZE, MPI_BYTE, MPI_ANY_SOURCE, 0, MPI_COMM_WORLD, &reqs[i]);
49 MPI_Waitall(N_TRY, reqs, MPI_STATUSES_IGNORE);