Skip to content

Commit

Permalink
big count: embiggen the pml bsend attach/detach
Browse files Browse the repository at this point in the history
related to PR open-mpi#12226

don't pay much attention to the top level MPI_Buffer_detach etc.
code as it will be redone in open-mpi#12226.

Signed-off-by: Howard Pritchard <howardp@lanl.gov>
  • Loading branch information
hppritcha committed Oct 14, 2024
1 parent d14af58 commit 09dc54d
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 19 deletions.
6 changes: 3 additions & 3 deletions ompi/mca/pml/base/pml_base_bsend.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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);

Expand All @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions ompi/mca/pml/base/pml_base_bsend.h
Original file line number Diff line number Diff line change
Expand Up @@ -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*);
Expand Down
14 changes: 7 additions & 7 deletions ompi/mpi/c/buffer_attach.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

18 changes: 11 additions & 7 deletions ompi/mpi/c/buffer_detach.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

0 comments on commit 09dc54d

Please sign in to comment.