Skip to content

Commit f8083d2

Browse files
authored
Merge pull request #12860 from hppritcha/embiggen_bsend_detach
big count: embiggen the pml bsend attach/detach
2 parents b858b9f + 09dc54d commit f8083d2

File tree

4 files changed

+23
-19
lines changed

4 files changed

+23
-19
lines changed

ompi/mca/pml/base/pml_base_bsend.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ static int mca_pml_base_bsend_fini (void)
133133
/*
134134
* User-level call to attach buffer.
135135
*/
136-
int mca_pml_base_bsend_attach(void* addr, int size)
136+
int mca_pml_base_bsend_attach(void* addr, size_t size)
137137
{
138138
int align;
139139

@@ -179,7 +179,7 @@ int mca_pml_base_bsend_attach(void* addr, int size)
179179
/*
180180
* User-level call to detach buffer
181181
*/
182-
int mca_pml_base_bsend_detach(void* addr, int* size)
182+
int mca_pml_base_bsend_detach(void* addr, size_t* size)
183183
{
184184
OPAL_THREAD_LOCK(&mca_pml_bsend_mutex);
185185

@@ -201,7 +201,7 @@ int mca_pml_base_bsend_detach(void* addr, int* size)
201201
if(NULL != addr)
202202
*((void**)addr) = mca_pml_bsend_userbase;
203203
if(NULL != size)
204-
*size = (int)mca_pml_bsend_usersize;
204+
*size = mca_pml_bsend_usersize;
205205

206206
/* reset local variables */
207207
mca_pml_bsend_userbase = NULL;

ompi/mca/pml/base/pml_base_bsend.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ BEGIN_C_DECLS
3030

3131
OMPI_DECLSPEC int mca_pml_base_bsend_init (void);
3232

33-
int mca_pml_base_bsend_attach(void* addr, int size);
34-
int mca_pml_base_bsend_detach(void* addr, int* size);
33+
int mca_pml_base_bsend_attach(void* addr, size_t size);
34+
int mca_pml_base_bsend_detach(void* addr, size_t* size);
3535

3636
OMPI_DECLSPEC int mca_pml_base_bsend_request_alloc(ompi_request_t*);
3737
OMPI_DECLSPEC int mca_pml_base_bsend_request_start(ompi_request_t*);

ompi/mpi/c/buffer_attach.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,15 @@ int MPI_Buffer_attach(void *buffer, int size)
4141
{
4242
int ret = OMPI_SUCCESS;
4343

44-
if (MPI_PARAM_CHECK) {
45-
OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
46-
if (NULL == buffer || size < 0) {
47-
return OMPI_ERRHANDLER_NOHANDLE_INVOKE(MPI_ERR_ARG, FUNC_NAME);
44+
if (MPI_PARAM_CHECK) {
45+
OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
46+
if (NULL == buffer || size < 0) {
47+
return OMPI_ERRHANDLER_NOHANDLE_INVOKE(MPI_ERR_ARG, FUNC_NAME);
48+
}
4849
}
49-
}
5050

51-
ret = mca_pml_base_bsend_attach(buffer, size);
51+
ret = mca_pml_base_bsend_attach(buffer, size);
5252

53-
return ret;
53+
return ret;
5454
}
5555

ompi/mpi/c/buffer_detach.c

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,16 +39,20 @@ static const char FUNC_NAME[] = "MPI_Buffer_detach";
3939

4040
int MPI_Buffer_detach(void *buffer, int *size)
4141
{
42+
size_t size_arg;
4243
int ret = OMPI_SUCCESS;
4344

44-
if (MPI_PARAM_CHECK) {
45-
OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
46-
if (NULL == buffer || NULL == size) {
47-
return OMPI_ERRHANDLER_NOHANDLE_INVOKE(MPI_ERR_ARG, FUNC_NAME);
45+
if (MPI_PARAM_CHECK) {
46+
OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
47+
if (NULL == buffer || NULL == size) {
48+
return OMPI_ERRHANDLER_NOHANDLE_INVOKE(MPI_ERR_ARG, FUNC_NAME);
49+
}
4850
}
49-
}
5051

51-
ret = mca_pml_base_bsend_detach(buffer, size);
52+
ret = mca_pml_base_bsend_detach(buffer, &size_arg);
53+
if (MPI_SUCCESS == ret) {
54+
*size = (int)size_arg;
55+
}
5256

53-
return ret;
57+
return ret;
5458
}

0 commit comments

Comments
 (0)