-#define MPI_SUM (smpi_mpi_glboal->mpi_sum)
-
-// MPI Functions
-int MPI_Init(int *argc, char ***argv);
-int MPI_Finalize(void);
-int MPI_Abort(MPI_Comm comm, int errorcode);
-int MPI_Comm_size(MPI_Comm comm, int *size);
-int MPI_Comm_rank(MPI_Comm comm, int *rank);
-int MPI_Type_size(MPI_Datatype datatype, size_t *size);
-int MPI_Barrier(MPI_Comm comm);
-int MPI_Irecv(void *buf, int count, MPI_Datatype datatype, int src, int tag, MPI_Comm comm, MPI_Request *request);
-int MPI_Recv(void *buf, int count, MPI_Datatype datatype, int src, int tag, MPI_Comm comm, MPI_Status *status);
-int MPI_Isend(void *buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm, MPI_Request *request);
-int MPI_Send(void *buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm);
+#define MPI_SUM (smpi_mpi_global->mpi_sum)
+#define MPI_MIN (smpi_mpi_global->mpi_min)
+#define MPI_MAX (smpi_mpi_global->mpi_max)
+
+// MPI macros
+#define MPI_Init(a, b) SMPI_MPI_Init(a, b)
+#define MPI_Finalize() SMPI_MPI_Finalize()
+#define MPI_Abort(a, b) SMPI_MPI_Abort(a, b)
+#define MPI_Comm_size(a, b) SMPI_MPI_Comm_size(a, b)
+#define MPI_Comm_rank(a, b) SMPI_MPI_Comm_rank(a, b)
+#define MPI_Type_size(a, b) SMPI_MPI_Type_size(a, b)
+#define MPI_Barrier(a) SMPI_MPI_Barrier(a)
+#define MPI_Irecv(a, b, c, d, e, f, g) SMPI_MPI_Irecv(a, b, c, d, e, f, g)
+#define MPI_Recv(a, b, c, d, e, f, g) SMPI_MPI_Recv(a, b, c, d, e, f, g)
+#define MPI_Isend(a, b, c, d, e, f, g) SMPI_MPI_Isend(a, b, c, d, e, f, g)
+#define MPI_Send(a, b, c, d, e, f) SMPI_MPI_Send(a, b, c, d, e, f)
+#define MPI_Bcast(a, b, c, d, e) SMPI_MPI_Bcast(a, b, c, d, e)
+#define MPI_Wait(a, b) SMPI_MPI_Wait(a, b)
+#define MPI_Waitall(a, b, c) SMPI_MPI_Waitall(a, b, c)
+#define MPI_Waitany(a, b, c, d) SMPI_MPI_Waitany(a, b, c, d)
+#define MPI_Comm_split(a, b, c, d) SMPI_MPI_Comm_split(a, b, c, d)
+#define MPI_Wtime() SMPI_MPI_Wtime()
+#define MPI_Reduce( a, b, c, d, e, f, g) SMPI_MPI_Reduce( a, b, c, d, e, f, g)
+#define MPI_Allreduce( a, b, c, d, e, f) SMPI_MPI_Allreduce( a, b, c, d, e, f)
+
+// SMPI Functions
+XBT_PUBLIC(int) SMPI_MPI_Init(int *argc, char ***argv);
+XBT_PUBLIC(int) SMPI_MPI_Finalize(void);
+XBT_PUBLIC(int) SMPI_MPI_Abort(MPI_Comm comm, int errorcode);
+XBT_PUBLIC(int) SMPI_MPI_Comm_size(MPI_Comm comm, int *size);
+XBT_PUBLIC(int) SMPI_MPI_Comm_rank(MPI_Comm comm, int *rank);
+XBT_PUBLIC(int) SMPI_MPI_Type_size(MPI_Datatype datatype, size_t * size);
+XBT_PUBLIC(int) SMPI_MPI_Barrier(MPI_Comm comm);
+XBT_PUBLIC(int) SMPI_MPI_Irecv(void *buf, int count, MPI_Datatype datatype,
+ int src, int tag, MPI_Comm comm,
+ MPI_Request * request);
+XBT_PUBLIC(int) SMPI_MPI_Recv(void *buf, int count, MPI_Datatype datatype,
+ int src, int tag, MPI_Comm comm,
+ MPI_Status * status);
+XBT_PUBLIC(int) SMPI_MPI_Isend(void *buf, int count, MPI_Datatype datatype,
+ int dst, int tag, MPI_Comm comm,
+ MPI_Request * request);
+XBT_PUBLIC(int) SMPI_MPI_Send(void *buf, int count, MPI_Datatype datatype,
+ int dst, int tag, MPI_Comm comm);
+XBT_PUBLIC(int) SMPI_MPI_Bcast(void *buf, int count, MPI_Datatype datatype,
+ int root, MPI_Comm comm);
+XBT_PUBLIC(int) SMPI_MPI_Wait(MPI_Request * request, MPI_Status * status);
+XBT_PUBLIC(int) SMPI_MPI_Waitall(int count, MPI_Request requests[],
+ MPI_Status status[]);
+XBT_PUBLIC(int) SMPI_MPI_Waitany(int count, MPI_Request requests[],
+ int *index, MPI_Status status[]);
+XBT_PUBLIC(int) SMPI_MPI_Comm_split(MPI_Comm comm, int color, int key,
+ MPI_Comm * comm_out);
+XBT_PUBLIC(double) SMPI_MPI_Wtime(void);
+
+XBT_PUBLIC(int) SMPI_MPI_Reduce(void *sendbuf, void *recvbuf, int count,
+ MPI_Datatype datatype, MPI_Op op, int root,
+ MPI_Comm comm);
+XBT_PUBLIC(int) SMPI_MPI_Allreduce(void *sendbuf, void *recvbuf, int count,
+ MPI_Datatype datatype, MPI_Op op, MPI_Comm comm);
+