11# !/usr/bin/env perl
22#
3- # Copyright (c) 2015 Research Organization for Information Science
3+ # Copyright (c) 2015-2025 Research Organization for Information Science
44# and Technology (RIST). All rights reserved.
55# Copyright (c) 2015-2020 Cisco Systems, Inc. All rights reserved.
66# $COPYRIGHT$
1616my $plain_arg ;
1717my $single_underscore_arg ;
1818my $double_underscore_arg ;
19+ my $status_size_arg ;
20+ my $align_arg ;
1921my $help_arg = 0;
2022
2123&Getopt::Long::Configure(" bundling" );
2224my $ok = Getopt::Long::GetOptions(" caps=i" => \$caps_arg ,
2325 " plain=i" => \$plain_arg ,
2426 " single=i" => \$single_underscore_arg ,
2527 " double=i" => \$double_underscore_arg ,
28+ " status-size=i" => \$status_size_arg ,
29+ " align=i" => \$align_arg ,
2630 " help|h" => \$help_arg );
2731
2832if ($help_arg || !$ok ) {
29- print " Usage: $0 [--caps|--plain|--single|--double] [--help]\n " ;
33+ print " Usage: $0 [--caps|--plain|--single|--double] --status-size=<MPI_STATUS_SIZE> [--align=<alignment>] [--help]\n " ;
3034 exit (1 - $ok );
3135}
3236
5054my $fortran ;
5155
5256$fortran -> {bottom } = {
53- c_type => " int " ,
57+ c_type => " MPI_Fint " ,
5458 c_name => " mpi_fortran_bottom" ,
5559 f_type => " integer" ,
5660 f_name => " MPI_BOTTOM" ,
5761};
5862$fortran -> {in_place } = {
59- c_type => " int " ,
63+ c_type => " MPI_Fint " ,
6064 c_name => " mpi_fortran_in_place" ,
6165 f_type => " integer" ,
6266 f_name => " MPI_IN_PLACE" ,
6367};
6468$fortran -> {unweighted } = {
65- c_type => " int " ,
69+ c_type => " MPI_Fint " ,
6670 c_name => " mpi_fortran_unweighted" ,
6771 f_type => " integer, dimension(1)" ,
6872 f_name => " MPI_UNWEIGHTED" ,
6973};
7074$fortran -> {weights_empty } = {
71- c_type => " int " ,
75+ c_type => " MPI_Fint " ,
7276 c_name => " mpi_fortran_weights_empty" ,
7377 f_type => " integer, dimension(1)" ,
7478 f_name => " MPI_WEIGHTS_EMPTY" ,
8892};
8993
9094$fortran -> {errcodes_ignore } = {
91- c_type => " int " ,
95+ c_type => " MPI_Fint " ,
9296 c_name => " mpi_fortran_errcodes_ignore" ,
9397 f_type => " integer, dimension(1)" ,
9498 f_name => " MPI_ERRCODES_IGNORE" ,
9599};
96100$fortran -> {status_ignore } = {
97- c_type => " int *" ,
101+ c_type => " MPI_Fint" ,
102+ c_dim => " [$status_size_arg ]" ,
98103 c_name => " mpi_fortran_status_ignore" ,
99104 f_type => " type(MPI_STATUS)" ,
100105 f_name => " MPI_STATUS_IGNORE" ,
101106};
102107$fortran -> {statuses_ignore } = {
103- c_type => " int *" ,
108+ c_type => " MPI_Fint" ,
109+ c_dim => " [$status_size_arg ]" ,
104110 c_name => " mpi_fortran_statuses_ignore" ,
105111 f_type => " type(MPI_STATUS)" ,
106112 f_name => " MPI_STATUSES_IGNORE(1)" ,
@@ -130,7 +136,7 @@ sub gen_c_constants_decl {
130136
131137 print OUT " /* WARNING: This is a generated file! Edits will be lost! */
132138/*
133- * Copyright (c) 2015 Research Organization for Information Science
139+ * Copyright (c) 2015-2025 Research Organization for Information Science
134140 * and Technology (RIST). All rights reserved.
135141 * Copyright (c) 2015 Cisco Systems, Inc. All rights reserved.
136142 * \$ COPYRIGHT\$
@@ -146,7 +152,7 @@ sub gen_c_constants_decl {
146152 foreach my $key (sort (keys (%{$fortran }))) {
147153 my $f = $fortran -> {$key };
148154 my $m = mangle($f -> {c_name });
149- print OUT " extern $f ->{c_type} $m ;
155+ print OUT " extern $f ->{c_type} $m $f ->{c_dim} ;
150156#define OMPI_IS_FORTRAN_" . uc ($key ) . " (addr) \\
151157 (addr == (void*) &$m )\n\n " ;
152158 }
@@ -160,7 +166,7 @@ sub gen_c_constants {
160166
161167 print OUT " /* WARNING: This is a generated file! Edits will be lost! */
162168/*
163- * Copyright (c) 2015 Research Organization for Information Science
169+ * Copyright (c) 2015-2025 Research Organization for Information Science
164170 * and Technology (RIST). All rights reserved.
165171 * Copyright (c) 2015 Cisco Systems, Inc. All rights reserved.
166172 * \$ COPYRIGHT\$
@@ -171,7 +177,9 @@ sub gen_c_constants {
171177 foreach my $key (sort (keys (%{$fortran }))) {
172178 my $f = $fortran -> {$key };
173179 my $m = mangle($f -> {c_name });
174- print OUT " $f ->{c_type} $m ;\n " ;
180+ my $align = " " ;
181+ $align = " __opal_attribute_aligned__($align_arg )" if ($align_arg > 0);
182+ print OUT " $f ->{c_type} $align $m $f ->{c_dim};\n " ;
175183 }
176184
177185 close (OUT);
0 commit comments