Skip to content

Commit e39f1f9

Browse files
committed
add MPI_Remove_error_{class,code,string} Fortran pieces
Signed-off-by: Thomas Naughton <[email protected]>
1 parent a78b399 commit e39f1f9

File tree

12 files changed

+403
-0
lines changed

12 files changed

+403
-0
lines changed

ompi/mpi/fortran/mpif-h/prototypes_mpi.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
* Copyright (c) 2019-2023 Triad National Security, LLC. All rights
2020
* reserved.
2121
* Copyright (c) 2021 Bull S.A.S. All rights reserved.
22+
* Copyright (c) 2025 UT-Battelle, LLC. All rights reserved.
2223
* $COPYRIGHT$
2324
*
2425
* Additional copyrights may follow
@@ -372,6 +373,9 @@ PN2(void, MPI_Reduce_scatter_init, mpi_reduce_scatter_init, MPI_REDUCE_SCATTER_I
372373
PN2(void, MPI_Reduce_scatter_block, mpi_reduce_scatter_block, MPI_REDUCE_SCATTER_BLOCK, (char *sendbuf, char *recvbuf, MPI_Fint *recvcount, MPI_Fint *datatype, MPI_Fint *op, MPI_Fint *comm, MPI_Fint *ierr));
373374
PN2(void, MPI_Reduce_scatter_block_init, mpi_reduce_scatter_block_init, MPI_REDUCE_SCATTER_BLOCK_INIT, (char *sendbuf, char *recvbuf, MPI_Fint *recvcount, MPI_Fint *datatype, MPI_Fint *op, MPI_Fint *comm, MPI_Fint *info, MPI_Fint *request, MPI_Fint *ierr));
374375
PN2(void, MPI_Register_datarep, mpi_register_datarep, MPI_REGISTER_DATAREP, (char *datarep, ompi_mpi2_fortran_datarep_conversion_fn_t *read_conversion_fn, ompi_mpi2_fortran_datarep_conversion_fn_t *write_conversion_fn, ompi_mpi2_fortran_datarep_extent_fn_t *dtype_file_extent_fn, MPI_Aint *extra_state, MPI_Fint *ierr, int datarep_len));
376+
PN2(void, MPI_Remove_error_class, mpi_remove_error_class, MPI_REMOVE_ERROR_CLASS, (MPI_Fint *errorclass, MPI_Fint *ierr));
377+
PN2(void, MPI_Remove_error_code, mpi_remove_error_code, MPI_REMOVE_ERROR_CODE, (MPI_Fint *errorcode, MPI_Fint *ierr));
378+
PN2(void, MPI_Remove_error_string, mpi_remove_error_string, MPI_REMOVE_ERROR_STRING, (MPI_Fint *errorcode, MPI_Fint *ierr));
375379
PN2(void, MPI_Request_free, mpi_request_free, MPI_REQUEST_FREE, (MPI_Fint *request, MPI_Fint *ierr));
376380
PN2(void, MPI_Request_get_status, mpi_request_get_status, MPI_REQUEST_GET_STATUS, (MPI_Fint *request, ompi_fortran_logical_t *flag, MPI_Fint *status, MPI_Fint *ierr));
377381
PN2(void, MPI_Request_get_status_all, mpi_request_get_status_all, MPI_REQUEST_GET_STATUS_ALL, (MPI_Fint *count, MPI_Fint *array_of_requests, ompi_fortran_logical_t *flag, MPI_Fint *array_of_statuses, MPI_Fint *ierr));
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
/*
2+
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
3+
* University Research and Technology
4+
* Corporation. All rights reserved.
5+
* Copyright (c) 2004-2005 The University of Tennessee and The University
6+
* of Tennessee Research Foundation. All rights
7+
* reserved.
8+
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
9+
* University of Stuttgart. All rights reserved.
10+
* Copyright (c) 2004-2005 The Regents of the University of California.
11+
* All rights reserved.
12+
* Copyright (c) 2011-2012 Cisco Systems, Inc. All rights reserved.
13+
* Copyright (c) 2015 Research Organization for Information Science
14+
* and Technology (RIST). All rights reserved.
15+
* Copyright (c) 2025 UT-Battelle, LLC. All rights reserved.
16+
* $COPYRIGHT$
17+
*
18+
* Additional copyrights may follow
19+
*
20+
* $HEADER$
21+
*/
22+
23+
#include "ompi_config.h"
24+
25+
#include "ompi/mpi/fortran/mpif-h/bindings.h"
26+
27+
#if OMPI_BUILD_MPI_PROFILING
28+
#if OPAL_HAVE_WEAK_SYMBOLS
29+
#pragma weak PMPI_REMOVE_ERROR_CLASS = ompi_remove_error_class_f
30+
#pragma weak pmpi_remove_error_class = ompi_remove_error_class_f
31+
#pragma weak pmpi_remove_error_class_ = ompi_remove_error_class_f
32+
#pragma weak pmpi_remove_error_class__ = ompi_remove_error_class_f
33+
34+
#pragma weak PMPI_Remove_error_class_f = ompi_remove_error_class_f
35+
#pragma weak PMPI_Remove_error_class_f08 = ompi_remove_error_class_f
36+
#else
37+
OMPI_GENERATE_F77_BINDINGS (PMPI_REMOVE_ERROR_CLASS,
38+
pmpi_remove_error_class,
39+
pmpi_remove_error_class_,
40+
pmpi_remove_error_class__,
41+
pompi_remove_error_class_f,
42+
(MPI_Fint *errorclass, MPI_Fint *ierr),
43+
(errorclass, ierr) )
44+
#endif
45+
#endif
46+
47+
#if OPAL_HAVE_WEAK_SYMBOLS
48+
#pragma weak MPI_REMOVE_ERROR_CLASS = ompi_remove_error_class_f
49+
#pragma weak mpi_remove_error_class = ompi_remove_error_class_f
50+
#pragma weak mpi_remove_error_class_ = ompi_remove_error_class_f
51+
#pragma weak mpi_remove_error_class__ = ompi_remove_error_class_f
52+
53+
#pragma weak MPI_Remove_error_class_f = ompi_remove_error_class_f
54+
#pragma weak MPI_Remove_error_class_f08 = ompi_remove_error_class_f
55+
#else
56+
#if ! OMPI_BUILD_MPI_PROFILING
57+
OMPI_GENERATE_F77_BINDINGS (MPI_REMOVE_ERROR_CLASS,
58+
mpi_remove_error_class,
59+
mpi_remove_error_class_,
60+
mpi_remove_error_class__,
61+
ompi_remove_error_class_f,
62+
(MPI_Fint *errorclass, MPI_Fint *ierr),
63+
(errorclass, ierr) )
64+
#else
65+
#define ompi_remove_error_class_f pompi_remove_error_class_f
66+
#endif
67+
#endif
68+
69+
70+
void ompi_remove_error_class_f(MPI_Fint *errorclass, MPI_Fint *ierr)
71+
{
72+
int ierr_c;
73+
OMPI_SINGLE_NAME_DECL(errorclass);
74+
75+
ierr_c = PMPI_Remove_error_class(OMPI_FINT_2_INT(*errorclass));
76+
if (NULL != ierr) *ierr = OMPI_INT_2_FINT(ierr_c);
77+
78+
if (MPI_SUCCESS == ierr_c) {
79+
OMPI_SINGLE_INT_2_FINT(errorclass);
80+
}
81+
}
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
/*
2+
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
3+
* University Research and Technology
4+
* Corporation. All rights reserved.
5+
* Copyright (c) 2004-2005 The University of Tennessee and The University
6+
* of Tennessee Research Foundation. All rights
7+
* reserved.
8+
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
9+
* University of Stuttgart. All rights reserved.
10+
* Copyright (c) 2004-2005 The Regents of the University of California.
11+
* All rights reserved.
12+
* Copyright (c) 2011-2012 Cisco Systems, Inc. All rights reserved.
13+
* Copyright (c) 2015 Research Organization for Information Science
14+
* and Technology (RIST). All rights reserved.
15+
* Copyright (c) 2025 UT-Battelle, LLC. All rights reserved.
16+
* $COPYRIGHT$
17+
*
18+
* Additional copyrights may follow
19+
*
20+
* $HEADER$
21+
*/
22+
23+
#include "ompi_config.h"
24+
25+
#include "ompi/mpi/fortran/mpif-h/bindings.h"
26+
27+
#if OMPI_BUILD_MPI_PROFILING
28+
#if OPAL_HAVE_WEAK_SYMBOLS
29+
#pragma weak PMPI_REMOVE_ERROR_CODE = ompi_remove_error_code_f
30+
#pragma weak pmpi_remove_error_code = ompi_remove_error_code_f
31+
#pragma weak pmpi_remove_error_code_ = ompi_remove_error_code_f
32+
#pragma weak pmpi_remove_error_code__ = ompi_remove_error_code_f
33+
34+
#pragma weak PMPI_Remove_error_code_f = ompi_remove_error_code_f
35+
#pragma weak PMPI_Remove_error_code_f08 = ompi_remove_error_code_f
36+
#else
37+
OMPI_GENERATE_F77_BINDINGS (PMPI_REMOVE_ERROR_CODE,
38+
pmpi_remove_error_code,
39+
pmpi_remove_error_code_,
40+
pmpi_remove_error_code__,
41+
pompi_remove_error_code_f,
42+
(MPI_Fint *errorcode, MPI_Fint *ierr),
43+
(errorcode, ierr) )
44+
#endif
45+
#endif
46+
47+
#if OPAL_HAVE_WEAK_SYMBOLS
48+
#pragma weak MPI_REMOVE_ERROR_CODE = ompi_remove_error_code_f
49+
#pragma weak mpi_remove_error_code = ompi_remove_error_code_f
50+
#pragma weak mpi_remove_error_code_ = ompi_remove_error_code_f
51+
#pragma weak mpi_remove_error_code__ = ompi_remove_error_code_f
52+
53+
#pragma weak MPI_Remove_error_code_f = ompi_remove_error_code_f
54+
#pragma weak MPI_Remove_error_code_f08 = ompi_remove_error_code_f
55+
#else
56+
#if ! OMPI_BUILD_MPI_PROFILING
57+
OMPI_GENERATE_F77_BINDINGS (MPI_REMOVE_ERROR_CODE,
58+
mpi_remove_error_code,
59+
mpi_remove_error_code_,
60+
mpi_remove_error_code__,
61+
ompi_remove_error_code_f,
62+
(MPI_Fint *errorcode, MPI_Fint *ierr),
63+
(errorcode, ierr) )
64+
#else
65+
#define ompi_remove_error_code_f pompi_remove_error_code_f
66+
#endif
67+
#endif
68+
69+
70+
void ompi_remove_error_code_f(MPI_Fint *errorcode, MPI_Fint *ierr)
71+
{
72+
int ierr_c;
73+
74+
ierr_c = PMPI_Remove_error_code(OMPI_FINT_2_INT(*errorcode));
75+
76+
if (NULL != ierr) *ierr = OMPI_INT_2_FINT(ierr_c);
77+
if (MPI_SUCCESS == ierr_c) {
78+
OMPI_SINGLE_INT_2_FINT(errorcode);
79+
}
80+
}
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
/*
2+
* Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
3+
* University Research and Technology
4+
* Corporation. All rights reserved.
5+
* Copyright (c) 2004-2020 The University of Tennessee and The University
6+
* of Tennessee Research Foundation. All rights
7+
* reserved.
8+
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
9+
* University of Stuttgart. All rights reserved.
10+
* Copyright (c) 2004-2005 The Regents of the University of California.
11+
* All rights reserved.
12+
* Copyright (c) 2006-2012 Cisco Systems, Inc. All rights reserved.
13+
* Copyright (c) 2015-2017 Research Organization for Information Science
14+
* and Technology (RIST). All rights reserved.
15+
* Copyright (c) 2025 UT-Battelle, LLC. All rights reserved.
16+
* $COPYRIGHT$
17+
*
18+
* Additional copyrights may follow
19+
*
20+
* $HEADER$
21+
*/
22+
23+
#include "ompi_config.h"
24+
25+
#include "ompi/mpi/fortran/mpif-h/bindings.h"
26+
#include "ompi/mpi/fortran/base/constants.h"
27+
#include "ompi/mpi/fortran/base/fortran_base_strings.h"
28+
#include "ompi/communicator/communicator.h"
29+
30+
#if OMPI_BUILD_MPI_PROFILING
31+
#if OPAL_HAVE_WEAK_SYMBOLS
32+
#pragma weak PMPI_REMOVE_ERROR_STRING = ompi_remove_error_string_f
33+
#pragma weak pmpi_remove_error_string = ompi_remove_error_string_f
34+
#pragma weak pmpi_remove_error_string_ = ompi_remove_error_string_f
35+
#pragma weak pmpi_remove_error_string__ = ompi_remove_error_string_f
36+
37+
#pragma weak PMPI_Remove_error_string_f = ompi_remove_error_string_f
38+
#pragma weak PMPI_Remove_error_string_f08 = ompi_remove_error_string_f
39+
#else
40+
OMPI_GENERATE_F77_BINDINGS (PMPI_REMOVE_ERROR_STRING,
41+
pmpi_remove_error_string,
42+
pmpi_remove_error_string_,
43+
pmpi_remove_error_string__,
44+
pompi_remove_error_string_f,
45+
(MPI_Fint *errorcode, MPI_Fint *ierr),
46+
(errorcode, ierr) )
47+
#endif
48+
#endif
49+
50+
#if OPAL_HAVE_WEAK_SYMBOLS
51+
#pragma weak MPI_REMOVE_ERROR_STRING = ompi_remove_error_string_f
52+
#pragma weak mpi_remove_error_string = ompi_remove_error_string_f
53+
#pragma weak mpi_remove_error_string_ = ompi_remove_error_string_f
54+
#pragma weak mpi_remove_error_string__ = ompi_remove_error_string_f
55+
56+
#pragma weak MPI_Remove_error_string_f = ompi_remove_error_string_f
57+
#pragma weak MPI_Remove_error_string_f08 = ompi_remove_error_string_f
58+
#else
59+
#if ! OMPI_BUILD_MPI_PROFILING
60+
OMPI_GENERATE_F77_BINDINGS (MPI_REMOVE_ERROR_STRING,
61+
mpi_remove_error_string,
62+
mpi_remove_error_string_,
63+
mpi_remove_error_string__,
64+
ompi_remove_error_string_f,
65+
(MPI_Fint *errorcode, MPI_Fint *ierr),
66+
(errorcode, ierr) )
67+
#else
68+
#define ompi_remove_error_string_f pompi_remove_error_string_f
69+
#endif
70+
#endif
71+
72+
73+
void ompi_remove_error_string_f(MPI_Fint *errorcode, MPI_Fint *ierr)
74+
{
75+
int ierr_c;
76+
77+
ierr_c = PMPI_Remove_error_string(OMPI_FINT_2_INT(*errorcode));
78+
if (NULL != ierr) *ierr = OMPI_INT_2_FINT(ierr_c);
79+
}

ompi/mpi/fortran/use-mpi-f08/bindings/mpi-f-interfaces-bind.h

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
! Copyright (c) 2021 Bull S.A.S. All rights reserved.
1515
! Copyright (c) 2021-2022 Triad National Security, LLC. All rights
1616
! reserved.
17+
! Copyright (c) 2025 UT-Battelle, LLC. All rights reserved.
1718
! $COPYRIGHT$
1819
!
1920
! This file provides the interface specifications for the MPI Fortran
@@ -394,6 +395,27 @@ subroutine ompi_recv_init_f(buf,count,datatype,source,tag,comm,request,ierror) &
394395
INTEGER, INTENT(OUT) :: ierror
395396
end subroutine ompi_recv_init_f
396397

398+
subroutine ompi_remove_error_class_f(errorclass,ierror) &
399+
BIND(C, name="ompi_remove_error_class_f")
400+
implicit none
401+
INTEGER, INTENT(OUT) :: errorclass
402+
INTEGER, INTENT(OUT) :: ierror
403+
end subroutine ompi_remove_error_class_f
404+
405+
subroutine ompi_remove_error_code_f(errorcode,ierror) &
406+
BIND(C, name="ompi_remove_error_code_f")
407+
implicit none
408+
INTEGER, INTENT(OUT) :: errorcode
409+
INTEGER, INTENT(OUT) :: ierror
410+
end subroutine ompi_remove_error_code_f
411+
412+
subroutine ompi_remove_error_string_f(errorcode,ierror) &
413+
BIND(C, name="ompi_remove_error_string_f")
414+
implicit none
415+
INTEGER, INTENT(IN) :: errorcode
416+
INTEGER, INTENT(OUT) :: ierror
417+
end subroutine ompi_remove_error_string_f
418+
397419
subroutine ompi_request_free_f(request,ierror) &
398420
BIND(C, name="ompi_request_free_f")
399421
implicit none

ompi/mpi/fortran/use-mpi-f08/mod/mpi-f08-interfaces.h.in

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
! Copyright (c) 2017-2018 FUJITSU LIMITED. All rights reserved.
1313
! Copyright (c) 2021-2023 Triad National Security, LLC. All rights
1414
! reserved.
15+
! Copyright (c) 2025 UT-Battelle, LLC. All rights reserved.
1516
! $COPYRIGHT$
1617
!
1718
! This file provides the interface specifications for the MPI Fortran
@@ -2345,6 +2346,30 @@ subroutine MPI_Register_datarep_f08(datarep,read_conversion_fn,write_conversion_
23452346
end subroutine MPI_Register_datarep_f08
23462347
end interface MPI_Register_datarep
23472348

2349+
interface MPI_Remove_error_class
2350+
subroutine MPI_Remove_error_class_f08(errorclass,ierror)
2351+
implicit none
2352+
INTEGER, INTENT(OUT) :: errorclass
2353+
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
2354+
end subroutine MPI_Remove_error_class_f08
2355+
end interface MPI_Remove_error_class
2356+
2357+
interface MPI_Remove_error_code
2358+
subroutine MPI_Remove_error_code_f08(errorcode,ierror)
2359+
implicit none
2360+
INTEGER, INTENT(OUT) :: errorcode
2361+
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
2362+
end subroutine MPI_Remove_error_code_f08
2363+
end interface MPI_Remove_error_code
2364+
2365+
interface MPI_Remove_error_string
2366+
subroutine MPI_Remove_error_string_f08(errorcode,ierror)
2367+
implicit none
2368+
integer, intent(in) :: errorcode
2369+
integer, optional, intent(out) :: ierror
2370+
end subroutine MPI_Remove_error_string_f08
2371+
end interface MPI_Remove_error_string
2372+
23482373
!
23492374
! MPI_Sizeof is generic for numeric types. This ignore TKR interface
23502375
! is replaced by the specific generics. Implemented in mpi_sizeof_mod.F90.

ompi/mpi/fortran/use-mpi-f08/mod/mpi-f08-rename.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
!
33
! Copyright (c) 2019-2020 Research Organization for Information Science
44
! and Technology (RIST). All rights reserved.
5+
! Copyright (c) 2025 UT-Battelle, LLC. All rights reserved.
56

67
#if OMPI_BUILD_MPI_PROFILING
78

@@ -560,6 +561,12 @@
560561
#define MPI_Reduce_scatter PMPI_Reduce_scatter
561562
#define MPI_Register_datarep_f08 PMPI_Register_datarep_f08
562563
#define MPI_Register_datarep PMPI_Register_datarep
564+
#define MPI_Remove_error_class_f08 PMPI_Remove_error_class_f08
565+
#define MPI_Remove_error_class PMPI_Remove_error_class
566+
#define MPI_Remove_error_code_f08 PMPI_Remove_error_code_f08
567+
#define MPI_Remove_error_code PMPI_Remove_error_code
568+
#define MPI_Remove_error_string_f08 PMPI_Remove_error_string_f08
569+
#define MPI_Remove_error_string PMPI_Remove_error_string
563570
#define MPI_Request_free_f08 PMPI_Request_free_f08
564571
#define MPI_Request_free PMPI_Request_free
565572
#define MPI_Rget_accumulate_f08 PMPI_Rget_accumulate_f08
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
! -*- f90 -*-
2+
!
3+
! Copyright (c) 2010-2012 Cisco Systems, Inc. All rights reserved.
4+
! Copyright (c) 2009-2012 Los Alamos National Security, LLC.
5+
! All rights reserved.
6+
! Copyright (c) 2018-2020 Research Organization for Information Science
7+
! and Technology (RIST). All rights reserved.
8+
! Copyright (c) 2025 UT-Battelle, LLC. All rights reserved.
9+
! $COPYRIGHT$
10+
11+
#include "mpi-f08-rename.h"
12+
13+
subroutine MPI_Remove_error_class_f08(errorclass,ierror)
14+
use :: ompi_mpifh_bindings, only : ompi_remove_error_class_f
15+
implicit none
16+
INTEGER, INTENT(OUT) :: errorclass
17+
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
18+
integer :: c_ierror
19+
20+
call ompi_remove_error_class_f(errorclass,c_ierror)
21+
if (present(ierror)) ierror = c_ierror
22+
23+
end subroutine MPI_Remove_error_class_f08

0 commit comments

Comments
 (0)