Skip to content

Commit e673867

Browse files
committed
Add int, char, and MPI_Info-related types
1 parent 7a90e63 commit e673867

File tree

1 file changed

+43
-1
lines changed

1 file changed

+43
-1
lines changed

ompi/mpi/bindings/ompi_bindings/c_type.py

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ def type_text(self, enable_count=False):
171171

172172

173173
@Type.add_type('INT_OUT')
174-
class TypeBufferOut(Type):
174+
class TypeIntOut(Type):
175175

176176
def type_text(self, enable_count=False):
177177
return 'int *'
@@ -183,6 +183,16 @@ def parameter(self, enable_count=False, **kwargs):
183183
return f'int {self.name}[]'
184184

185185

186+
@Type.add_type('INT_ARRAY')
187+
class TypeIntArray(Type):
188+
189+
def type_text(self, enable_count=False):
190+
return 'const int *'
191+
192+
def parameter(self, enable_count=False, **kwargs):
193+
return f'const int {self.name}[]'
194+
195+
186196
@Type.add_type('OFFSET')
187197
class TypeOffset(Type):
188198

@@ -211,6 +221,16 @@ def type_text(self, enable_count=False):
211221
return 'char ***'
212222

213223

224+
@Type.add_type('STRING_ARRAY')
225+
class TypeStringArray(Type):
226+
227+
def type_text(self, enable_count=False):
228+
return 'char **'
229+
230+
def parameter(self, enable_count=False, **kwargs):
231+
return f'char *{self.name}[]'
232+
233+
214234
@Type.add_type('DATATYPE', abi_type=['ompi'])
215235
class TypeDatatype(Type):
216236

@@ -585,6 +605,28 @@ def type_text(self, enable_count=False):
585605
return f'{type_name} *'
586606

587607

608+
@Type.add_type('INFO_ARRAY', abi_type=['ompi'])
609+
class TypeInfoArray(Type):
610+
611+
def type_text(self, enable_count=False):
612+
return 'const MPI_Info *'
613+
614+
def parameter(self, enable_count=False, **kwargs):
615+
return f'const MPI_Info {self.name}[]'
616+
617+
618+
@Type.add_type('INFO_ARRAY', abi_type=['standard'])
619+
class TypeInfoArray(Type):
620+
621+
def type_text(self, enable_count=False):
622+
type_name = self.mangle_name('MPI_Info')
623+
return f'const {type_name} *'
624+
625+
def parameter(self, enable_count=False, **kwargs):
626+
type_name = self.mangle_name('MPI_Info')
627+
return f'const {type_name} {self.name}[]'
628+
629+
588630
@Type.add_type('FILE', abi_type=['ompi'])
589631
class TypeFile(Type):
590632

0 commit comments

Comments
 (0)