Skip to content

Commit 5328700

Browse files
David Woottonhppritcha
authored andcommitted
Add conditional preprocessor check for MPI V4.0 around deprecated MPI/PMPI functions
Signed-off-by: David Wootton <dwootton@us.ibm.com>
1 parent ba50056 commit 5328700

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

ompi/include/mpi.h.in

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1742,12 +1742,18 @@ OMPI_DECLSPEC int MPI_Info_delete(MPI_Info info, const char *key);
17421742
OMPI_DECLSPEC int MPI_Info_dup(MPI_Info info, MPI_Info *newinfo);
17431743
OMPI_DECLSPEC MPI_Info MPI_Info_f2c(MPI_Fint info);
17441744
OMPI_DECLSPEC int MPI_Info_free(MPI_Info *info);
1745+
#if MPI_VERSION < 4
1746+
OMPI_DECLSPEC int MPI_Info_get(MPI_Info info, const char *key, int valuelen,
1747+
char *value, int *flag);
1748+
#endif
17451749
OMPI_DECLSPEC int MPI_Info_get_nkeys(MPI_Info info, int *nkeys);
17461750
OMPI_DECLSPEC int MPI_Info_get_nthkey(MPI_Info info, int n, char *key);
1747-
OMPI_DECLSPEC int MPI_Info_get_valuelen(MPI_Info info, const char *key, int *valuelen,
1748-
int *flag);
17491751
OMPI_DECLSPEC int MPI_Info_get_string(MPI_Info info, const char *key, int *buflen,
17501752
char *value, int *flag);
1753+
#if MPI_VERSION < 4
1754+
OMPI_DECLSPEC int MPI_Info_get_valuelen(MPI_Info info, const char *key, int *valuelen,
1755+
int *flag);
1756+
#endif
17511757
OMPI_DECLSPEC int MPI_Info_set(MPI_Info info, const char *key, const char *value);
17521758
OMPI_DECLSPEC int MPI_Init(int *argc, char ***argv);
17531759
OMPI_DECLSPEC int MPI_Initialized(int *flag);
@@ -2504,12 +2510,18 @@ OMPI_DECLSPEC int PMPI_Info_delete(MPI_Info info, const char *key);
25042510
OMPI_DECLSPEC int PMPI_Info_dup(MPI_Info info, MPI_Info *newinfo);
25052511
OMPI_DECLSPEC MPI_Info PMPI_Info_f2c(MPI_Fint info);
25062512
OMPI_DECLSPEC int PMPI_Info_free(MPI_Info *info);
2513+
#if MPI_VERSION < 4
2514+
OMPI_DECLSPEC int PMPI_Info_get(MPI_Info info, const char *key, int valuelen,
2515+
char *value, int *flag);
2516+
#endif
25072517
OMPI_DECLSPEC int PMPI_Info_get_nkeys(MPI_Info info, int *nkeys);
25082518
OMPI_DECLSPEC int PMPI_Info_get_nthkey(MPI_Info info, int n, char *key);
25092519
OMPI_DECLSPEC int PMPI_Info_get_string(MPI_Info info, const char *key, int *buflen,
25102520
char *value, int *flag);
2521+
#if MPI_VERSION < 4
25112522
OMPI_DECLSPEC int PMPI_Info_get_valuelen(MPI_Info info, const char *key, int *valuelen,
25122523
int *flag);
2524+
#endif
25132525
OMPI_DECLSPEC int PMPI_Info_set(MPI_Info info, const char *key, const char *value);
25142526
OMPI_DECLSPEC int PMPI_Init(int *argc, char ***argv);
25152527
OMPI_DECLSPEC int PMPI_Initialized(int *flag);
@@ -3009,7 +3021,8 @@ OMPI_DECLSPEC int PMPI_Attr_get(MPI_Comm comm, int keyval, void *attribute_val,
30093021
OMPI_DECLSPEC int MPI_Attr_put(MPI_Comm comm, int keyval, void *attribute_val)
30103022
__mpi_interface_deprecated__("MPI_Attr_put was deprecated in MPI-2.0; use MPI_Comm_set_attr instead");
30113023
OMPI_DECLSPEC int PMPI_Attr_put(MPI_Comm comm, int keyval, void *attribute_val)
3012-
__mpi_interface_deprecated__("PMPI_Attr_put was deprecated in MPI-2.0; use PMPI_Comm_set_attr instead");
3024+
__mpi_interface_deprecated__("PMPI_Attr_put was deprecated in MPI-2.0; use PMPI_Comm_set_attr instead");
3025+
#if MPI_VERSION >= 4
30133026
OMPI_DECLSPEC int MPI_Info_get(MPI_Info info, const char *key, int valuelen,
30143027
char *value, int *flag)
30153028
__mpi_interface_deprecated__("MPI_Info_get was deprecated in MPI-4.0; use MPI_Info_get_string instead");
@@ -3022,6 +3035,7 @@ OMPI_DECLSPEC int MPI_Info_get_valuelen(MPI_Info info, const char *key, int *va
30223035
OMPI_DECLSPEC int PMPI_Info_get_valuelen(MPI_Info info, const char *key, int *valuelen,
30233036
int *flag)
30243037
__mpi_interface_deprecated__("PMPI_Info_get_valuelen was deprecated in MPI-4.0; use PMPI_Info_get_string instead");
3038+
#endif
30253039

30263040
/*
30273041
* Even though MPI_Copy_function and MPI_Delete_function are

0 commit comments

Comments
 (0)