1
1
# !/usr/bin/env perl
2
2
#
3
- # Copyright (c) 2015 Research Organization for Information Science
3
+ # Copyright (c) 2015-2025 Research Organization for Information Science
4
4
# and Technology (RIST). All rights reserved.
5
5
# Copyright (c) 2015-2020 Cisco Systems, Inc. All rights reserved.
6
6
# $COPYRIGHT$
16
16
my $plain_arg ;
17
17
my $single_underscore_arg ;
18
18
my $double_underscore_arg ;
19
+ my $status_size_arg ;
20
+ my $align_arg ;
19
21
my $help_arg = 0;
20
22
21
23
&Getopt::Long::Configure(" bundling" );
22
24
my $ok = Getopt::Long::GetOptions(" caps=i" => \$caps_arg ,
23
25
" plain=i" => \$plain_arg ,
24
26
" single=i" => \$single_underscore_arg ,
25
27
" double=i" => \$double_underscore_arg ,
28
+ " status-size=i" => \$status_size_arg ,
29
+ " align=i" => \$align_arg ,
26
30
" help|h" => \$help_arg );
27
31
28
32
if ($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 " ;
30
34
exit (1 - $ok );
31
35
}
32
36
50
54
my $fortran ;
51
55
52
56
$fortran -> {bottom } = {
53
- c_type => " int " ,
57
+ c_type => " MPI_Fint " ,
54
58
c_name => " mpi_fortran_bottom" ,
55
59
f_type => " integer" ,
56
60
f_name => " MPI_BOTTOM" ,
57
61
};
58
62
$fortran -> {in_place } = {
59
- c_type => " int " ,
63
+ c_type => " MPI_Fint " ,
60
64
c_name => " mpi_fortran_in_place" ,
61
65
f_type => " integer" ,
62
66
f_name => " MPI_IN_PLACE" ,
63
67
};
64
68
$fortran -> {unweighted } = {
65
- c_type => " int " ,
69
+ c_type => " MPI_Fint " ,
66
70
c_name => " mpi_fortran_unweighted" ,
67
71
f_type => " integer, dimension(1)" ,
68
72
f_name => " MPI_UNWEIGHTED" ,
69
73
};
70
74
$fortran -> {weights_empty } = {
71
- c_type => " int " ,
75
+ c_type => " MPI_Fint " ,
72
76
c_name => " mpi_fortran_weights_empty" ,
73
77
f_type => " integer, dimension(1)" ,
74
78
f_name => " MPI_WEIGHTS_EMPTY" ,
88
92
};
89
93
90
94
$fortran -> {errcodes_ignore } = {
91
- c_type => " int " ,
95
+ c_type => " MPI_Fint " ,
92
96
c_name => " mpi_fortran_errcodes_ignore" ,
93
97
f_type => " integer, dimension(1)" ,
94
98
f_name => " MPI_ERRCODES_IGNORE" ,
95
99
};
96
100
$fortran -> {status_ignore } = {
97
- c_type => " int *" ,
101
+ c_type => " MPI_Fint" ,
102
+ c_dim => " [$status_size_arg ]" ,
98
103
c_name => " mpi_fortran_status_ignore" ,
99
104
f_type => " type(MPI_STATUS)" ,
100
105
f_name => " MPI_STATUS_IGNORE" ,
101
106
};
102
107
$fortran -> {statuses_ignore } = {
103
- c_type => " int *" ,
108
+ c_type => " MPI_Fint" ,
109
+ c_dim => " [$status_size_arg ]" ,
104
110
c_name => " mpi_fortran_statuses_ignore" ,
105
111
f_type => " type(MPI_STATUS)" ,
106
112
f_name => " MPI_STATUSES_IGNORE(1)" ,
@@ -130,7 +136,7 @@ sub gen_c_constants_decl {
130
136
131
137
print OUT " /* WARNING: This is a generated file! Edits will be lost! */
132
138
/*
133
- * Copyright (c) 2015 Research Organization for Information Science
139
+ * Copyright (c) 2015-2025 Research Organization for Information Science
134
140
* and Technology (RIST). All rights reserved.
135
141
* Copyright (c) 2015 Cisco Systems, Inc. All rights reserved.
136
142
* \$ COPYRIGHT\$
@@ -146,7 +152,7 @@ sub gen_c_constants_decl {
146
152
foreach my $key (sort (keys (%{$fortran }))) {
147
153
my $f = $fortran -> {$key };
148
154
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} ;
150
156
#define OMPI_IS_FORTRAN_" . uc ($key ) . " (addr) \\
151
157
(addr == (void*) &$m )\n\n " ;
152
158
}
@@ -160,7 +166,7 @@ sub gen_c_constants {
160
166
161
167
print OUT " /* WARNING: This is a generated file! Edits will be lost! */
162
168
/*
163
- * Copyright (c) 2015 Research Organization for Information Science
169
+ * Copyright (c) 2015-2025 Research Organization for Information Science
164
170
* and Technology (RIST). All rights reserved.
165
171
* Copyright (c) 2015 Cisco Systems, Inc. All rights reserved.
166
172
* \$ COPYRIGHT\$
@@ -171,7 +177,9 @@ sub gen_c_constants {
171
177
foreach my $key (sort (keys (%{$fortran }))) {
172
178
my $f = $fortran -> {$key };
173
179
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 " ;
175
183
}
176
184
177
185
close (OUT);
0 commit comments