Skip to content

Commit cb7d5fa

Browse files
committed
Remove most deprecated types/constants/functions
* Add backward API compatibility #define's. * MPI_Info_get[_valuelen]() may also be doable.
1 parent 21f50ce commit cb7d5fa

File tree

3 files changed

+35
-47
lines changed

3 files changed

+35
-47
lines changed

.github/workflows/mpi4py.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,8 @@ jobs:
9292
ncx=$(nm $module | awk '/ MPI_.*_x$/' | wc -l)
9393
ncc=$(nm $module | awk '/ MPI_.*_c$/' | wc -l)
9494
test $nci -ge 149
95-
test $ncx -eq 5
96-
test $ncc -eq 0
95+
test $ncx -eq 0
96+
test $ncc -eq 5
9797
9898
- name: Test mpi4py module (small-count)
9999
shell: python {0}

mpi.h

Lines changed: 33 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -440,8 +440,6 @@ typedef int (MPI_Grequest_query_function)(void *extra_state, MPI_Status *status)
440440
typedef int (MPI_Grequest_free_function)(void *extra_state);
441441
typedef int (MPI_Grequest_cancel_function)(void *extra_state, int complete);
442442

443-
typedef int (MPI_Copy_function)(MPI_Comm comm, int keyval, void *extra_state, void *attribute_val_in, void *attribute_val_out, int *flag); /* deprecated: MPI-2.0 */
444-
typedef int (MPI_Delete_function)(MPI_Comm omm, int keyval, void *attribute_val, void *extra_state); /* deprecated: MPI-2.0 */
445443
typedef int (MPI_Comm_copy_attr_function)(MPI_Comm comm, int keyval, void *extra_state, void *attribute_val_in, void *attribute_val_out, int *flag);
446444
typedef int (MPI_Comm_delete_attr_function)(MPI_Comm comm, int keyval, void *attribute_val, void *extra_state);
447445
typedef int (MPI_Type_copy_attr_function)(MPI_Datatype datatype, int keyval, void *extra_state, void *attribute_val_in, void *attribute_val_out, int *flag);
@@ -463,9 +461,6 @@ typedef MPI_File_errhandler_function MPI_File_errhandler_fn;
463461
typedef MPI_Win_errhandler_function MPI_Win_errhandler_fn;
464462
typedef MPI_Session_errhandler_function MPI_Session_errhandler_fn;
465463

