Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 493a6f8

Browse files
committedApr 30, 2025
F08: refactor templates
This PR refactors some of the f08 template files introduced in PR open-mpi#12621. Many of them had been using, incorrectly, macros from fint_2_int.h. The code in the use-mpi-f08 folder now makes use of generated code in the wrapper around the internal c code to avoid many of the problems that these older macros were trying to solve by providing 'c' interfaces directly to the fortran compiler. Also, generalized macros for handling translation of arrays of MPI_Fint's to c int's (and other types) are used in these templates. Related to open-mpi#13168 and associated issue raised by a user on the mail list. Signed-off-by: Howard Pritchard <howardp@lanl.gov>
1 parent 2c9dd0a commit 493a6f8

File tree

73 files changed

+398
-431
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+398
-431
lines changed
 

‎ompi/mpi/bindings/ompi_bindings/fortran.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,10 +179,11 @@ def print_c_source(self):
179179
c_func = self.c_func_name
180180
self.dump(f'void {c_func}({parameters});')
181181
self.dump(f'void {c_func}({parameters})')
182-
count_type, disp_type = ('MPI_Count', 'MPI_Aint') if self.bigcount else ('int', 'int')
182+
count_type, disp_type, count_fint_type = ('MPI_Count', 'MPI_Aint', 'MPI_Count') if self.bigcount else ('int', 'int', 'MPI_Fint')
183183
self.template.print_body(c_func, out=self.out,
184184
replacements={'INNER_CALL': self.inner_call,
185185
'COUNT_TYPE': count_type,
186+
'COUNT_FINT_TYPE': count_fint_type,
186187
'DISP_TYPE': disp_type})
187188

188189
def print_interface(self):

‎ompi/mpi/fortran/use-mpi-f08/allgather_init_ts.c.in

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* Copyright (c) 2011-2012 Cisco Systems, Inc. All rights reserved.
1313
* Copyright (c) 2015-2021 Research Organization for Information Science
1414
* and Technology (RIST). All rights reserved.
15-
* Copyright (c) 2024 Triad National Security, LLC. All rights
15+
* Copyright (c) 2024-2025 Triad National Security, LLC. All rights
1616
* reserved.
1717
* $COPYRIGHT$
1818
*
@@ -33,6 +33,7 @@ PROTOTYPE VOID allgather_init(BUFFER_ASYNC x1, COUNT sendcount, DATATYPE sendtyp
3333
MPI_Info c_info;
3434
void *sendbuf = OMPI_CFI_BASE_ADDR(x1), *recvbuf = OMPI_CFI_BASE_ADDR(x2);
3535
@COUNT_TYPE@ c_sendcount = (@COUNT_TYPE@) *sendcount;
36+
@COUNT_TYPE@ c_recvcount = (@COUNT_TYPE@) *recvcount;
3637

3738
OMPI_CFI_CHECK_CONTIGUOUS(x2, c_ierr);
3839
if (MPI_SUCCESS != c_ierr) {
@@ -66,7 +67,7 @@ PROTOTYPE VOID allgather_init(BUFFER_ASYNC x1, COUNT sendcount, DATATYPE sendtyp
6667
c_sendcount,
6768
c_senddatatype,
6869
recvbuf,
69-
(@COUNT_TYPE@) *recvcount,
70+
c_recvcount,
7071
c_recvtype, c_comm, c_info, &c_req);
7172

7273
if (c_senddatatype != c_sendtype) {

0 commit comments

Comments
 (0)
Please sign in to comment.