Skip to content

Commit 2296bf2

Browse files
committed
add support for typeclass
Signed-off-by: Howard Pritchard <[email protected]>
1 parent 017ed80 commit 2296bf2

File tree

3 files changed

+20
-5
lines changed

3 files changed

+20
-5
lines changed

ompi/mpi/bindings/ompi_bindings/c.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -547,9 +547,6 @@ def generate_combiner_convert_fn_intern_to_abi(self):
547547
def generate_typeclass_convert_fn(self):
548548
self.generic_convert(ConvertFuncs.TYPECLASS, 'typeclass', 'int', consts.TYPECLASS_VALUES)
549549

550-
def generate_typeclass_convert_fn(self):
551-
self.generic_convert(ConvertFuncs.TYPECLASS, 'typeclass', 'int', consts.TYPECLASS_VALUES)
552-
553550
def generate_win_lock_convert_fn(self):
554551
self.generic_convert(ConvertFuncs.WIN_LOCK, 'lock_assert', 'int', consts.WIN_LOCK_VALUES)
555552

@@ -749,6 +746,7 @@ def dump_code(self):
749746
self.generate_t_cb_safety_convert_fn()
750747
self.generate_win_lock_convert_fn()
751748
self.generate_whence_convert_fn()
749+
self.generate_typeclass_convert_fn()
752750

753751
#
754752
# the following only need intern to abi converters

ompi/mpi/bindings/ompi_bindings/c_type.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3212,4 +3212,21 @@ def type_text(self, enable_count=False):
32123212
def argument(self):
32133213
return f'{self.name}'
32143214

3215+
@Type.add_type('TYPECLASS', abi_type=['ompi'])
3216+
class TypeClass(Type):
3217+
3218+
def type_text(self, enable_count=False):
3219+
return 'int'
3220+
3221+
@Type.add_type('TYPECLASS', abi_type=['standard'])
3222+
class TypeClassStandard(StandardABIType):
3223+
3224+
@property
3225+
def init_code(self):
3226+
return [f'int {self.tmpname} = {ConvertFuncs.TYPECLASS}({self.name});']
3227+
3228+
def type_text(self, enable_count=False):
3229+
return 'int'
3230+
3231+
32153232

ompi/mpi/c/type_match_size.c.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* Copyright (c) 2009 Sun Microsystems, Inc. All rights reserved.
1313
* Copyright (c) 2015 Research Organization for Information Science
1414
* and Technology (RIST). All rights reserved.
15-
* Copyright (c) 2024 Triad National Security, LLC. All rights
15+
* Copyright (c) 2024-2025 Triad National Security, LLC. All rights
1616
* reserved.
1717
* $COPYRIGHT$
1818
*
@@ -30,7 +30,7 @@
3030
#include "ompi/datatype/ompi_datatype.h"
3131
#include "ompi/datatype/ompi_datatype_internal.h"
3232

33-
PROTOTYPE ERROR_CLASS type_match_size(INT typeclass, INT size, DATATYPE_OUT type)
33+
PROTOTYPE ERROR_CLASS type_match_size(TYPECLASS typeclass, INT size, DATATYPE_OUT type)
3434
{
3535
if (MPI_PARAM_CHECK) {
3636
OMPI_ERR_INIT_FINALIZE(FUNC_NAME);

0 commit comments

Comments
 (0)