1
1

Merge pull request #3260 from derbeyn/fix_yalla

Fix yalla PML: MPI_Recv does not return MPI_ERR_TRUNCATE upon overflow
Этот коммит содержится в:
Yossi 2017-04-18 11:37:48 +03:00 коммит произвёл GitHub
родитель 518cdd1603 f918d88c3e
Коммит 9ebcafd6d6
2 изменённых файлов: 36 добавлений и 27 удалений

Просмотреть файл

@ -369,6 +369,7 @@ int mca_pml_yalla_recv(void *buf, size_t count, ompi_datatype_t *datatype, int s
{ {
mxm_recv_req_t rreq; mxm_recv_req_t rreq;
mxm_error_t error; mxm_error_t error;
int rc;
PML_YALLA_INIT_MXM_RECV_REQ(&rreq, buf, count, datatype, src, tag, comm, recv); PML_YALLA_INIT_MXM_RECV_REQ(&rreq, buf, count, datatype, src, tag, comm, recv);
PML_YALLA_INIT_BLOCKING_MXM_RECV_REQ(&rreq); PML_YALLA_INIT_BLOCKING_MXM_RECV_REQ(&rreq);
@ -387,10 +388,10 @@ int mca_pml_yalla_recv(void *buf, size_t count, ompi_datatype_t *datatype, int s
rreq.completion.sender_imm, rreq.completion.sender_tag, rreq.completion.sender_imm, rreq.completion.sender_tag,
rreq.tag, rreq.tag_mask, rreq.tag, rreq.tag_mask,
rreq.completion.actual_len); rreq.completion.actual_len);
PML_YALLA_SET_RECV_STATUS(&rreq, rreq.completion.actual_len, status); rc = PML_YALLA_SET_RECV_STATUS(&rreq, rreq.completion.actual_len, status);
PML_YALLA_FREE_BLOCKING_MXM_REQ(&rreq.base); PML_YALLA_FREE_BLOCKING_MXM_REQ(&rreq.base);
return OMPI_SUCCESS; return rc;
} }
int mca_pml_yalla_isend_init(const void *buf, size_t count, ompi_datatype_t *datatype, int mca_pml_yalla_isend_init(const void *buf, size_t count, ompi_datatype_t *datatype,
@ -678,8 +679,7 @@ int mca_pml_yalla_mrecv(void *buf, size_t count, ompi_datatype_t *datatype,
rreq.completion.sender_imm, rreq.completion.sender_tag, rreq.completion.sender_imm, rreq.completion.sender_tag,
rreq.tag, rreq.tag_mask, rreq.tag, rreq.tag_mask,
rreq.completion.actual_len); rreq.completion.actual_len);
PML_YALLA_SET_RECV_STATUS(&rreq, rreq.completion.actual_len, status); return PML_YALLA_SET_RECV_STATUS(&rreq, rreq.completion.actual_len, status);
return OMPI_SUCCESS;
} }
int mca_pml_yalla_start(size_t count, ompi_request_t** requests) int mca_pml_yalla_start(size_t count, ompi_request_t** requests)

Просмотреть файл

@ -175,31 +175,40 @@ static inline mca_pml_yalla_send_request_t* MCA_PML_YALLA_SREQ_INIT(void *_buf,
} \ } \
} }
#define PML_YALLA_SET_RECV_STATUS(_rreq, _length, _mpi_status) \ static inline int PML_YALLA_SET_RECV_STATUS(mxm_recv_req_t *_rreq,
{ \ size_t _length,
if ((_mpi_status) != MPI_STATUS_IGNORE) { \ ompi_status_public_t *_mpi_status)
switch ((_rreq)->base.error) { \ {
case MXM_OK: \ int rc;
(_mpi_status)->MPI_ERROR = OMPI_SUCCESS; \
break; \ switch (_rreq->base.error) {
case MXM_ERR_CANCELED: \ case MXM_OK:
(_mpi_status)->MPI_ERROR = OMPI_SUCCESS; \ rc = OMPI_SUCCESS;
(_mpi_status)->_cancelled = true; \ break;
break; \ case MXM_ERR_CANCELED:
case MXM_ERR_MESSAGE_TRUNCATED: \ rc = OMPI_SUCCESS;
(_mpi_status)->MPI_ERROR = MPI_ERR_TRUNCATE; \ break;
break; \ case MXM_ERR_MESSAGE_TRUNCATED:
default: \ rc = MPI_ERR_TRUNCATE;
(_mpi_status)->MPI_ERROR = MPI_ERR_INTERN; \ break;
break; \ default:
} \ rc = MPI_ERR_INTERN;
\ break;
(_mpi_status)->MPI_TAG = (_rreq)->completion.sender_tag; \
(_mpi_status)->MPI_SOURCE = (_rreq)->completion.sender_imm; \
(_mpi_status)->_ucount = (_length); \
} \
} }
/* If status is not ignored, fill what is needed */
if (_mpi_status != MPI_STATUS_IGNORE) {
_mpi_status->MPI_ERROR = rc;
if (MXM_ERR_CANCELED == _rreq->base.error) {
_mpi_status->_cancelled = true;
}
_mpi_status->MPI_TAG = _rreq->completion.sender_tag;
_mpi_status->MPI_SOURCE = _rreq->completion.sender_imm;
_mpi_status->_ucount = _length;
}
return rc;
}
#define PML_YALLA_SET_MESSAGE(_rreq, _comm, _mxm_msg, _message) \ #define PML_YALLA_SET_MESSAGE(_rreq, _comm, _mxm_msg, _message) \
{ \ { \
*(_message) = ompi_message_alloc(); \ *(_message) = ompi_message_alloc(); \