Skip to content

Commit

Permalink
Add new types to c_type.py
Browse files Browse the repository at this point in the history
  • Loading branch information
jtronge committed Apr 1, 2024
1 parent e8a4be1 commit 2ae81f2
Showing 1 changed file with 155 additions and 4 deletions.
159 changes: 155 additions & 4 deletions ompi/mpi/bindings/ompi_bindings/c_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def type_text(self, enable_count=False):


@Type.add_type('COUNT_ARRAY')
class TypeCount(Type):
class TypeCountArray(Type):
"""Array of counts (either int or MPI_Count)."""

@property
Expand All @@ -127,7 +127,7 @@ def parameter(self, enable_count=False):


@Type.add_type('DISPL_ARRAY')
class TypeCount(Type):
class TypeDisplArray(Type):

@property
def is_count(self):
Expand All @@ -142,19 +142,26 @@ def parameter(self, enable_count=False):


@Type.add_type('INT')
class TypeBufferOut(Type):
class TypeInt(Type):

def type_text(self, enable_count=False):
return 'int'


@Type.add_type('AINT')
class TypeBufferOut(Type):
class TypeAint(Type):

def type_text(self, enable_count=False):
return 'MPI_Aint'


@Type.add_type('AINT_OUT')
class TypeAintOut(Type):

def type_text(self, enable_count=False):
return 'MPI_Aint *'


@Type.add_type('INT_OUT')
class TypeBufferOut(Type):

Expand All @@ -168,6 +175,13 @@ def parameter(self, enable_count=False, **kwargs):
return f'int {self.name}[]'


@Type.add_type('OFFSET_OUT')
class TypeOffsetOut(Type):

def type_text(self, enable_count=False):
return 'MPI_Offset *{self.name}'


@Type.add_type('DOUBLE')
class TypeDouble(Type):

Expand Down Expand Up @@ -491,6 +505,43 @@ def type_text(self, enable_count=False):
return self.mangle_name('MPI_Info')


@Type.add_type('INFO_OUT', abi_type=['ompi'])
class TypeInfoOut(Type):

def type_text(self, enable_count=False):
return 'MPI_Info *'


@Type.add_type('INFO_OUT', abi_type=['standard'])
class TypeInfoOutStandard(Type):

@property
def argument(self):
return f'(MPI_Info *) {self.name}'

def type_text(self, enable_count=False):
type_name = self.mangle_name('MPI_Info')
return f'{type_name} *'


@Type.add_type('FILE', abi_type=['ompi'])
class TypeFile(Type):

def type_text(self, enable_count=False):
return 'MPI_File'


@Type.add_type('FILE', abi_type=['standard'])
class TypeFileStandard(Type):

@property
def argument(self):
return f'(MPI_File) {self.name}'

def type_text(self, enable_count=False):
return self.mangle_name('MPI_File')


@Type.add_type('FILE_OUT', abi_type=['ompi'])
class TypeFileOut(Type):

Expand All @@ -512,3 +563,103 @@ def final_code(self):
def type_text(self, enable_count=False):
type_name = self.mangle_name('MPI_File')
return f'{type_name} *'


@Type.add_type('MESSAGE_OUT', abi_type=['ompi'])
class TypeMessageOut(Type):

def type_text(self, enable_count=False):
return 'MPI_Message *'


@Type.add_type('MESSAGE_OUT', abi_type=['standard'])
class TypeMessageOutStandard(Type):

@property
def argument(self):
return f'(MPI_Message *) {self.name}'

def type_text(self, enable_count=False):
type_name = self.mangle_name('MPI_Message')
return f'{type_name} *'


@Type.add_type('COMM_ERRHANDLER_FUNCTION', abi_type=['ompi'])
class TypeCommErrhandlerFunction(Type):

def type_text(self, enable_count=False):
return 'MPI_Comm_errhandler_function *'


@Type.add_type('COMM_ERRHANDLER_FUNCTION', abi_type=['standard'])
class TypeCommErrhandlerFunctionStandard(Type):
# TODO: This may require a special function to wrap the calllback
pass


@Type.add_type('FILE_ERRHANDLER_FUNCTION', abi_type=['ompi'])
class TypeFileErrhandlerFunction(Type):

def type_text(self, enable_count=False):
return 'MPI_File_errhandler_function *'


@Type.add_type('FILE_ERRHANDLER_FUNCTION', abi_type=['standard'])
class TypeFileErrhandlerFunction(Type):
# TODO: This may require a special function to wrap the callback
pass


@Type.add_type('ERRHANDLER', abi_type=['ompi'])
class TypeErrhandler(Type):

def type_text(self, enable_count=False):
return 'MPI_Errhandler'


@Type.add_type('ERRHANDLER', abi_type=['standard'])
class TypeErrhandlerStandard(Type):

@property
def argument(self):
return f'(MPI_Errhandler) {self.name}'

def type_text(self, enable_count=False):
return self.mangle_name('MPI_Errhandler')


@Type.add_type('ERRHANDLER_OUT', abi_type=['ompi'])
class TypeErrhandlerOut(Type):

def type_text(self, enable_count=False):
return 'MPI_Errhandler *'


@Type.add_type('ERRHANDLER_OUT', abi_type=['standard'])
class TypeErrhandlerOutStandard(Type):

@property
def argument(self):
return f'(MPI_Errhandler *) {self.name}'

def type_text(self, enable_count=False):
type_name = self.mangle_name('MPI_Errhandler')
return f'{MPI_Errhandler} *'


@Type.add_type('GROUP', abi_type=['ompi'])
class TypeGroup(Type):

def type_text(self, enable_count=False):
return 'MPI_Group'


@Type.add_type('GROUP', abi_type=['standard'])
class TypeGroupStandard(Type):

@property
def argument(self):
return f'(MPI_Group) {self.name}'

def type_text(self, enable_count=False):
return self.mangle_name('MPI_Group')

0 comments on commit 2ae81f2

Please sign in to comment.