1
1
from abc import ABC , abstractmethod
2
- from ompi_bindings .consts import ConvertFuncs
2
+ from ompi_bindings .consts import ConvertFuncs , ConvertOMPIToStandard
3
3
4
4
5
5
class Type (ABC ):
@@ -260,7 +260,7 @@ def argument(self):
260
260
261
261
262
262
@Type .add_type ('DATATYPE' , abi_type = ['standard' ])
263
- class TypeDatatype (StandardABIType ):
263
+ class TypeDatatypeStandard (StandardABIType ):
264
264
265
265
@property
266
266
def init_code (self ):
@@ -270,6 +270,29 @@ def type_text(self, enable_count=False):
270
270
return self .mangle_name ('MPI_Datatype' )
271
271
272
272
273
+ @Type .add_type ('DATATYPE_OUT' , abi_type = ['ompi' ])
274
+ class TypeDatatypeOut (Type ):
275
+
276
+ def type_text (self , enable_count = False ):
277
+ return 'MPI_Datatype *'
278
+
279
+
280
+ @Type .add_type ('DATATYPE_OUT' , abi_type = ['standard' ])
281
+ class TypeDatatypeStandard (Type ):
282
+
283
+ @property
284
+ def final_code (self ):
285
+ return [f'*{ self .name } = { ConvertOMPIToStandard .DATATYPE } ((MPI_Datatype) *{ self .name } );' ]
286
+
287
+ def type_text (self , enable_count = False ):
288
+ type_name = self .mangle_name ('MPI_Datatype' )
289
+ return f'{ type_name } *'
290
+
291
+ @property
292
+ def argument (self ):
293
+ return f'(MPI_Datatype *) { self .name } '
294
+
295
+
273
296
@Type .add_type ('OP' , abi_type = ['ompi' ])
274
297
class TypeDatatype (Type ):
275
298
@@ -468,6 +491,26 @@ def parameter(self, enable_count=False, **kwargs):
468
491
return f'{ type_name } { self .name } []'
469
492
470
493
494
+ @Type .add_type ('STATUS' , abi_type = ['ompi' ])
495
+ class TypeStatus (Type ):
496
+
497
+ def type_text (self , enable_count = False ):
498
+ return 'const MPI_Status *'
499
+
500
+
501
+ @Type .add_type ('STATUS' , abi_type = ['standard' ])
502
+ class TypeStatusStandard (StandardABIType ):
503
+
504
+ @property
505
+ def init_code (self ):
506
+ # TODO: Need to ensure this is the correct conversion function for MPI_Status
507
+ return [f'{ ConvertFuncs .STATUS } ({ self .name } , &{ self .tmpname } );' ]
508
+
509
+ def typ_text (self , enable_count = False ):
510
+ type_name = self .mangle_name ('MPI_Status' )
511
+ return f'const { type_name } *'
512
+
513
+
471
514
@Type .add_type ('STATUS_OUT' , abi_type = ['ompi' ])
472
515
class TypeStatusOut (Type ):
473
516
@@ -778,6 +821,45 @@ class TypeCommDeleteAttrFunctionStandard(Type):
778
821
pass
779
822
780
823
824
+ @Type .add_type ('GREQUEST_QUERY_FUNCTION' , abi_type = ['ompi' ])
825
+ class TypeGrequestQueryFunction (Type ):
826
+
827
+ def type_text (self , enable_count = False ):
828
+ return 'MPI_Grequest_query_function *'
829
+
830
+
831
+ @Type .add_type ('GREQUEST_QUERY_FUNCTION' , abi_type = ['standard' ])
832
+ class TypeGrequestQueryFunctionStandard (Type ):
833
+ # TODO: This may require a special function to wrap the callback
834
+ pass
835
+
836
+
837
+ @Type .add_type ('GREQUEST_FREE_FUNCTION' , abi_type = ['ompi' ])
838
+ class TypeGrequestFreeFunction (Type ):
839
+
840
+ def type_text (self , enable_count = False ):
841
+ return 'MPI_Grequest_free_function *'
842
+
843
+
844
+ @Type .add_type ('GREQUEST_FREE_FUNCTION' , abi_type = ['standard' ])
845
+ class TypeGrequestFreeFunctionStandard (Type ):
846
+ # TODO: This may require a special function to wrap the callback
847
+ pass
848
+
849
+
850
+ @Type .add_type ('GREQUEST_CANCEL_FUNCTION' , abi_type = ['ompi' ])
851
+ class TypeGrequestCancelFunction (Type ):
852
+
853
+ def type_text (self , enable_count = False ):
854
+ return 'MPI_Grequest_cancel_function *'
855
+
856
+
857
+ @Type .add_type ('GREQUEST_CANCEL_FUNCTION' , abi_type = ['standard' ])
858
+ class TypeGrequestCancelFunctionStandard (Type ):
859
+ # TODO: This may require a special function to wrap the callback
860
+ pass
861
+
862
+
781
863
@Type .add_type ('ERRHANDLER' , abi_type = ['ompi' ])
782
864
class TypeErrhandler (Type ):
783
865
0 commit comments