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)
25 int MPI_Comm_size(MPI_Comm comm, int *size)
27 int retval = MPI_SUCCESS;
32 retval = MPI_ERR_COMM;
33 } else if (NULL == size) {
44 int MPI_Comm_rank(MPI_Comm comm, int *rank)
46 int retval = MPI_SUCCESS;
51 retval = MPI_ERR_COMM;
52 } else if (NULL == rank) {
55 retval = smpi_mpi_comm_rank(comm, rank);
63 int MPI_Type_size(MPI_Datatype datatype, size_t *size)
65 int retval = MPI_SUCCESS;
69 if (NULL == datatype) {
70 retval = MPI_ERR_TYPE;
71 } else if (NULL == size) {
74 *size = datatype->size;
82 int MPI_Barrier(MPI_Comm comm)
84 int retval = MPI_SUCCESS;
89 retval = MPI_ERR_COMM;
91 retval = smpi_mpi_barrier(comm);
99 int MPI_Irecv(void *buf, int count, MPI_Datatype datatype, int src, int tag, MPI_Comm comm, MPI_Request *request)
101 int retval = MPI_SUCCESS;
106 //dst = smpi_mpi_comm_rank(comm);
107 if (NULL == request) {
108 retval = MPI_ERR_ARG;
110 retval = smpi_create_request(buf, count, datatype, src, dst, tag, comm, request);
111 if (NULL != *request && MPI_SUCCESS == retval) {
112 retval = smpi_mpi_irecv(*request);
121 int MPI_Recv(void *buf, int count, MPI_Datatype datatype, int src, int tag, MPI_Comm comm, MPI_Status *status)
123 int retval = MPI_SUCCESS;
125 smpi_mpi_request_t request;
130 //dst = smpi_mpi_comm_rank(comm);
131 retval = smpi_create_request(buf, count, datatype, src, dst, tag, comm, &request);
133 if (NULL != request && MPI_SUCCESS == retval) {
134 retval = smpi_mpi_irecv(request);
135 if (MPI_SUCCESS == retval) {
136 retval = smpi_mpi_wait(request, status);
138 xbt_mallocator_release(smpi_global->request_mallocator, request);
146 int MPI_Isend(void *buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm, MPI_Request *request)
148 int retval = MPI_SUCCESS;
153 //src = smpi_mpi_comm_rank(comm);
154 if (NULL == request) {
155 retval = MPI_ERR_ARG;
157 retval = smpi_create_request(buf, count, datatype, src, dst, tag, comm, request);
158 if (NULL != *request && MPI_SUCCESS == retval) {
159 retval = smpi_mpi_isend(*request);
168 int MPI_Send(void *buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm)
170 int retval = MPI_SUCCESS;
172 smpi_mpi_request_t request;
176 //src = smpi_mpi_comm_rank(comm);
177 retval = smpi_create_request(buf, count, datatype, src, dst, tag, comm, &request);
178 if (NULL != request && MPI_SUCCESS == retval) {
179 retval = smpi_mpi_isend(request);
180 if (MPI_SUCCESS == retval) {
181 smpi_mpi_wait(request, MPI_STATUS_IGNORE);
183 xbt_mallocator_release(smpi_global->request_mallocator, request);