+double mpi_wtick__(void) {
+ return MPI_Wtick();
+}
+
+void mpi_comm_dup__(int* comm, int* newcomm, int* ierr) {
+ MPI_Comm tmp;
+
+ *ierr = MPI_Comm_dup(get_comm(*comm), &tmp);
+ if(*ierr == MPI_SUCCESS) {
+ *newcomm = new_comm(tmp);
+ }
+}
+
+void mpi_comm_create__(int* comm, int* group, int* newcomm, int* ierr) {
+ MPI_Comm tmp;
+
+ *ierr = MPI_Comm_create(get_comm(*comm),get_group(*group), &tmp);
+ if(*ierr == MPI_SUCCESS) {
+ *newcomm = new_comm(tmp);
+ }
+}
+
+
+void mpi_comm_free__(int* comm, int* ierr) {
+ MPI_Comm tmp = get_comm(*comm);
+
+ *ierr = MPI_Comm_free(&tmp);
+
+ if(*ierr == MPI_SUCCESS) {
+ free_comm(*comm);
+ }
+}
+
+void mpi_comm_split__(int* comm, int* color, int* key, int* comm_out, int* ierr) {
+ MPI_Comm tmp;
+
+ *ierr = MPI_Comm_split(get_comm(*comm), *color, *key, &tmp);
+ if(*ierr == MPI_SUCCESS) {
+ *comm_out = new_comm(tmp);
+ }
+}
+
+void mpi_group_incl__(int* group, int* n, int* ranks, int* group_out, int* ierr) {
+ MPI_Group tmp;
+
+ *ierr = MPI_Group_incl(get_group(*group), *n, ranks, &tmp);
+ if(*ierr == MPI_SUCCESS) {
+ *group_out = new_group(tmp);
+ }
+}
+
+void mpi_comm_group__(int* comm, int* group_out, int* ierr) {
+ MPI_Group tmp;
+
+ *ierr = MPI_Comm_group(get_comm(*comm), &tmp);
+ if(*ierr == MPI_SUCCESS) {
+ *group_out = new_group(tmp);
+ }
+}
+
+
+void mpi_initialized__(int* flag, int* ierr){
+ *ierr = MPI_Initialized(flag);
+}
+
+void mpi_send_init__(void *buf, int* count, int* datatype, int* dst, int* tag,
+ int* comm, int* request, int* ierr) {
+ MPI_Request req;
+
+ *ierr = MPI_Send_init(buf, *count, get_datatype(*datatype), *dst, *tag,
+ get_comm(*comm), &req);
+ if(*ierr == MPI_SUCCESS) {
+ *request = new_request(req);
+ }
+}
+
+void mpi_isend__(void *buf, int* count, int* datatype, int* dst,
+ int* tag, int* comm, int* request, int* ierr) {
+ MPI_Request req;
+
+ *ierr = MPI_Isend(buf, *count, get_datatype(*datatype), *dst, *tag,
+ get_comm(*comm), &req);
+ if(*ierr == MPI_SUCCESS) {
+ *request = new_request(req);
+ }
+}
+
+void mpi_irsend__(void *buf, int* count, int* datatype, int* dst,
+ int* tag, int* comm, int* request, int* ierr) {
+ MPI_Request req;
+
+ *ierr = MPI_Irsend(buf, *count, get_datatype(*datatype), *dst, *tag,
+ get_comm(*comm), &req);
+ if(*ierr == MPI_SUCCESS) {
+ *request = new_request(req);
+ }
+}
+
+void mpi_send__(void* buf, int* count, int* datatype, int* dst,
+ int* tag, int* comm, int* ierr) {
+ *ierr = MPI_Send(buf, *count, get_datatype(*datatype), *dst, *tag,
+ get_comm(*comm));
+}
+
+void mpi_rsend__(void* buf, int* count, int* datatype, int* dst,
+ int* tag, int* comm, int* ierr) {
+ *ierr = MPI_Rsend(buf, *count, get_datatype(*datatype), *dst, *tag,
+ get_comm(*comm));
+}
+
+void mpi_sendrecv__(void* sendbuf, int* sendcount, int* sendtype, int* dst,
+ int* sendtag, void *recvbuf, int* recvcount,
+ int* recvtype, int* src, int* recvtag,
+ int* comm, MPI_Status* status, int* ierr) {
+ *ierr = MPI_Sendrecv(sendbuf, *sendcount, get_datatype(*sendtype), *dst,
+ *sendtag, recvbuf, *recvcount,get_datatype(*recvtype), *src, *recvtag,
+ get_comm(*comm), status);
+}
+
+void mpi_recv_init__(void *buf, int* count, int* datatype, int* src, int* tag,
+ int* comm, int* request, int* ierr) {
+ MPI_Request req;
+
+ *ierr = MPI_Recv_init(buf, *count, get_datatype(*datatype), *src, *tag,
+ get_comm(*comm), &req);
+ if(*ierr == MPI_SUCCESS) {
+ *request = new_request(req);
+ }
+}
+
+void mpi_irecv__(void *buf, int* count, int* datatype, int* src, int* tag,
+ int* comm, int* request, int* ierr) {
+ MPI_Request req;
+
+ *ierr = MPI_Irecv(buf, *count, get_datatype(*datatype), *src, *tag,
+ get_comm(*comm), &req);
+ if(*ierr == MPI_SUCCESS) {
+ *request = new_request(req);
+ }
+}
+
+void mpi_recv__(void* buf, int* count, int* datatype, int* src,
+ int* tag, int* comm, MPI_Status* status, int* ierr) {
+ *ierr = MPI_Recv(buf, *count, get_datatype(*datatype), *src, *tag,
+ get_comm(*comm), status);
+}
+
+void mpi_start__(int* request, int* ierr) {
+ MPI_Request req = find_request(*request);
+
+ *ierr = MPI_Start(&req);
+}
+
+void mpi_startall__(int* count, int* requests, int* ierr) {
+ MPI_Request* reqs;
+ int i;
+
+ reqs = xbt_new(MPI_Request, *count);
+ for(i = 0; i < *count; i++) {
+ reqs[i] = find_request(requests[i]);
+ }
+ *ierr = MPI_Startall(*count, reqs);
+ free(reqs);
+}
+
+void mpi_wait__(int* request, MPI_Status* status, int* ierr) {
+ MPI_Request req = find_request(*request);
+
+ *ierr = MPI_Wait(&req, status);
+}
+
+void mpi_waitany__(int* count, int* requests, int* index, MPI_Status* status, int* ierr) {
+ MPI_Request* reqs;
+ int i;
+
+ reqs = xbt_new(MPI_Request, *count);
+ for(i = 0; i < *count; i++) {
+ reqs[i] = find_request(requests[i]);
+ }
+ *ierr = MPI_Waitany(*count, reqs, index, status);
+ free(reqs);
+}
+
+void mpi_waitall__(int* count, int* requests, MPI_Status* status, int* ierr) {
+ MPI_Request* reqs;
+ int i;
+
+ reqs = xbt_new(MPI_Request, *count);
+ for(i = 0; i < *count; i++) {
+ reqs[i] = find_request(requests[i]);
+ }
+ *ierr = MPI_Waitall(*count, reqs, status);
+ free(reqs);
+}
+
+void mpi_barrier__(int* comm, int* ierr) {
+ *ierr = MPI_Barrier(get_comm(*comm));
+}
+
+void mpi_bcast__(void *buf, int* count, int* datatype, int* root, int* comm, int* ierr) {
+ *ierr = MPI_Bcast(buf, *count, get_datatype(*datatype), *root, get_comm(*comm));
+}
+
+void mpi_reduce__(void* sendbuf, void* recvbuf, int* count,
+ int* datatype, int* op, int* root, int* comm, int* ierr) {
+ *ierr = MPI_Reduce(sendbuf, recvbuf, *count,
+ get_datatype(*datatype), get_op(*op), *root, get_comm(*comm));
+}
+
+void mpi_allreduce__(void* sendbuf, void* recvbuf, int* count, int* datatype,
+ int* op, int* comm, int* ierr) {
+ *ierr = MPI_Allreduce(sendbuf, recvbuf, *count, get_datatype(*datatype),
+ get_op(*op), get_comm(*comm));
+}
+
+void mpi_reduce_scatter__(void* sendbuf, void* recvbuf, int* recvcounts, int* datatype,
+ int* op, int* comm, int* ierr) {
+ *ierr = MPI_Reduce_scatter(sendbuf, recvbuf, recvcounts, get_datatype(*datatype),
+ get_op(*op), get_comm(*comm));
+}
+
+void mpi_scatter__(void* sendbuf, int* sendcount, int* sendtype,
+ void* recvbuf, int* recvcount, int* recvtype,
+ int* root, int* comm, int* ierr) {
+ *ierr = MPI_Scatter(sendbuf, *sendcount, get_datatype(*sendtype),
+ recvbuf, *recvcount, get_datatype(*recvtype), *root, get_comm(*comm));
+}
+
+
+void mpi_scatterv__(void* sendbuf, int* sendcounts, int* displs, int* sendtype,
+ void* recvbuf, int* recvcount, int* recvtype,
+ int* root, int* comm, int* ierr) {
+ *ierr = MPI_Scatterv(sendbuf, sendcounts, displs, get_datatype(*sendtype),
+ recvbuf, *recvcount, get_datatype(*recvtype), *root, get_comm(*comm));
+}
+
+void mpi_gather__(void* sendbuf, int* sendcount, int* sendtype,
+ void* recvbuf, int* recvcount, int* recvtype,
+ int* root, int* comm, int* ierr) {
+ *ierr = MPI_Gather(sendbuf, *sendcount, get_datatype(*sendtype),
+ recvbuf, *recvcount, get_datatype(*recvtype), *root, get_comm(*comm));
+}
+
+void mpi_gatherv__(void* sendbuf, int* sendcount, int* sendtype,
+ void* recvbuf, int* recvcounts, int* displs, int* recvtype,
+ int* root, int* comm, int* ierr) {
+ *ierr = MPI_Gatherv(sendbuf, *sendcount, get_datatype(*sendtype),
+ recvbuf, recvcounts, displs, get_datatype(*recvtype), *root, get_comm(*comm));
+}
+
+void mpi_allgather__(void* sendbuf, int* sendcount, int* sendtype,
+ void* recvbuf, int* recvcount, int* recvtype,
+ int* comm, int* ierr) {
+ *ierr = MPI_Allgather(sendbuf, *sendcount, get_datatype(*sendtype),
+ recvbuf, *recvcount, get_datatype(*recvtype), get_comm(*comm));
+}
+
+void mpi_allgatherv__(void* sendbuf, int* sendcount, int* sendtype,
+ void* recvbuf, int* recvcounts,int* displs, int* recvtype,
+ int* comm, int* ierr) {
+ *ierr = MPI_Allgatherv(sendbuf, *sendcount, get_datatype(*sendtype),
+ recvbuf, recvcounts, displs, get_datatype(*recvtype), get_comm(*comm));
+}
+
+void mpi_scan__(void* sendbuf, void* recvbuf, int* count, int* datatype,
+ int* op, int* comm, int* ierr) {
+ *ierr = MPI_Scan(sendbuf, recvbuf, *count, get_datatype(*datatype),
+ get_op(*op), get_comm(*comm));
+}
+
+void mpi_alltoall__(void* sendbuf, int* sendcount, int* sendtype,
+ void* recvbuf, int* recvcount, int* recvtype, int* comm, int* ierr) {
+ *ierr = MPI_Alltoall(sendbuf, *sendcount, get_datatype(*sendtype),
+ recvbuf, *recvcount, get_datatype(*recvtype), get_comm(*comm));
+}
+
+void mpi_alltoallv__(void* sendbuf, int* sendcounts, int* senddisps, int* sendtype,
+ void* recvbuf, int* recvcounts, int* recvdisps, int* recvtype, int* comm, int* ierr) {
+ *ierr = MPI_Alltoallv(sendbuf, sendcounts, senddisps, get_datatype(*sendtype),
+ recvbuf, recvcounts, recvdisps, get_datatype(*recvtype), get_comm(*comm));
+}
+
+void mpi_test__ (int * request, int *flag, MPI_Status * status, int* ierr){
+ MPI_Request req = find_request(*request);
+ *ierr= MPI_Test(&req, flag, status);
+}
+void mpi_get_processor_name__(char *name, int *resultlen, int* ierr){
+ *ierr = MPI_Get_processor_name(name, resultlen);
+}
+
+void mpi_get_count__(MPI_Status * status, int* datatype, int *count, int* ierr){
+ *ierr = MPI_Get_count(status, get_datatype(*datatype), count);
+}
+
+void mpi_attr_get__(int* comm, int* keyval, void* attr_value, int* flag, int* ierr ){
+ *ierr = MPI_Attr_get(get_comm(*comm), *keyval, attr_value, flag);
+}
+
+void mpi_type_extent__(int* datatype, MPI_Aint * extent, int* ierr){
+ *ierr= MPI_Type_extent(get_datatype(*datatype), extent);
+}
+
+void mpi_type_ub__(int* datatype, MPI_Aint * disp, int* ierr){
+ *ierr= MPI_Type_ub(get_datatype(*datatype), disp);
+}
+
+void mpi_type_lb__(int* datatype, MPI_Aint * extent, int* ierr){
+ *ierr= MPI_Type_extent(get_datatype(*datatype), extent);
+}
+
+void mpi_type_size__(int* datatype, int *size, int* ierr)
+{
+ *ierr = MPI_Type_size(get_datatype(*datatype), size);