466-
#define MPI_NULL_COPY_FN ((MPI_Copy_function*)0x0) /* deprecated: MPI-2.0 */
467-
#define MPI_DUP_FN ((MPI_Copy_function*)0x1) /* deprecated: MPI-2.0 */
468-
#define MPI_NULL_DELETE_FN ((MPI_Delete_function*)0x0) /* deprecated: MPI-2.0 */
469464
#define MPI_COMM_NULL_COPY_FN ((MPI_Comm_copy_attr_function*)0x0)
470465
#define MPI_COMM_DUP_FN ((MPI_Comm_copy_attr_function*)0x1)
471466
#define MPI_COMM_NULL_DELETE_FN ((MPI_Comm_delete_attr_function*)0x0)
@@ -593,9 +588,6 @@ int MPI_Alltoallw(const void *sendbuf, const int sendcounts[], const int sdispls
593588
int MPI_Alltoallw_c(const void *sendbuf, const MPI_Count sendcounts[], const MPI_Aint sdispls[], const MPI_Datatype sendtypes[], void *recvbuf, const MPI_Count recvcounts[], const MPI_Aint rdispls[], const MPI_Datatype recvtypes[], MPI_Comm comm);
594589
int MPI_Alltoallw_init(const void *sendbuf, const int sendcounts[], const int sdispls[], const MPI_Datatype sendtypes[], void *recvbuf, const int recvcounts[], const int rdispls[], const MPI_Datatype recvtypes[], MPI_Comm comm, MPI_Info info, MPI_Request *request);
595590
int MPI_Alltoallw_init_c(const void *sendbuf, const MPI_Count sendcounts[], const MPI_Aint sdispls[], const MPI_Datatype sendtypes[], void *recvbuf, const MPI_Count recvcounts[], const MPI_Aint rdispls[], const MPI_Datatype recvtypes[], MPI_Comm comm, MPI_Info info, MPI_Request *request);
596-
int MPI_Attr_delete(MPI_Comm comm, int keyval); /* deprecated: MPI-2.0 */
597-
int MPI_Attr_get(MPI_Comm comm, int keyval, void *attribute_val, int *flag); /* deprecated: MPI-2.0 */
598-
int MPI_Attr_put(MPI_Comm comm, int keyval, void *attribute_val); /* deprecated: MPI-2.0 */
599591
int MPI_Barrier(MPI_Comm comm);
600592
int MPI_Barrier_init(MPI_Comm comm, MPI_Info info, MPI_Request *request);
601593
int MPI_Bcast(void *buffer, int count, MPI_Datatype datatype, int root, MPI_Comm comm);
@@ -787,7 +779,6 @@ int MPI_Get_count(const MPI_Status *status, MPI_Datatype datatype, int *count);
787779
int MPI_Get_count_c(const MPI_Status *status, MPI_Datatype datatype, MPI_Count *count);
788780
int MPI_Get_elements(const MPI_Status *status, MPI_Datatype datatype, int *count);
789781
int MPI_Get_elements_c(const MPI_Status *status, MPI_Datatype datatype, MPI_Count *count);
790-
int MPI_Get_elements_x(const MPI_Status *status, MPI_Datatype datatype, MPI_Count *count); /* deprecated: MPI-4.1 */
791782
int MPI_Get_hw_resource_info(MPI_Info *hw_info);
792783
int MPI_Get_library_version(char *version, int *resultlen);
793784
int MPI_Get_processor_name(char *name, int *resultlen);
@@ -892,8 +883,6 @@ int MPI_Isendrecv_replace(void *buf, int count, MPI_Datatype datatype, int dest,
892883
int MPI_Isendrecv_replace_c(void *buf, MPI_Count count, MPI_Datatype datatype, int dest, int sendtag, int source, int recvtag, MPI_Comm comm, MPI_Request *request);
893884
int MPI_Issend(const void *buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request *request);
894885
int MPI_Issend_c(const void *buf, MPI_Count count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request *request);
895-
int MPI_Keyval_create(MPI_Copy_function *copy_fn, MPI_Delete_function *delete_fn, int *keyval, void *extra_state); /* deprecated: MPI-2.0 */
896-
int MPI_Keyval_free(int *keyval); /* deprecated: MPI-2.0 */
897886
int MPI_Lookup_name(const char *service_name, MPI_Info info, char *port_name);
898887
int MPI_Mprobe(int source, int tag, MPI_Comm comm, MPI_Message *message, MPI_Status *status);
899888
int MPI_Mrecv(void *buf, int count, MPI_Datatype datatype, MPI_Message *message, MPI_Status *status);
@@ -1033,7 +1022,6 @@ int MPI_Status_get_tag(MPI_Status *status, int *tag);
10331022
int MPI_Status_set_cancelled(MPI_Status *status, int flag);
10341023
int MPI_Status_set_elements(MPI_Status *status, MPI_Datatype datatype, int count);
10351024
int MPI_Status_set_elements_c(MPI_Status *status, MPI_Datatype datatype, MPI_Count count);
1036-
int MPI_Status_set_elements_x(MPI_Status *status, MPI_Datatype datatype, MPI_Count count); /* deprecated: MPI-4.1 */
10371025
int MPI_Status_set_error(MPI_Status *status, int error);
10381026
int MPI_Status_set_source(MPI_Status *status, int source);
10391027
int MPI_Status_set_tag(MPI_Status *status, int tag);
@@ -1077,11 +1065,9 @@ int MPI_Type_get_envelope(MPI_Datatype datatype, int *num_integers, int *num_add
10771065
int MPI_Type_get_envelope_c(MPI_Datatype datatype, MPI_Count *num_integers, MPI_Count *num_addresses, MPI_Count *num_large_counts, MPI_Count *num_datatypes, int *combiner);
10781066
int MPI_Type_get_extent(MPI_Datatype datatype, MPI_Aint *lb, MPI_Aint *extent);
10791067
int MPI_Type_get_extent_c(MPI_Datatype datatype, MPI_Count *lb, MPI_Count *extent);
1080-
int MPI_Type_get_extent_x(MPI_Datatype datatype, MPI_Count *lb, MPI_Count *extent); /* deprecated: MPI-4.1 */
10811068
int MPI_Type_get_name(MPI_Datatype datatype, char *type_name, int *resultlen);
10821069
int MPI_Type_get_true_extent(MPI_Datatype datatype, MPI_Aint *true_lb, MPI_Aint *true_extent);
10831070
int MPI_Type_get_true_extent_c(MPI_Datatype datatype, MPI_Count *true_lb, MPI_Count *true_extent);
1084-
int MPI_Type_get_true_extent_x(MPI_Datatype datatype, MPI_Count *true_lb, MPI_Count *true_extent); /* deprecated: MPI-4.1 */
10851071
int MPI_Type_get_value_index(MPI_Datatype value_type, MPI_Datatype index_type, MPI_Datatype *pair_type);
10861072
int MPI_Type_indexed(int count, const int array_of_blocklengths[], const int array_of_displacements[], MPI_Datatype oldtype, MPI_Datatype *newtype);
10871073
int MPI_Type_indexed_c(MPI_Count count, const MPI_Count array_of_blocklengths[], const MPI_Count array_of_displacements[], MPI_Datatype oldtype, MPI_Datatype *newtype);
@@ -1090,7 +1076,6 @@ int MPI_Type_set_attr(MPI_Datatype datatype, int type_keyval, void *attribute_va
10901076
int MPI_Type_set_name(MPI_Datatype datatype, const char *type_name);
10911077
int MPI_Type_size(MPI_Datatype datatype, int *size);
10921078
int MPI_Type_size_c(MPI_Datatype datatype, MPI_Count *size);
1093-
int MPI_Type_size_x(MPI_Datatype datatype, MPI_Count *size); /* deprecated: MPI-4.1 */
10941079
int MPI_Type_vector(int count, int blocklength, int stride, MPI_Datatype oldtype, MPI_Datatype *newtype);
10951080
int MPI_Type_vector_c(MPI_Count count, MPI_Count blocklength, MPI_Count stride, MPI_Datatype oldtype, MPI_Datatype *newtype);
10961081
int MPI_Unpack(const void *inbuf, int insize, int *position, void *outbuf, int outcount, MPI_Datatype datatype, MPI_Comm comm);
@@ -1259,9 +1244,6 @@ int PMPI_Alltoallw(const void *sendbuf, const int sendcounts[], const int sdispl
12591244
int PMPI_Alltoallw_c(const void *sendbuf, const MPI_Count sendcounts[], const MPI_Aint sdispls[], const MPI_Datatype sendtypes[], void *recvbuf, const MPI_Count recvcounts[], const MPI_Aint rdispls[], const MPI_Datatype recvtypes[], MPI_Comm comm);
12601245
int PMPI_Alltoallw_init(const void *sendbuf, const int sendcounts[], const int sdispls[], const MPI_Datatype sendtypes[], void *recvbuf, const int recvcounts[], const int rdispls[], const MPI_Datatype recvtypes[], MPI_Comm comm, MPI_Info info, MPI_Request *request);
12611246
int PMPI_Alltoallw_init_c(const void *sendbuf, const MPI_Count sendcounts[], const MPI_Aint sdispls[], const MPI_Datatype sendtypes[], void *recvbuf, const MPI_Count recvcounts[], const MPI_Aint rdispls[], const MPI_Datatype recvtypes[], MPI_Comm comm, MPI_Info info, MPI_Request *request);
1262-
int PMPI_Attr_delete(MPI_Comm comm, int keyval);
1263-
int PMPI_Attr_get(MPI_Comm comm, int keyval, void *attribute_val, int *flag);
1264-
int PMPI_Attr_put(MPI_Comm comm, int keyval, void *attribute_val);
12651247
int PMPI_Barrier(MPI_Comm comm);
12661248
int PMPI_Barrier_init(MPI_Comm comm, MPI_Info info, MPI_Request *request);
12671249
int PMPI_Bcast(void *buffer, int count, MPI_Datatype datatype, int root, MPI_Comm comm);
@@ -1453,7 +1435,6 @@ int PMPI_Get_count(const MPI_Status *status, MPI_Datatype datatype, int *count);
14531435
int PMPI_Get_count_c(const MPI_Status *status, MPI_Datatype datatype, MPI_Count *count);
14541436
int PMPI_Get_elements(const MPI_Status *status, MPI_Datatype datatype, int *count);
14551437
int PMPI_Get_elements_c(const MPI_Status *status, MPI_Datatype datatype, MPI_Count *count);
1456-
int PMPI_Get_elements_x(const MPI_Status *status, MPI_Datatype datatype, MPI_Count *count);
14571438
int PMPI_Get_hw_resource_info(MPI_Info *hw_info);
14581439
int PMPI_Get_library_version(char *version, int *resultlen);
14591440
int PMPI_Get_processor_name(char *name, int *resultlen);
@@ -1558,8 +1539,6 @@ int PMPI_Isendrecv_replace(void *buf, int count, MPI_Datatype datatype, int dest
15581539
int PMPI_Isendrecv_replace_c(void *buf, MPI_Count count, MPI_Datatype datatype, int dest, int sendtag, int source, int recvtag, MPI_Comm comm, MPI_Request *request);
15591540
int PMPI_Issend(const void *buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request *request);
15601541
int PMPI_Issend_c(const void *buf, MPI_Count count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request *request);
1561-
int PMPI_Keyval_create(MPI_Copy_function *copy_fn, MPI_Delete_function *delete_fn, int *keyval, void *extra_state);
1562-
int PMPI_Keyval_free(int *keyval);
15631542
int PMPI_Lookup_name(const char *service_name, MPI_Info info, char *port_name);
15641543
int PMPI_Mprobe(int source, int tag, MPI_Comm comm, MPI_Message *message, MPI_Status *status);
15651544
int PMPI_Mrecv(void *buf, int count, MPI_Datatype datatype, MPI_Message *message, MPI_Status *status);
@@ -1699,7 +1678,6 @@ int PMPI_Status_get_tag(MPI_Status *status, int *tag);
16991678
int PMPI_Status_set_cancelled(MPI_Status *status, int flag);
17001679
int PMPI_Status_set_elements(MPI_Status *status, MPI_Datatype datatype, int count);
17011680
int PMPI_Status_set_elements_c(MPI_Status *status, MPI_Datatype datatype, MPI_Count count);
1702-
int PMPI_Status_set_elements_x(MPI_Status *status, MPI_Datatype datatype, MPI_Count count);
17031681
int PMPI_Status_set_error(MPI_Status *status, int error);
17041682
int PMPI_Status_set_source(MPI_Status *status, int source);
17051683
int PMPI_Status_set_tag(MPI_Status *status, int tag);
@@ -1743,11 +1721,9 @@ int PMPI_Type_get_envelope(MPI_Datatype datatype, int *num_integers, int *num_ad
17431721
int PMPI_Type_get_envelope_c(MPI_Datatype datatype, MPI_Count *num_integers, MPI_Count *num_addresses, MPI_Count *num_large_counts, MPI_Count *num_datatypes, int *combiner);
17441722
int PMPI_Type_get_extent(MPI_Datatype datatype, MPI_Aint *lb, MPI_Aint *extent);
17451723
int PMPI_Type_get_extent_c(MPI_Datatype datatype, MPI_Count *lb, MPI_Count *extent);
1746-
int PMPI_Type_get_extent_x(MPI_Datatype datatype, MPI_Count *lb, MPI_Count *extent);
17471724
int PMPI_Type_get_name(MPI_Datatype datatype, char *type_name, int *resultlen);
17481725
int PMPI_Type_get_true_extent(MPI_Datatype datatype, MPI_Aint *true_lb, MPI_Aint *true_extent);
17491726
int PMPI_Type_get_true_extent_c(MPI_Datatype datatype, MPI_Count *true_lb, MPI_Count *true_extent);
1750-
int PMPI_Type_get_true_extent_x(MPI_Datatype datatype, MPI_Count *true_lb, MPI_Count *true_extent);
17511727
int PMPI_Type_get_value_index(MPI_Datatype value_type, MPI_Datatype index_type, MPI_Datatype *pair_type);
17521728
int PMPI_Type_indexed(int count, const int array_of_blocklengths[], const int array_of_displacements[], MPI_Datatype oldtype, MPI_Datatype *newtype);
17531729
int PMPI_Type_indexed_c(MPI_Count count, const MPI_Count array_of_blocklengths[], const MPI_Count array_of_displacements[], MPI_Datatype oldtype, MPI_Datatype *newtype);
@@ -1756,7 +1732,6 @@ int PMPI_Type_set_attr(MPI_Datatype datatype, int type_keyval, void *attribute_v
17561732
int PMPI_Type_set_name(MPI_Datatype datatype, const char *type_name);
17571733
int PMPI_Type_size(MPI_Datatype datatype, int *size);
17581734
int PMPI_Type_size_c(MPI_Datatype datatype, MPI_Count *size);
1759-
int PMPI_Type_size_x(MPI_Datatype datatype, MPI_Count *size);
17601735
int PMPI_Type_vector(int count, int blocklength, int stride, MPI_Datatype oldtype, MPI_Datatype *newtype);
17611736
int PMPI_Type_vector_c(MPI_Count count, MPI_Count blocklength, MPI_Count stride, MPI_Datatype oldtype, MPI_Datatype *newtype);
17621737
int PMPI_Unpack(const void *inbuf, int insize, int *position, void *outbuf, int outcount, MPI_Datatype datatype, MPI_Comm comm);
@@ -1891,6 +1866,39 @@ int PMPI_T_source_get_info(int source_index, char *name, int *name_len, char *de
18911866
int PMPI_T_source_get_num(int *num_sources);
18921867
int PMPI_T_source_get_timestamp(int source_index, MPI_Count *timestamp);
18931868

1869+
/* Backward-compatibility MPI API definitions for MPI ABI removals */
1870+
1871+
/* MPI deprecated types and constants */
1872+
#define MPI_Copy_function MPI_Comm_copy_attr_function
1873+
#define MPI_Delete_function MPI_Comm_delete_attr_function
1874+
#define MPI_NULL_COPY_FN MPI_COMM_NULL_COPY_FN
1875+
#define MPI_DUP_FN MPI_COMM_DUP_FN
1876+
#define MPI_NULL_DELETE_FN MPI_COMM_NULL_DELETE_FN
1877+
1878+
/* MPI deprecated functions */
1879+
#define MPI_Attr_delete MPI_Comm_delete_attr
1880+
#define MPI_Attr_get MPI_Comm_get_attr
1881+
#define MPI_Attr_put MPI_Comm_set_attr
1882+
#define MPI_Get_elements_x MPI_Get_elements_c
1883+
#define MPI_Keyval_create MPI_Comm_create_keyval
1884+
#define MPI_Keyval_free MPI_Comm_free_keyval
1885+
#define MPI_Status_set_elements_x MPI_Status_set_elements_c
1886+
#define MPI_Type_get_extent_x MPI_Type_get_extent_c
1887+
#define MPI_Type_get_true_extent_x MPI_Type_get_true_extent_c
1888+
#define MPI_Type_size_x MPI_Type_size_c
1889+
1890+
/* PMPI deprecated functions */
1891+
#define PMPI_Attr_delete PMPI_Comm_delete_attr
1892+
#define PMPI_Attr_get PMPI_Comm_get_attr
1893+
#define PMPI_Attr_put PMPI_Comm_set_attr
1894+
#define PMPI_Get_elements_x PMPI_Get_elements_c
1895+
#define PMPI_Keyval_create PMPI_Comm_create_keyval
1896+
#define PMPI_Keyval_free PMPI_Comm_free_keyval
1897+
#define PMPI_Status_set_elements_x PMPI_Status_set_elements_c
1898+
#define PMPI_Type_get_extent_x PMPI_Type_get_extent_c
1899+
#define PMPI_Type_get_true_extent_x PMPI_Type_get_true_extent_c
1900+
#define PMPI_Type_size_x PMPI_Type_size_c
1901+
18941902
#if defined(__cplusplus)
18951903
}
18961904
#endif

0 commit comments

Comments
 (0)