3 int MPI_Init(int *argc, char ***argv)
17 // right now this just exits the current node, should send abort signal to all
18 // hosts in the communicator;
19 int MPI_Abort(MPI_Comm comm, int errorcode)
26 int MPI_Comm_size(MPI_Comm comm, int *size)
28 int retval = MPI_SUCCESS;
33 retval = MPI_ERR_COMM;
34 } else if (NULL == size) {
45 int MPI_Comm_rank(MPI_Comm comm, int *rank)
47 int retval = MPI_SUCCESS;
52 retval = MPI_ERR_COMM;
53 } else if (NULL == rank) {
56 *rank = smpi_mpi_comm_rank(comm, SIMIX_host_self());
64 int MPI_Type_size(MPI_Datatype datatype, size_t *size)
66 int retval = MPI_SUCCESS;
70 if (NULL == datatype) {
71 retval = MPI_ERR_TYPE;
72 } else if (NULL == size) {
75 *size = datatype->size;
83 // FIXME: check comm value and barrier success...
84 int MPI_Barrier(MPI_Comm comm)
92 int MPI_Irecv(void *buf, int count, MPI_Datatype datatype, int src, int tag, MPI_Comm comm, MPI_Request *request)
94 int retval = MPI_SUCCESS;
97 dst = smpi_mpi_comm_rank_self(comm);
98 retval = smpi_create_request(buf, count, datatype, src, dst, tag, comm, request);
99 if (NULL != *request && MPI_SUCCESS == retval) {
100 retval = smpi_irecv(*request);
106 int MPI_Recv(void *buf, int count, MPI_Datatype datatype, int src, int tag, MPI_Comm comm, MPI_Status *status)
108 int retval = MPI_SUCCESS;
110 smpi_mpi_request_t request;
113 dst = smpi_mpi_comm_rank_self(comm);
114 retval = smpi_create_request(buf, count, datatype, src, dst, tag, comm, &request);
115 if (NULL != request && MPI_SUCCESS == retval) {
116 retval = smpi_irecv(request);
117 if (MPI_SUCCESS == retval) {
118 retval = smpi_wait(request, status);
120 rank = smpi_mpi_comm_rank_self(smpi_mpi_global->mpi_comm_world);
121 xbt_mallocator_release(smpi_global->request_mallocator, request);
127 int MPI_Isend(void *buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm, MPI_Request *request)
129 int retval = MPI_SUCCESS;
132 src = smpi_mpi_comm_rank_self(comm);
133 retval = smpi_create_request(buf, count, datatype, src, dst, tag, comm, request);
134 if (NULL != *request && MPI_SUCCESS == retval) {
135 retval = smpi_isend(*request);
141 int MPI_Send(void *buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm)
143 int retval = MPI_SUCCESS;
145 smpi_mpi_request_t request;
148 src = smpi_mpi_comm_rank_self(comm);
149 retval = smpi_create_request(buf, count, datatype, src, dst, tag, comm, &request);
150 if (NULL != request && MPI_SUCCESS == retval) {
151 retval = smpi_isend(request);
152 if (MPI_SUCCESS == retval) {
153 smpi_wait(request, MPI_STATUS_IGNORE);
155 rank = smpi_mpi_comm_rank_self(smpi_mpi_global->mpi_comm_world);
156 xbt_mallocator_release(smpi_global->request_mallocator, request);