5 #include <xbt/function_types.h>
7 #define SMPI_RAND_SEED 5
9 #define MPI_ANY_SOURCE -1
13 #define MPI_ERR_COMM 1
15 #define MPI_ERR_TYPE 3
16 #define MPI_ERR_REQUEST 4
17 #define MPI_ERR_INTERN 5
18 #define MPI_ERR_COUNT 6
19 #define MPI_ERR_RANK 7
23 typedef struct smpi_mpi_communicator_t *smpi_mpi_communicator_t;
24 typedef smpi_mpi_communicator_t MPI_Comm;
27 struct smpi_mpi_status_t {
30 typedef struct smpi_mpi_status_t smpi_mpi_status_t;
31 typedef smpi_mpi_status_t MPI_Status;
34 typedef struct smpi_mpi_datatype_t {
36 } s_smpi_mpi_datatype_t;
37 typedef struct smpi_mpi_datatype_t *smpi_mpi_datatype_t;
38 typedef smpi_mpi_datatype_t MPI_Datatype;
41 typedef struct smpi_mpi_request_t *smpi_mpi_request_t;
42 typedef smpi_mpi_request_t MPI_Request;
45 typedef struct smpi_mpi_op_t {
46 void (*func)(void *x, void *y, void *z);
48 typedef struct smpi_mpi_op_t *smpi_mpi_op_t;
49 typedef smpi_mpi_op_t MPI_Op;
51 // global SMPI data structure
52 typedef struct SMPI_MPI_Global {
54 smpi_mpi_communicator_t mpi_comm_world;
56 smpi_mpi_datatype_t mpi_byte;
57 smpi_mpi_datatype_t mpi_int;
58 smpi_mpi_datatype_t mpi_double;
60 smpi_mpi_op_t mpi_land;
61 smpi_mpi_op_t mpi_sum;
63 } s_SMPI_MPI_Global_t, *SMPI_MPI_Global_t;
64 extern SMPI_MPI_Global_t smpi_mpi_global;
66 #define MPI_COMM_WORLD (smpi_mpi_global->mpi_comm_world)
68 #define MPI_STATUS_IGNORE NULL
70 #define MPI_BYTE (smpi_mpi_global->mpi_byte)
71 #define MPI_DOUBLE (smpi_mpi_global->mpi_double)
72 #define MPI_INT (smpi_mpi_global->mpi_int)
74 #define MPI_LAND (smpi_mpi_global->mpi_land)
75 #define MPI_SUM (smpi_mpi_glboal->mpi_sum)
78 int MPI_Init(int *argc, char ***argv);
79 int MPI_Finalize(void);
80 int MPI_Abort(MPI_Comm comm, int errorcode);
81 int MPI_Comm_size(MPI_Comm comm, int *size);
82 int MPI_Comm_rank(MPI_Comm comm, int *rank);
83 int MPI_Type_size(MPI_Datatype datatype, size_t *size);
84 int MPI_Barrier(MPI_Comm comm);
85 int MPI_Irecv(void *buf, int count, MPI_Datatype datatype, int src, int tag, MPI_Comm comm, MPI_Request *request);
86 int MPI_Recv(void *buf, int count, MPI_Datatype datatype, int src, int tag, MPI_Comm comm, MPI_Status *status);
87 int MPI_Isend(void *buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm, MPI_Request *request);
88 int MPI_Send(void *buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm);
91 XBT_IMPORT_NO_EXPORT(int) smpi_simulated_main(int argc, char **argv);
92 unsigned int smpi_sleep(unsigned int);
94 int smpi_gettimeofday(struct timeval *tv, struct timezone *tz);