diff --git a/ompi/mca/pml/base/pml_base_bsend.c b/ompi/mca/pml/base/pml_base_bsend.c index a917412ff33..d1c38e90209 100644 --- a/ompi/mca/pml/base/pml_base_bsend.c +++ b/ompi/mca/pml/base/pml_base_bsend.c @@ -133,7 +133,7 @@ static int mca_pml_base_bsend_fini (void) /* * User-level call to attach buffer. */ -int mca_pml_base_bsend_attach(void* addr, int size) +int mca_pml_base_bsend_attach(void* addr, size_t size) { int align; @@ -179,7 +179,7 @@ int mca_pml_base_bsend_attach(void* addr, int size) /* * User-level call to detach buffer */ -int mca_pml_base_bsend_detach(void* addr, int* size) +int mca_pml_base_bsend_detach(void* addr, size_t* size) { OPAL_THREAD_LOCK(&mca_pml_bsend_mutex); @@ -201,7 +201,7 @@ int mca_pml_base_bsend_detach(void* addr, int* size) if(NULL != addr) *((void**)addr) = mca_pml_bsend_userbase; if(NULL != size) - *size = (int)mca_pml_bsend_usersize; + *size = mca_pml_bsend_usersize; /* reset local variables */ mca_pml_bsend_userbase = NULL; diff --git a/ompi/mca/pml/base/pml_base_bsend.h b/ompi/mca/pml/base/pml_base_bsend.h index 725427e27f1..0d3c47a7ca5 100644 --- a/ompi/mca/pml/base/pml_base_bsend.h +++ b/ompi/mca/pml/base/pml_base_bsend.h @@ -30,8 +30,8 @@ BEGIN_C_DECLS OMPI_DECLSPEC int mca_pml_base_bsend_init (void); -int mca_pml_base_bsend_attach(void* addr, int size); -int mca_pml_base_bsend_detach(void* addr, int* size); +int mca_pml_base_bsend_attach(void* addr, size_t size); +int mca_pml_base_bsend_detach(void* addr, size_t* size); OMPI_DECLSPEC int mca_pml_base_bsend_request_alloc(ompi_request_t*); OMPI_DECLSPEC int mca_pml_base_bsend_request_start(ompi_request_t*); diff --git a/ompi/mpi/c/buffer_attach.c b/ompi/mpi/c/buffer_attach.c index be9a43adad6..ab28ffba31e 100644 --- a/ompi/mpi/c/buffer_attach.c +++ b/ompi/mpi/c/buffer_attach.c @@ -41,15 +41,15 @@ int MPI_Buffer_attach(void *buffer, int size) { int ret = OMPI_SUCCESS; - if (MPI_PARAM_CHECK) { - OMPI_ERR_INIT_FINALIZE(FUNC_NAME); - if (NULL == buffer || size < 0) { - return OMPI_ERRHANDLER_NOHANDLE_INVOKE(MPI_ERR_ARG, FUNC_NAME); + if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + if (NULL == buffer || size < 0) { + return OMPI_ERRHANDLER_NOHANDLE_INVOKE(MPI_ERR_ARG, FUNC_NAME); + } } - } - ret = mca_pml_base_bsend_attach(buffer, size); + ret = mca_pml_base_bsend_attach(buffer, size); - return ret; + return ret; } diff --git a/ompi/mpi/c/buffer_detach.c b/ompi/mpi/c/buffer_detach.c index 9c5cd9e60a2..f50bb609f63 100644 --- a/ompi/mpi/c/buffer_detach.c +++ b/ompi/mpi/c/buffer_detach.c @@ -39,16 +39,20 @@ static const char FUNC_NAME[] = "MPI_Buffer_detach"; int MPI_Buffer_detach(void *buffer, int *size) { + size_t size_arg; int ret = OMPI_SUCCESS; - if (MPI_PARAM_CHECK) { - OMPI_ERR_INIT_FINALIZE(FUNC_NAME); - if (NULL == buffer || NULL == size) { - return OMPI_ERRHANDLER_NOHANDLE_INVOKE(MPI_ERR_ARG, FUNC_NAME); + if (MPI_PARAM_CHECK) { + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + if (NULL == buffer || NULL == size) { + return OMPI_ERRHANDLER_NOHANDLE_INVOKE(MPI_ERR_ARG, FUNC_NAME); + } } - } - ret = mca_pml_base_bsend_detach(buffer, size); + ret = mca_pml_base_bsend_detach(buffer, &size_arg); + if (MPI_SUCCESS == ret) { + *size = (int)size_arg; + } - return ret; + return ret; }