Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Reduce the size of partial shared malloc tests.
[simgrid.git] / teshsuite / smpi / mpich3-test / include / mpitestcxx.h
1 /* -*- Mode: C++; c-basic-offset:4 ; -*- */
2 /*
3  *
4  *  (C) 2001 by Argonne National Laboratory.
5  *      See COPYRIGHT in top-level directory.
6  */
7 #ifndef MPITESTCONF_H_INCLUDED
8 #error Required mpitestconf.h file not included first!
9 #endif
10
11 #ifndef MTEST_INCLUDED
12 #define MTEST_INCLUDED
13
14 #include <string.h>
15 /*
16  * Init and finalize test
17  */
18 void MTest_Init(void);
19 void MTest_Finalize(int);
20 void MTestPrintError(int);
21 void MTestPrintErrorMsg(const char[], int);
22 void MTestPrintfMsg(int, const char[], ...);
23 void MTestError(const char[]);
24
25 /*
26  * This structure contains the information used to test datatypes
27  */
28 typedef struct _MTestDatatype {
29     MPI::Datatype datatype;
30     void *buf;                  /* buffer to use in communication */
31     int count;                  /* count to use for this datatype */
32     int isBasic;                /* true if the type is predefined */
33     int printErrors;            /* true if errors should be printed
34                                  * (used by the CheckBuf routines) */
35     /* The following is optional data that is used by some of
36      * the derived datatypes */
37     int stride, nelm, blksize, *index;
38     /* stride, nelm, and blksize are in bytes */
39     int *displs, basesize;
40     /* displacements are in multiples of base type; basesize is the
41      * size of that type */
42     void *(*InitBuf) (struct _MTestDatatype *);
43     void *(*FreeBuf) (struct _MTestDatatype *);
44     int (*CheckBuf) (struct _MTestDatatype *);
45 } MTestDatatype;
46
47 int MTestCheckRecv(MPI::Status &, MTestDatatype *);
48 int MTestGetDatatypes(MTestDatatype *, MTestDatatype *, int);
49 void MTestResetDatatypes(void);
50 void MTestFreeDatatype(MTestDatatype *);
51 const char *MTestGetDatatypeName(MTestDatatype *);
52
53 int MTestGetIntracomm(MPI::Intracomm &, int);
54 int MTestGetIntracommGeneral(MPI::Intracomm &, int, bool);
55 int MTestGetIntercomm(MPI::Intercomm &, int &, int);
56 int MTestGetComm(MPI::Comm **, int);
57 const char *MTestGetIntracommName(void);
58 const char *MTestGetIntercommName(void);
59 void MTestFreeComm(MPI::Comm & comm);
60
61 int MTestSpawnPossible(int *);
62
63 #ifdef HAVE_MPI_WIN_CREATE
64 int MTestGetWin(MPI::Win &, bool);
65 const char *MTestGetWinName(void);
66 void MTestFreeWin(MPI::Win &);
67 #endif
68
69 /* useful for avoid valgrind warnings about padding bytes */
70 #define MTEST_VG_MEM_INIT(addr_, size_) \
71 do {                                    \
72     memset(addr_, 0, size_);            \
73 } while (0)
74
75 #endif