@@ -118,16 +118,19 @@ def load_prototypes(fname):
118
118
class FortranBinding :
119
119
"""Class for generating the binding for a single function."""
120
120
121
- def __init__ (self , prototype , out , bigcount = False ):
121
+ def __init__ (self , prototype , out , bigcount = False , ts = False ):
122
+ # Generate bigcount interface version
122
123
self .bigcount = bigcount
124
+ # Generate files with support for TS 29113 or not
125
+ self .ts = ts
123
126
self .fn_name = prototype .fn_name
124
127
self .out = out
125
128
self .parameters = []
126
129
param_map = {}
127
130
dep_params = {}
128
131
for param in prototype .parameters :
129
132
type_ = FortranType .get (param .type_name )
130
- param_type = type_ (param .name , self .fn_name , bigcount = bigcount )
133
+ param_type = type_ (param .name , self .fn_name , bigcount = bigcount , ts = ts )
131
134
self .parameters .append (param_type )
132
135
param_map [param .name ] = param_type
133
136
if param .dep_params is not None :
@@ -340,10 +343,10 @@ def print_profiling_rename_macros(prototypes, out):
340
343
out .dump ('#endif /* OMPI_BUILD_MPI_PROFILING */' )
341
344
342
345
343
- def print_c_source_header (out ):
346
+ def print_c_source_header (out , ts = False ):
344
347
"""Print the header of the C source file."""
345
348
out .dump (f'/* { consts .GENERATED_MESSAGE } */' )
346
- if compiler . HAVE_TS :
349
+ if ts :
347
350
out .dump ('#include <ISO_Fortran_binding.h>' )
348
351
out .dump ('#include "ts.h"' )
349
352
out .dump ('#include "ompi_config.h"' )
@@ -356,9 +359,9 @@ def print_c_source_header(out):
356
359
out .dump ('#include "ompi/communicator/communicator.h"' )
357
360
358
361
359
- def print_binding (prototype , lang , out , bigcount = False ):
362
+ def print_binding (prototype , lang , out , bigcount = False , ts = False ):
360
363
"""Print the binding with or without bigcount."""
361
- binding = FortranBinding (prototype , out = out , bigcount = bigcount )
364
+ binding = FortranBinding (prototype , out = out , bigcount = bigcount , ts = ts )
362
365
if lang == 'fortran' :
363
366
binding .print_f_source ()
364
367
else :
@@ -374,13 +377,13 @@ def generate_code(args, out):
374
377
print_profiling_rename_macros (prototypes , out )
375
378
out .dump ()
376
379
else :
377
- print_c_source_header (out )
380
+ print_c_source_header (out , ts = args . ts )
378
381
for prototype in prototypes :
379
382
out .dump ()
380
- print_binding (prototype , args .lang , out )
383
+ print_binding (prototype , args .lang , out , ts = args . ts )
381
384
if util .fortran_prototype_has_bigcount (prototype ):
382
385
out .dump ()
383
- print_binding (prototype , args .lang , bigcount = True , out = out )
386
+ print_binding (prototype , args .lang , bigcount = True , out = out , ts = args . ts )
384
387
385
388
386
389
def generate_interface (args , out ):
@@ -390,10 +393,10 @@ def generate_interface(args, out):
390
393
for prototype in prototypes :
391
394
ext_name = util .ext_api_func_name (prototype .fn_name )
392
395
out .dump (f'interface { ext_name } ' )
393
- binding = FortranBinding (prototype , out = out )
396
+ binding = FortranBinding (prototype , out = out , ts = args . ts )
394
397
binding .print_interface ()
395
398
if util .fortran_prototype_has_bigcount (prototype ):
396
399
out .dump ()
397
- binding_c = FortranBinding (prototype , out = out , bigcount = True )
400
+ binding_c = FortranBinding (prototype , out = out , bigcount = True , ts = args . ts )
398
401
binding_c .print_interface ()
399
402
out .dump (f'end interface { ext_name } ' )
0 commit comments