Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add new entry in Release_Notes.
[simgrid.git] / teshsuite / smpi / mpich3-test / pt2pt / huge_ssend.c
1 /*
2  *  (C) 2018 by Argonne National Laboratory.
3  *      See COPYRIGHT in top-level directory.
4  *
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.
9  *
10  *  This program checks if MPICH can correctly handle huge synchronous sends
11  *
12  */
13
14 #include <mpi.h>
15 #include <stdio.h>
16 #include <stdlib.h>
17
18 #include "mpitest.h"
19
20 #define COUNT (4*1024*1024)
21
22 int main(int argc, char *argv[])
23 {
24     int *buff;
25     int size, rank;
26
27     MTest_Init(&argc, &argv);
28
29     MPI_Comm_rank(MPI_COMM_WORLD, &rank);
30     MPI_Comm_size(MPI_COMM_WORLD, &size);
31
32     if (size != 2) {
33         fprintf(stderr, "Launch with two processes\n");
34         MPI_Abort(MPI_COMM_WORLD, 1);
35     }
36
37     buff = malloc(COUNT * sizeof(int));
38
39     if (rank == 0)
40         MPI_Ssend(buff, COUNT, MPI_INT, 1, 0, MPI_COMM_WORLD);
41     else
42         MPI_Recv(buff, COUNT, MPI_INT, 0, 0, MPI_COMM_WORLD, MPI_STATUS_IGNORE);
43
44     free(buff);
45
46     MTest_Finalize(0);
47
48     return 0;
49 }