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 *rank = smpi_mpi_comm_rank(comm);
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;
105 if (NULL == request) {
106 retval = MPI_ERR_ARG;
109 retval = smpi_create_request(buf, count, datatype, src, dst, tag, comm, request);
110 if (NULL != *request && MPI_SUCCESS == retval) {
111 retval = smpi_mpi_irecv(*request);
120 int MPI_Recv(void *buf, int count, MPI_Datatype datatype, int src, int tag, MPI_Comm comm, MPI_Status *status)
122 int retval = MPI_SUCCESS;
124 smpi_mpi_request_t request;
128 retval = smpi_create_request(buf, count, datatype, src, dst, tag, comm, &request);
129 if (NULL != request && MPI_SUCCESS == retval) {
130 retval = smpi_mpi_irecv(request);
131 if (MPI_SUCCESS == retval) {
132 retval = smpi_mpi_wait(request, status);
134 xbt_mallocator_release(smpi_global->request_mallocator, request);
142 int MPI_Isend(void *buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm, MPI_Request *request)
144 int retval = MPI_SUCCESS;
148 if (NULL == request) {
149 retval = MPI_ERR_ARG;
152 retval = smpi_create_request(buf, count, datatype, src, dst, tag, comm, request);
153 if (NULL != *request && MPI_SUCCESS == retval) {
154 retval = smpi_mpi_isend(*request);
163 int MPI_Send(void *buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm)
165 int retval = MPI_SUCCESS;
167 smpi_mpi_request_t request;
171 retval = smpi_create_request(buf, count, datatype, src, dst, tag, comm, &request);
172 if (NULL != request && MPI_SUCCESS == retval) {
173 retval = smpi_mpi_isend(request);
174 if (MPI_SUCCESS == retval) {
175 smpi_mpi_wait(request, MPI_STATUS_IGNORE);
177 xbt_mallocator_release(smpi_global->request_mallocator, request);