Skip to content

Commit 64d1e62

Browse files
committed
add new type to handle out void stars
from buffer detach operations. Signed-off-by: Howard Pritchard <howardp@lanl.gov>
1 parent 31c5a75 commit 64d1e62

File tree

4 files changed

+31
-9
lines changed

4 files changed

+31
-9
lines changed

ompi/mpi/bindings/ompi_bindings/c_type.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,28 @@ def type_text(self, enable_count=False):
214214
return f'void *'
215215

216216

217+
@Type.add_type('BUFFER_ADDR_OUT', abi_type=['ompi'])
218+
class TypeBufferOut(Type):
219+
220+
def type_text(self, enable_count=False):
221+
return f'void *'
222+
223+
224+
@Type.add_type('BUFFER_ADDR_OUT', abi_type=['standard'])
225+
class TypeBufferOutStandard(StandardABIType):
226+
227+
@property
228+
def final_code(self):
229+
return [f'if (NULL != {self.name}) *(void **){self.name} = {ConvertOMPIToStandard.BUFFER}(*(void **){self.name});']
230+
231+
def type_text(self, enable_count=False):
232+
return f'void *'
233+
234+
@property
235+
def argument(self):
236+
return f'{self.name}'
237+
238+
217239
@Type.add_type('BUFFER', abi_type=['standard'])
218240
class TypeBuffer(StandardABIType):
219241

ompi/mpi/c/buffer_detach.c.in

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,19 +29,19 @@
2929
#include "ompi/mca/pml/pml.h"
3030
#include "ompi/mca/pml/base/pml_base_bsend.h"
3131

32-
PROTOTYPE ERROR_CLASS buffer_detach(BUFFER_OUT buffer, COUNT_OUT size)
32+
PROTOTYPE ERROR_CLASS buffer_detach(BUFFER_ADDR_OUT buffer_addr, COUNT_OUT size)
3333
{
3434
size_t size_arg;
3535
int ret = OMPI_SUCCESS;
3636

3737
if (MPI_PARAM_CHECK) {
3838
OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
39-
if (NULL == buffer || NULL == size) {
39+
if (NULL == buffer_addr || NULL == size) {
4040
return OMPI_ERRHANDLER_NOHANDLE_INVOKE(MPI_ERR_ARG, FUNC_NAME);
4141
}
4242
}
4343

44-
ret = mca_pml_base_bsend_detach(BASE_BSEND_BUF, NULL, buffer, &size_arg);
44+
ret = mca_pml_base_bsend_detach(BASE_BSEND_BUF, NULL, buffer_addr, &size_arg);
4545
if (MPI_SUCCESS == ret) {
4646
#if OMPI_BIGCOUNT_SRC
4747
*size = size_arg;

ompi/mpi/c/comm_detach_buffer.c.in

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,22 +29,22 @@
2929
#include "ompi/mca/pml/pml.h"
3030
#include "ompi/mca/pml/base/pml_base_bsend.h"
3131

32-
PROTOTYPE ERROR_CLASS comm_detach_buffer(COMM comm, BUFFER_OUT buffer, COUNT_OUT size)
32+
PROTOTYPE ERROR_CLASS comm_detach_buffer(COMM comm, BUFFER_ADDR_OUT buffer_addr, COUNT_OUT size)
3333
{
3434
size_t size_arg;
3535
int ret = OMPI_SUCCESS;
3636

3737
if (MPI_PARAM_CHECK) {
3838
OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
39-
if (NULL == buffer || NULL == size) {
39+
if (NULL == buffer_addr || NULL == size) {
4040
return OMPI_ERRHANDLER_NOHANDLE_INVOKE(MPI_ERR_ARG, FUNC_NAME);
4141
}
4242
if (ompi_comm_invalid(comm)) {
4343
return OMPI_ERRHANDLER_NOHANDLE_INVOKE(MPI_ERR_COMM, FUNC_NAME);
4444
}
4545
}
4646

47-
ret = mca_pml_base_bsend_detach(COMM_BSEND_BUF, comm, buffer, &size_arg);
47+
ret = mca_pml_base_bsend_detach(COMM_BSEND_BUF, comm, buffer_addr, &size_arg);
4848
if (MPI_SUCCESS == ret) {
4949
#if OMPI_BIGCOUNT_SRC
5050
*size = size_arg;

ompi/mpi/c/session_detach_buffer.c.in

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,14 @@
2929
#include "ompi/mca/pml/pml.h"
3030
#include "ompi/mca/pml/base/pml_base_bsend.h"
3131

32-
PROTOTYPE ERROR_CLASS session_detach_buffer(SESSION session, BUFFER_OUT buffer, COUNT_OUT size)
32+
PROTOTYPE ERROR_CLASS session_detach_buffer(SESSION session, BUFFER_ADDR_OUT buffer_addr, COUNT_OUT size)
3333
{
3434
size_t size_arg;
3535
int ret = OMPI_SUCCESS;
3636

3737
if (MPI_PARAM_CHECK) {
3838
OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
39-
if (NULL == buffer || NULL == size) {
39+
if (NULL == buffer_addr || NULL == size) {
4040
return OMPI_ERRHANDLER_NOHANDLE_INVOKE(MPI_ERR_ARG, FUNC_NAME);
4141
}
4242
if (ompi_instance_invalid(session)) {
@@ -48,7 +48,7 @@ PROTOTYPE ERROR_CLASS session_detach_buffer(SESSION session, BUFFER_OUT buffer,
4848
}
4949
}
5050

51-
ret = mca_pml_base_bsend_detach(SESSION_BSEND_BUF, session, buffer, &size_arg);
51+
ret = mca_pml_base_bsend_detach(SESSION_BSEND_BUF, session, buffer_addr, &size_arg);
5252
if (MPI_SUCCESS == ret) {
5353
#if OMPI_BIGCOUNT_SRC
5454
*size = size_arg;

0 commit comments

Comments
 (0)