3 * (C) 2017 by Argonne National Laboratory.
4 * See COPYRIGHT in top-level directory.
6 * Portions of this code were written by Intel Corporation.
7 * Copyright (C) 2011-2017 Intel Corporation. Intel provides this material
8 * to Argonne National Laboratory subject to Software Grant and Corporate
9 * Contributor License Agreement dated February 8, 2012.
11 * This program checks if MPICH can correctly handle a huge message receive
12 * when the sender underflows by sending a much smaller message
21 #define HUGE_SIZE (10*1024*1024)
23 int main(int argc, char *argv[])
29 MPI_Init(&argc, &argv);
31 buff = malloc(HUGE_SIZE);
34 MPI_Comm_rank(MPI_COMM_WORLD, &rank);
35 MPI_Comm_size(MPI_COMM_WORLD, &size);
39 /* Try testing underflow to make sure things work if we try to send 1 byte
40 * when receiving a huge message */
42 MPI_Send(buff, 1, MPI_BYTE, dest, 0, MPI_COMM_WORLD);
43 } else if (rank == dest) {
44 MPI_Recv(buff, HUGE_SIZE, MPI_BYTE, 0, 0, MPI_COMM_WORLD, MPI_STATUS_IGNORE);
49 MPI_Barrier(MPI_COMM_WORLD);