Convert legacy integer array status to MPI_Status type
Internal helper function for converting between array and type representations
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | status_array(MPI_STATUS_SIZE) |
pure function status_array_to_type(status_array) result(status_type) !! Convert legacy integer array status to MPI_Status type !! !! Internal helper function for converting between array and type representations integer, intent(in) :: status_array(MPI_STATUS_SIZE) type(MPI_Status) :: status_type ! Indexed by the implementation's own constants, never by literals. The ! layout of the legacy status array is implementation-defined: Open MPI ! puts source/tag/error at 1/2/3, MPICH -- and so cray-mpich -- at 3/4/5, ! with the byte count occupying the first two words. Hardcoding Open MPI's ! layout makes every tag read back as the count-high word, which is 0 for ! an ordinary uncancelled message: a receive that succeeded reports a tag ! nothing sent. status_type%MPI_SOURCE = status_array(MPI_SOURCE) status_type%MPI_TAG = status_array(MPI_TAG) status_type%MPI_ERROR = status_array(MPI_ERROR) end function status_array_to_type