1
1

* partial fix for #264... We need to return an MPI_ERR_BUFFER if we've run

out of buffer space

This commit was SVN r11229.
Этот коммит содержится в:
Brian Barrett 2006-08-16 17:32:31 +00:00
родитель 8c7f0ed9ae
Коммит 0f47949703

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

@ -222,46 +222,53 @@ do { \
&sendreq->req_mtl)); \
} while (0)
#define MCA_PML_CM_HVY_SEND_REQUEST_BSEND_ALLOC(sendreq) \
do { \
struct iovec iov; \
unsigned int iov_count; \
size_t max_data; \
int freeAfter; \
\
if(sendreq->req_count > 0) { \
sendreq->req_addr = \
mca_pml_base_bsend_request_alloc_buf(sendreq->req_count); \
iov.iov_base = sendreq->req_addr; \
max_data = iov.iov_len = sendreq->req_count; \
iov_count = 1; \
ompi_convertor_pack( &sendreq->req_send.req_base.req_convertor, \
&iov, \
&iov_count, \
&max_data, &freeAfter); \
ompi_convertor_prepare_for_send( &sendreq->req_send.req_base.req_convertor, MPI_PACKED,\
max_data, sendreq->req_addr ); \
#define MCA_PML_CM_HVY_SEND_REQUEST_BSEND_ALLOC(sendreq, ret) \
do { \
struct iovec iov; \
unsigned int iov_count; \
size_t max_data; \
int freeAfter; \
\
if(sendreq->req_count > 0) { \
sendreq->req_addr = \
mca_pml_base_bsend_request_alloc_buf(sendreq->req_count); \
if (NULL == sendreq->req_addr) { \
ret = MPI_ERR_BUFFER; \
} else { \
iov.iov_base = sendreq->req_addr; \
max_data = iov.iov_len = sendreq->req_count; \
iov_count = 1; \
ompi_convertor_pack( &sendreq->req_send.req_base.req_convertor, \
&iov, \
&iov_count, \
&max_data, &freeAfter); \
ompi_convertor_prepare_for_send( &sendreq->req_send.req_base.req_convertor, MPI_PACKED, \
max_data, sendreq->req_addr ); \
} \
} \
} while(0);
#define MCA_PML_CM_HVY_SEND_REQUEST_START(sendreq, ret) \
do { \
ret = OMPI_SUCCESS; \
MCA_PML_CM_SEND_REQUEST_START_SETUP((&sendreq->req_send)); \
if (sendreq->req_send.req_send_mode == MCA_PML_BASE_SEND_BUFFERED) { \
MCA_PML_CM_HVY_SEND_REQUEST_BSEND_ALLOC(sendreq); \
MCA_PML_CM_HVY_SEND_REQUEST_BSEND_ALLOC(sendreq, ret); \
} \
ret = OMPI_MTL_CALL(isend(ompi_mtl, \
sendreq->req_comm, \
sendreq->req_peer, \
sendreq->req_tag, \
&sendreq->req_send.req_base.req_convertor, \
sendreq->req_send.req_send_mode, \
sendreq->req_blocking, \
&sendreq->req_mtl)); \
if(OMPI_SUCCESS == ret && \
sendreq->req_send.req_send_mode == MCA_PML_BASE_SEND_BUFFERED) { \
MCA_PML_BASE_REQUEST_MPI_COMPLETE(&(sendreq->req_send.req_base.req_ompi)); \
if (OMPI_SUCCESS == ret) { \
ret = OMPI_MTL_CALL(isend(ompi_mtl, \
sendreq->req_comm, \
sendreq->req_peer, \
sendreq->req_tag, \
&sendreq->req_send.req_base.req_convertor, \
sendreq->req_send.req_send_mode, \
sendreq->req_blocking, \
&sendreq->req_mtl)); \
if(OMPI_SUCCESS == ret && \
sendreq->req_send.req_send_mode == MCA_PML_BASE_SEND_BUFFERED) { \
MCA_PML_BASE_REQUEST_MPI_COMPLETE(&(sendreq->req_send.req_base.req_ompi)); \
} \
} \
} while (0)