57 #include "RTOp_MPI_config.h"
61 int MPI_Init(
int *argc,
char ***argv)
66 int MPI_Finalize(
void)
71 int MPI_Comm_size(MPI_Comm comm,
int *size)
77 int MPI_Comm_rank(MPI_Comm comm,
int *rank)
83 int MPI_Type_struct(
int count ,
int *array_of_blocklengths, MPI_Aint *array_of_displacements
84 , MPI_Datatype *array_of_types, MPI_Datatype *data_type)
87 int len = 0, extent = 0, k = 0;
88 for( k = 0; k < count; ++k ) {
89 switch( array_of_types[k] ) {
100 len =
sizeof(double);
105 len = array_of_displacements[k] + array_of_blocklengths[k] * len;
113 int MPI_Type_commit(MPI_Datatype *datatype)
118 int MPI_Type_free(MPI_Datatype *op)
120 *op = MPI_DATATYPE_NULL;
124 int MPI_Op_create(MPI_User_function *func,
int communitive, MPI_Op *op)
129 int MPI_Op_free( MPI_Op *op)
135 int MPI_Send(
void* buf,
int count, MPI_Datatype datatype,
int dest,
int tag, MPI_Comm comm)
140 int MPI_Recv(
void* buf,
int count, MPI_Datatype datatype,
int source,
int tag, MPI_Comm comm, RTOP_MPI_Status* status)
146 int MPI_Sendrecv_replace(
void* buff,
int count, MPI_Datatype datatype,
int dest,
int sendtag,
int source,
int recvtag, MPI_Comm comm, RTOP_MPI_Status* status)
152 int MPI_Reduce(
void* sendbuf,
void* recvbuf,
int count, MPI_Datatype datatype, MPI_Op op
153 ,
int root, MPI_Comm comm)
159 for( k = 0; k < count * datatype; ++k )
160 _recvbuf[k] =_sendbuf[k];
164 int MPI_Allreduce(
void* sendbuf,
void* recvbuf,
int count, MPI_Datatype datatype
165 , MPI_Op op, MPI_Comm comm)
171 for( k = 0; k < count * datatype; ++k )
172 _recvbuf[k] =_sendbuf[k];
176 int MPI_Barrier(MPI_Comm comm)
181 int MPI_Bcast(
void* buffer,
int count, MPI_Datatype datatype,
int root, MPI_Comm comm )
186 int MPI_Gather(
void* sendbuf,
int sendcount, MPI_Datatype sendtype
187 ,
void* recvbuf,
int recvcount, MPI_Datatype recvtype,
int root , MPI_Comm comm )
193 assert(sendtype == recvtype);
194 assert(sendcount == recvcount);
195 for( k = 0; k < sendcount * sendtype; ++k )
196 _recvbuf[k] =_sendbuf[k];