Home | History | Annotate | Download | only in Analysis
      1 // Message Passing Interface mock header. Mocks MPI constants and functions, in
      2 // order to make them available in distinct integration test files.
      3 
      4 #define NULL 0
      5 
      6 // mock types
      7 typedef int MPI_Datatype;
      8 typedef int MPI_Comm;
      9 typedef int MPI_Request;
     10 typedef int MPI_Status;
     11 typedef int MPI_Op;
     12 typedef int int8_t;
     13 typedef int uint8_t;
     14 typedef int uint16_t;
     15 typedef int int64_t;
     16 namespace std { template<class T> struct complex { T real; T imag; }; }
     17 
     18 // mock constants
     19 #define MPI_DATATYPE_NULL 0
     20 #define MPI_CHAR 0
     21 #define MPI_BYTE 0
     22 #define MPI_INT 0
     23 #define MPI_LONG 0
     24 #define MPI_LONG_DOUBLE 0
     25 #define MPI_UNSIGNED 0
     26 #define MPI_INT8_T 0
     27 #define MPI_UINT8_T 0
     28 #define MPI_UINT16_T 0
     29 #define MPI_C_LONG_DOUBLE_COMPLEX 0
     30 #define MPI_FLOAT 0
     31 #define MPI_DOUBLE 0
     32 #define MPI_CXX_BOOL 0
     33 #define MPI_CXX_FLOAT_COMPLEX 0
     34 #define MPI_CXX_DOUBLE_COMPLEX 0
     35 #define MPI_CXX_LONG_DOUBLE_COMPLEX 0
     36 #define MPI_IN_PLACE 0
     37 #define MPI_COMM_WORLD 0
     38 #define MPI_STATUS_IGNORE 0
     39 #define MPI_STATUSES_IGNORE 0
     40 #define MPI_SUM 0
     41 
     42 // mock functions
     43 int MPI_Comm_size(MPI_Comm, int *);
     44 int MPI_Comm_rank(MPI_Comm, int *);
     45 int MPI_Send(const void *, int, MPI_Datatype, int, int, MPI_Comm);
     46 int MPI_Recv(void *, int, MPI_Datatype, int, int, MPI_Comm, MPI_Status *);
     47 int MPI_Isend(const void *, int, MPI_Datatype, int, int, MPI_Comm,
     48     MPI_Request *);
     49 int MPI_Irecv(void *, int, MPI_Datatype, int, int, MPI_Comm, MPI_Request *);
     50 int MPI_Wait(MPI_Request *, MPI_Status *);
     51 int MPI_Waitall(int, MPI_Request[], MPI_Status[]);
     52 int MPI_Reduce(const void *, void *, int, MPI_Datatype, MPI_Op, int, MPI_Comm);
     53 int MPI_Ireduce(const void *, void *, int, MPI_Datatype, MPI_Op, int, MPI_Comm,
     54     MPI_Request *);
     55 int MPI_Bcast(void *, int count, MPI_Datatype, int, MPI_Comm);
     56