2 * (C) 2016 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-2016 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.
11 * This program checks if MPICH can correctly handle
12 * many outstanding large message transfers
22 #define BLKSIZE (5*1024*1024)
24 int main(int argc, char *argv[])
30 MPI_Request reqs[N_TRY];
32 MPI_Init(&argc, &argv);
34 buff = malloc(N_TRY * BLKSIZE);
35 memset(buff, -1, N_TRY * BLKSIZE);
37 MPI_Comm_rank(MPI_COMM_WORLD, &rank);
38 MPI_Comm_size(MPI_COMM_WORLD, &size);
43 for (i = 0; i < N_TRY; i++)
44 MPI_Isend(buff + BLKSIZE*i, BLKSIZE, MPI_BYTE, dest, 0, MPI_COMM_WORLD, &reqs[i]);
45 MPI_Waitall(N_TRY, reqs, MPI_STATUSES_IGNORE);
47 else if (rank == dest) {
48 for (i = 0; i < N_TRY; i++)
49 MPI_Irecv(buff + BLKSIZE*i, BLKSIZE, MPI_BYTE, 0, 0, MPI_COMM_WORLD, &reqs[i]);
50 MPI_Waitall(N_TRY, reqs, MPI_STATUSES_IGNORE);