@@ -176,6 +176,17 @@ def c_parameter(self):
176
176
return f'OMPI_CFI_BUFFER *{ self .name } '
177
177
178
178
179
+ @FortranType .add ('C_PTR_OUT' )
180
+ class CptrType (FortranType ):
181
+ def declare (self ):
182
+ return f'TYPE(C_PTR), INTENT(OUT) :: { self .name } '
183
+
184
+ def use (self ):
185
+ return [('ISO_C_BINDING' , 'C_PTR' )]
186
+
187
+ def c_parameter (self ):
188
+ return f'char *{ self .name } '
189
+
179
190
@FortranType .add ('COUNT' )
180
191
class CountType (FortranType ):
181
192
def declare (self ):
@@ -191,6 +202,50 @@ def c_parameter(self):
191
202
type_ = 'MPI_Count' if self .bigcount else 'MPI_Fint'
192
203
return f'{ type_ } *{ self .name } '
193
204
205
+ @FortranType .add ('COUNT_INOUT' )
206
+ class CountTypeInOut (FortranType ):
207
+ """COUNT type with INOUT INTENT"""
208
+ def declare (self ):
209
+ if self .bigcount :
210
+ return f'INTEGER(KIND=MPI_COUNT_KIND), INTENT(INOUT) :: { self .name } '
211
+ else :
212
+ return f'INTEGER, INTENT(INOUT) :: { self .name } '
213
+
214
+ def use (self ):
215
+ return [('mpi_f08_types' , 'MPI_COUNT_KIND' )]
216
+
217
+ def c_parameter (self ):
218
+ type_ = 'MPI_Count' if self .bigcount else 'MPI_Fint'
219
+ return f'{ type_ } *{ self .name } '
220
+
221
+ @FortranType .add ('COUNT_OUT' )
222
+ class CountTypeInOut (FortranType ):
223
+ """COUNT type with OUT INTENT"""
224
+ def declare (self ):
225
+ if self .bigcount :
226
+ return f'INTEGER(KIND=MPI_COUNT_KIND), INTENT(OUT) :: { self .name } '
227
+ else :
228
+ return f'INTEGER, INTENT(IN) :: { self .name } '
229
+
230
+ def use (self ):
231
+ return [('mpi_f08_types' , 'MPI_COUNT_KIND' )]
232
+
233
+ def c_parameter (self ):
234
+ type_ = 'MPI_Count' if self .bigcount else 'MPI_Fint'
235
+ return f'{ type_ } *{ self .name } '
236
+
237
+
238
+ @FortranType .add ('PARTITIONED_COUNT' )
239
+ class PartitionedCountType (FortranType ):
240
+ def declare (self ):
241
+ return f'INTEGER(KIND=MPI_COUNT_KIND), INTENT(IN) :: { self .name } '
242
+
243
+ def use (self ):
244
+ return [('mpi_f08_types' , 'MPI_COUNT_KIND' )]
245
+
246
+ def c_parameter (self ):
247
+ return f'MPI_Count *{ self .name } '
248
+
194
249
195
250
@FortranType .add ('DATATYPE' )
196
251
class DatatypeType (FortranType ):
@@ -209,6 +264,24 @@ def use(self):
209
264
def c_parameter (self ):
210
265
return f'MPI_Fint *{ self .name } '
211
266
267
+ @FortranType .add ('DATATYPE_OUT' )
268
+ class DatatypeTypeOut (FortranType ):
269
+ def declare (self ):
270
+ return f'TYPE(MPI_Datatype), INTENT(OUT) :: { self .name } '
271
+
272
+ def declare_cbinding_fortran (self ):
273
+ return f'INTEGER, INTENT(OUT) :: { self .name } '
274
+
275
+ def argument (self ):
276
+ return f'{ self .name } %MPI_VAL'
277
+
278
+ def use (self ):
279
+ return [('mpi_f08_types' , 'MPI_Datatype' )]
280
+
281
+ def c_parameter (self ):
282
+ return f'MPI_Fint *{ self .name } '
283
+
284
+
212
285
213
286
@FortranType .add ('DATATYPE_ARRAY' )
214
287
class DatatypeArrayType (FortranType ):
@@ -293,8 +366,20 @@ def c_parameter(self):
293
366
return f'MPI_Fint *{ self .name } '
294
367
295
368
296
- @FortranType .add ('STATUS_OUT ' )
369
+ @FortranType .add ('STATUS ' )
297
370
class StatusType (FortranType ):
371
+ def declare (self ):
372
+ return f'TYPE(MPI_Status) :: { self .name } '
373
+
374
+ def use (self ):
375
+ return [('mpi_f08_types' , 'MPI_Status' )]
376
+
377
+ def c_parameter (self ):
378
+ return f'MPI_Fint *{ self .name } '
379
+
380
+
381
+ @FortranType .add ('STATUS_OUT' )
382
+ class StatusOutType (FortranType ):
298
383
def declare (self ):
299
384
return f'TYPE(MPI_Status), INTENT(OUT) :: { self .name } '
300
385
@@ -382,9 +467,28 @@ def c_parameter(self):
382
467
count_type = 'MPI_Count' if self .bigcount else 'MPI_Fint'
383
468
return f'{ count_type } *{ self .name } '
384
469
470
+ @FortranType .add ('AINT_COUNT_ARRAY' )
471
+ class CountArray (IntArray ):
472
+ """Array of MPI_Count or int."""
473
+
474
+ def declare (self ):
475
+ kind = '(KIND=MPI_COUNT_KIND)' if self .bigcount else '(KIND=MPI_ADDRESS_KIND)'
476
+ return f'INTEGER{ kind } , INTENT(IN) :: { self .name } (*)'
477
+
478
+ def use (self ):
479
+ if self .bigcount :
480
+ return [('mpi_f08_types' , 'MPI_COUNT_KIND' )]
481
+ else :
482
+ return [('mpi_f08_types' , 'MPI_ADDRESS_KIND' )]
483
+
484
+ def c_parameter (self ):
485
+ count_type = 'MPI_Count' if self .bigcount else 'MPI_Aint'
486
+ return f'{ count_type } *{ self .name } '
487
+
488
+
385
489
386
490
@FortranType .add ('AINT' )
387
- class Disp (FortranType ):
491
+ class Aint (FortranType ):
388
492
"""MPI_Aint type."""
389
493
390
494
def declare (self ):
@@ -397,6 +501,95 @@ def c_parameter(self):
397
501
return f'MPI_Aint *{ self .name } '
398
502
399
503
504
+ @FortranType .add ('AINT_OUT' )
505
+ class AintOut (FortranType ):
506
+ """MPI_Aint out type."""
507
+
508
+ def declare (self ):
509
+ return f'INTEGER(MPI_ADDRESS_KIND), INTENT(OUT) :: { self .name } '
510
+
511
+ def use (self ):
512
+ return [('mpi_f08_types' , 'MPI_ADDRESS_KIND' )]
513
+
514
+ def c_parameter (self ):
515
+ return f'MPI_Aint *{ self .name } '
516
+
517
+
518
+ @FortranType .add ('AINT_COUNT' )
519
+ class AintCountTypeIn (FortranType ):
520
+ """AINT/COUNT type with ININTENT"""
521
+ def declare (self ):
522
+ if self .bigcount :
523
+ return f'INTEGER(KIND=MPI_COUNT_KIND), INTENT(IN) :: { self .name } '
524
+ else :
525
+ return f'INTEGER(KIND=MPI_ADDRESS_KIND), INTENT(IN) :: { self .name } '
526
+
527
+ def use (self ):
528
+ if self .bigcount :
529
+ return [('mpi_f08_types' , 'MPI_COUNT_KIND' )]
530
+ else :
531
+ return [('mpi_f08_types' , 'MPI_ADDRESS_KIND' )]
532
+
533
+ def c_parameter (self ):
534
+ type_ = 'MPI_Count' if self .bigcount else 'MPI_Aint'
535
+ return f'{ type_ } *{ self .name } '
536
+
537
+
538
+ @FortranType .add ('AINT_COUNT_INOUT' )
539
+ class AintCountTypeInOut (FortranType ):
540
+ """AINT/COUNT type with INOUT INTENT"""
541
+ def declare (self ):
542
+ if self .bigcount :
543
+ return f'INTEGER(KIND=MPI_COUNT_KIND), INTENT(INOUT) :: { self .name } '
544
+ else :
545
+ return f'INTEGER(KIND=MPI_ADDRESS_KIND), INTENT(INOUT) :: { self .name } '
546
+
547
+ def use (self ):
548
+ if self .bigcount :
549
+ return [('mpi_f08_types' , 'MPI_COUNT_KIND' )]
550
+ else :
551
+ return [('mpi_f08_types' , 'MPI_ADDRESS_KIND' )]
552
+
553
+ def c_parameter (self ):
554
+ type_ = 'MPI_Count' if self .bigcount else 'MPI_Aint'
555
+ return f'{ type_ } *{ self .name } '
556
+
557
+
558
+ @FortranType .add ('AINT_COUNT_OUT' )
559
+ class AintCountTypeOut (FortranType ):
560
+ """AINT/COUNT type with OUT INTENT"""
561
+ def declare (self ):
562
+ if self .bigcount :
563
+ return f'INTEGER(KIND=MPI_COUNT_KIND), INTENT(OUT) :: { self .name } '
564
+ else :
565
+ return f'INTEGER(KIND=MPI_ADDRESS_KIND), INTENT(OUT) :: { self .name } '
566
+
567
+ def use (self ):
568
+ if self .bigcount :
569
+ return [('mpi_f08_types' , 'MPI_COUNT_KIND' )]
570
+ else :
571
+ return [('mpi_f08_types' , 'MPI_ADDRESS_KIND' )]
572
+
573
+ def c_parameter (self ):
574
+ type_ = 'MPI_Count' if self .bigcount else 'MPI_Aint'
575
+ return f'{ type_ } *{ self .name } '
576
+
577
+
578
+ @FortranType .add ('AINT_ARRAY' )
579
+ class AintArrayType (FortranType ):
580
+ """Array of MPI_Aint."""
581
+
582
+ def declare (self ):
583
+ # TODO: Should there be a separate ASYNC version here, when the OMPI_ASYNCHRONOUS attr is required?
584
+ return f'INTEGER(KIND=MPI_ADDRESS_KIND), INTENT(IN) OMPI_ASYNCHRONOUS :: { self .name } (*)'
585
+
586
+ def use (self ):
587
+ return [('mpi_f08_types' , 'MPI_ADDRESS_KIND' )]
588
+
589
+ def c_parameter (self ):
590
+ return f'MPI_Aint *{ self .name } '
591
+
592
+
400
593
@FortranType .add ('DISP' )
401
594
class Disp (FortranType ):
402
595
"""Displacecment type."""
@@ -414,6 +607,23 @@ def c_parameter(self):
414
607
count_type = 'MPI_Aint' if self .bigcount else 'MPI_Fint'
415
608
return f'{ count_type } *{ self .name } '
416
609
610
+ @FortranType .add ('DISP_OUT' )
611
+ class DispOut (FortranType ):
612
+ """Displacecment out type."""
613
+
614
+ def declare (self ):
615
+ kind = '(KIND=MPI_ADDRESS_KIND)' if self .bigcount else ''
616
+ return f'INTEGER{ kind } , INTENT(OUT) :: { self .name } '
617
+
618
+ def use (self ):
619
+ if self .bigcount :
620
+ return [('mpi_f08_types' , 'MPI_ADDRESS_KIND' )]
621
+ return []
622
+
623
+ def c_parameter (self ):
624
+ count_type = 'MPI_Aint' if self .bigcount else 'MPI_Fint'
625
+ return f'{ count_type } *{ self .name } '
626
+
417
627
418
628
@FortranType .add ('DISP_ARRAY' )
419
629
class DispArray (IntArray ):
@@ -460,6 +670,25 @@ def use(self):
460
670
def c_parameter (self ):
461
671
return f'MPI_Fint *{ self .name } '
462
672
673
+ @FortranType .add ('WIN_OUT' )
674
+ class WinOut (FortranType ):
675
+ """MPI_Win out type."""
676
+
677
+ def declare (self ):
678
+ return f'TYPE(MPI_Win), INTENT(OUT) :: { self .name } '
679
+
680
+ def declare_cbinding_fortran (self ):
681
+ return f'INTEGER, INTENT(OUT) :: { self .name } '
682
+
683
+ def argument (self ):
684
+ return f'{ self .name } %MPI_VAL'
685
+
686
+ def use (self ):
687
+ return [('mpi_f08_types' , 'MPI_Win' )]
688
+
689
+ def c_parameter (self ):
690
+ return f'MPI_Fint *{ self .name } '
691
+
463
692
464
693
@FortranType .add ('FILE' )
465
694
class File (FortranType ):
@@ -473,3 +702,60 @@ def use(self):
473
702
474
703
def c_parameter (self ):
475
704
return f'MPI_Fint *{ self .name } '
705
+
706
+ @FortranType .add ('INFO' )
707
+ class Info (FortranType ):
708
+ """MPI_Info type."""
709
+
710
+ def declare (self ):
711
+ return f'TYPE(MPI_Info), INTENT(IN) :: { self .name } '
712
+
713
+ def use (self ):
714
+ return [('mpi_f08_types' , 'MPI_Info' )]
715
+
716
+ def c_parameter (self ):
717
+ return f'MPI_Fint *{ self .name } '
718
+
719
+ @FortranType .add ('OFFSET' )
720
+ class Offset (FortranType ):
721
+ """MPI_Offset type."""
722
+
723
+ def declare (self ):
724
+ return f'INTEGER(MPI_OFFSET_KIND), INTENT(IN) :: { self .name } '
725
+
726
+ def use (self ):
727
+ return [('mpi_f08_types' , 'MPI_OFFSET_KIND' )]
728
+
729
+ def c_parameter (self ):
730
+ return f'MPI_Offset *{ self .name } '
731
+
732
+
733
+ @FortranType .add ('CHAR_ARRAY' )
734
+ class CharArray (FortranType ):
735
+ """Fortran CHAR type."""
736
+
737
+ def declare (self ):
738
+ return f'CHARACTER(LEN=*), INTENT(IN) :: { self .name } '
739
+
740
+ def use (self ):
741
+ return [('iso_c_binding' , 'c_char' )]
742
+
743
+ def declare_cbinding_fortran (self ):
744
+ return f'CHARACTER(KIND=C_CHAR), INTENT(IN) :: { self .name } (*)'
745
+
746
+ def c_parameter (self ):
747
+ return f'char *{ self .name } '
748
+
749
+
750
+ @FortranType .add ('MESSAGE_INOUT' )
751
+ class MessageInOut (FortranType ):
752
+ """MPI_Message INOUT type."""
753
+
754
+ def declare (self ):
755
+ return f'TYPE(MPI_Message), INTENT(INOUT) :: { self .name } '
756
+
757
+ def use (self ):
758
+ return [('mpi_f08_types' , 'MPI_Message' )]
759
+
760
+ def c_parameter (self ):
761
+ return f'MPI_Fint *{ self .name } '
0 commit comments