/* TODO: still needs to handle partial datatypes and situations where the mpi * implementation fills status with something other than bytes (globus2 might * do this) */ int MPIR_Status_set_bytes(MPI_Status *status, MPI_Datatype datatype, MPI_Count nbytes) { MPL_UNREFERENCED_ARG(datatype); /* it's ok that ROMIO stores number-of-bytes in status, not * count-of-copies, as long as MPI_GET_COUNT knows what to do */ if (status != MPI_STATUS_IGNORE) MPI_Status_set_elements_x(status, MPI_BYTE, nbytes); return MPI_SUCCESS; }
int ADIOI_GEN_aio_query_fn(void *extra_state, MPI_Status *status) { ADIOI_AIO_Request *aio_req; aio_req = (ADIOI_AIO_Request *)extra_state; MPI_Status_set_elements_x(status, MPI_BYTE, aio_req->nbytes); /* can never cancel so always true */ MPI_Status_set_cancelled(status, 0); /* choose not to return a value for this */ status->MPI_SOURCE = MPI_UNDEFINED; /* tag has no meaning for this generalized request */ status->MPI_TAG = MPI_UNDEFINED; /* this generalized request never fails */ return MPI_SUCCESS; }
void ompi_status_set_elements_x_f(MPI_Fint *status, MPI_Fint *datatype, MPI_Count *count, MPI_Fint *ierr) { int c_ierr; MPI_Datatype c_type = MPI_Type_f2c(*datatype); MPI_Status c_status; /* This seems silly, but someone will do it */ if (OMPI_IS_FORTRAN_STATUS_IGNORE(status)) { c_ierr = MPI_SUCCESS; } else { MPI_Status_f2c( status, &c_status ); c_ierr = MPI_Status_set_elements_x(&c_status, c_type, *count); /* If datatype is really being set, then that needs to be converted.... */ if (MPI_SUCCESS == c_ierr) { MPI_Status_c2f(&c_status, status); } } if (NULL != ierr) *ierr = OMPI_INT_2_FINT(c_ierr); }
int test_count(MPI_Count count) { MPI_Status stat; int cancelled, cancelled2; MPI_Count bcount, bcount2; int nerrs = 0; bcount = count; cancelled = 0; MPI_Status_set_cancelled(&stat, cancelled); MPI_Status_set_elements_x(&stat, MPI_BYTE, bcount); MPI_Get_elements_x(&stat, MPI_BYTE, &bcount2); MPI_Test_cancelled(&stat, &cancelled2); if (bcount != bcount2) { fprintf(stderr, "Count Error: expected %llx, got %llx\n", (long long int)bcount, (long long int)bcount2); nerrs++; } if (cancelled != cancelled2) { fprintf(stderr, "Cancelled Error: expected %d, got %d\n", cancelled, cancelled2); nerrs++; } return nerrs; }