Skip to content

Commit 42eb230

Browse files
committed
Remove most deprecated types/constants/functions
* Add backward API compatibility #define's. * MPI_Info_get_valuelen() may also be doable, but let it be for now.
1 parent 00a219e commit 42eb230

File tree

3 files changed

+33
-47
lines changed

3 files changed

+33
-47
lines changed

.github/workflows/mpi4py.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,8 @@ jobs:
9494
ncx=$(nm $module | awk '/ MPI_.*_x$/' | wc -l)
9595
ncc=$(nm $module | awk '/ MPI_.*_c$/' | wc -l)
9696
test $nci -ge 149
97-
test $ncx -eq 5
98-
test $ncc -eq 0
97+
test $ncx -eq 0
98+
test $ncc -eq 5
9999
100100
- name: Test mpi4py module (small-count)
101101
shell: python {0}

mpi.h

Lines changed: 31 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -456,8 +456,6 @@ typedef int (MPI_Grequest_query_function)(void *extra_state, MPI_Status *status)
456456
typedef int (MPI_Grequest_free_function)(void *extra_state);
457457
typedef int (MPI_Grequest_cancel_function)(void *extra_state, int complete);
458458

459-
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 */
460-
typedef int (MPI_Delete_function)(MPI_Comm omm, int keyval, void *attribute_val, void *extra_state); /* deprecated: MPI-2.0 */
461459
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);
462460
typedef int (MPI_Comm_delete_attr_function)(MPI_Comm comm, int keyval, void *attribute_val, void *extra_state);
463461
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);
@@ -479,9 +477,6 @@ typedef MPI_File_errhandler_function MPI_File_errhandler_fn;
479477
typedef MPI_Win_errhandler_function MPI_Win_errhandler_fn;
480478
typedef MPI_Session_errhandler_function MPI_Session_errhandler_fn;
481479

482-
#define MPI_NULL_COPY_FN ((MPI_Copy_function*)0x0) /* deprecated: MPI-2.0 */
483-
#define MPI_DUP_FN ((MPI_Copy_function*)0x1) /* deprecated: MPI-2.0 */
484-
#define MPI_NULL_DELETE_FN ((MPI_Delete_function*)0x0) /* deprecated: MPI-2.0 */
485480
#define MPI_COMM_NULL_COPY_FN ((MPI_Comm_copy_attr_function*)0x0)
486481
#define MPI_COMM_DUP_FN ((MPI_Comm_copy_attr_function*)0x1)
487482
#define MPI_COMM_NULL_DELETE_FN ((MPI_Comm_delete_attr_function*)0x0)
@@ -613,9 +608,6 @@ int MPI_Alltoallw(const void *sendbuf, const int sendcounts[], const int sdispls
613608
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);
614609
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);
615610
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);
616-
int MPI_Attr_delete(MPI_Comm comm, int keyval); /* deprecated: MPI-2.0 */
617-
int MPI_Attr_get(MPI_Comm comm, int keyval, void *attribute_val, int *flag); /* deprecated: MPI-2.0 */
618-
int MPI_Attr_put(MPI_Comm comm, int keyval, void *attribute_val); /* deprecated: MPI-2.0 */
619611
int MPI_Barrier(MPI_Comm comm);
620612
int MPI_Barrier_init(MPI_Comm comm, MPI_Info info, MPI_Request *request);
621613
int MPI_Bcast(void *buffer, int count, MPI_Datatype datatype, int root, MPI_Comm comm);
@@ -807,7 +799,6 @@ int MPI_Get_count(const MPI_Status *status, MPI_Datatype datatype, int *count);
807799
int MPI_Get_count_c(const MPI_Status *status, MPI_Datatype datatype, MPI_Count *count);
808800
int MPI_Get_elements(const MPI_Status *status, MPI_Datatype datatype, int *count);
809801
int MPI_Get_elements_c(const MPI_Status *status, MPI_Datatype datatype, MPI_Count *count);
810-
int MPI_Get_elements_x(const MPI_Status *status, MPI_Datatype datatype, MPI_Count *count); /* deprecated: MPI-4.1 */
811802
int MPI_Get_hw_resource_info(MPI_Info *hw_info);
812803
int MPI_Get_library_version(char *version, int *resultlen);
813804
int MPI_Get_processor_name(char *name, int *resultlen);
@@ -912,8 +903,6 @@ int MPI_Isendrecv_replace(void *buf, int count, MPI_Datatype datatype, int dest,
912903
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);
913904
int MPI_Issend(const void *buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request *request);
914905
int MPI_Issend_c(const void *buf, MPI_Count count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request *request);
915-
int MPI_Keyval_create(MPI_Copy_function *copy_fn, MPI_Delete_function *delete_fn, int *keyval, void *extra_state); /* deprecated: MPI-2.0 */
916-
int MPI_Keyval_free(int *keyval); /* deprecated: MPI-2.0 */
917906
int MPI_Lookup_name(const char *service_name, MPI_Info info, char *port_name);
918907
int MPI_Mprobe(int source, int tag, MPI_Comm comm, MPI_Message *message, MPI_Status *status);
919908
int MPI_Mrecv(void *buf, int count, MPI_Datatype datatype, MPI_Message *message, MPI_Status *status);
@@ -1051,7 +1040,6 @@ int MPI_Status_get_tag(MPI_Status *status, int *tag);
10511040
int MPI_Status_set_cancelled(MPI_Status *status, int flag);
10521041
int MPI_Status_set_elements(MPI_Status *status, MPI_Datatype datatype, int count);
10531042
int MPI_Status_set_elements_c(MPI_Status *status, MPI_Datatype datatype, MPI_Count count);
1054-
int MPI_Status_set_elements_x(MPI_Status *status, MPI_Datatype datatype, MPI_Count count); /* deprecated: MPI-4.1 */
10551043
int MPI_Status_set_error(MPI_Status *status, int error);
10561044
int MPI_Status_set_source(MPI_Status *status, int source);
10571045
int MPI_Status_set_tag(MPI_Status *status, int tag);
@@ -1095,11 +1083,9 @@ int MPI_Type_get_envelope(MPI_Datatype datatype, int *num_integers, int *num_add
10951083
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);
10961084
int MPI_Type_get_extent(MPI_Datatype datatype, MPI_Aint *lb, MPI_Aint *extent);
10971085
int MPI_Type_get_extent_c(MPI_Datatype datatype, MPI_Count *lb, MPI_Count *extent);
1098-
int MPI_Type_get_extent_x(MPI_Datatype datatype, MPI_Count *lb, MPI_Count *extent); /* deprecated: MPI-4.1 */
10991086
int MPI_Type_get_name(MPI_Datatype datatype, char *type_name, int *resultlen);
11001087
int MPI_Type_get_true_extent(MPI_Datatype datatype, MPI_Aint *true_lb, MPI_Aint *true_extent);
11011088
int MPI_Type_get_true_extent_c(MPI_Datatype datatype, MPI_Count *true_lb, MPI_Count *true_extent);
1102-
int MPI_Type_get_true_extent_x(MPI_Datatype datatype, MPI_Count *true_lb, MPI_Count *true_extent); /* deprecated: MPI-4.1 */
11031089
int MPI_Type_get_value_index(MPI_Datatype value_type, MPI_Datatype index_type, MPI_Datatype *pair_type);
11041090
int MPI_Type_indexed(int count, const int array_of_blocklengths[], const int array_of_displacements[], MPI_Datatype oldtype, MPI_Datatype *newtype);
11051091
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);
@@ -1108,7 +1094,6 @@ int MPI_Type_set_attr(MPI_Datatype datatype, int type_keyval, void *attribute_va
11081094
int MPI_Type_set_name(MPI_Datatype datatype, const char *type_name);
11091095
int MPI_Type_size(MPI_Datatype datatype, int *size);
11101096
int MPI_Type_size_c(MPI_Datatype datatype, MPI_Count *size);
1111-
int MPI_Type_size_x(MPI_Datatype datatype, MPI_Count *size); /* deprecated: MPI-4.1 */
11121097
int MPI_Type_vector(int count, int blocklength, int stride, MPI_Datatype oldtype, MPI_Datatype *newtype);
11131098
int MPI_Type_vector_c(MPI_Count count, MPI_Count blocklength, MPI_Count stride, MPI_Datatype oldtype, MPI_Datatype *newtype);
11141099
int MPI_Unpack(const void *inbuf, int insize, int *position, void *outbuf, int outcount, MPI_Datatype datatype, MPI_Comm comm);
@@ -1196,6 +1181,25 @@ MPI_Session MPI_Session_f2c(MPI_Fint session);
11961181
MPI_Fint MPI_Win_c2f(MPI_Win win);
11971182
MPI_Win MPI_Win_f2c(MPI_Fint win);
11981183

1184+
/* MPI deprecated types and constants */
1185+
#define MPI_Copy_function MPI_Comm_copy_attr_function
1186+
#define MPI_Delete_function MPI_Comm_delete_attr_function
1187+
#define MPI_NULL_COPY_FN MPI_COMM_NULL_COPY_FN
1188+
#define MPI_DUP_FN MPI_COMM_DUP_FN
1189+
#define MPI_NULL_DELETE_FN MPI_COMM_NULL_DELETE_FN
1190+
1191+
/* MPI deprecated functions */
1192+
#define MPI_Attr_delete MPI_Comm_delete_attr
1193+
#define MPI_Attr_get MPI_Comm_get_attr
1194+
#define MPI_Attr_put MPI_Comm_set_attr
1195+
#define MPI_Get_elements_x MPI_Get_elements_c
1196+
#define MPI_Keyval_create MPI_Comm_create_keyval
1197+
#define MPI_Keyval_free MPI_Comm_free_keyval
1198+
#define MPI_Status_set_elements_x MPI_Status_set_elements_c
1199+
#define MPI_Type_get_extent_x MPI_Type_get_extent_c
1200+
#define MPI_Type_get_true_extent_x MPI_Type_get_true_extent_c
1201+
#define MPI_Type_size_x MPI_Type_size_c
1202+
11991203
/* MPI_T functions */
12001204
int MPI_T_category_changed(int *update_number);
12011205
int MPI_T_category_get_categories(int cat_index, int len, int indices[]);
@@ -1281,9 +1285,6 @@ int PMPI_Alltoallw(const void *sendbuf, const int sendcounts[], const int sdispl
12811285
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);
12821286
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);
12831287
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);
1284-
int PMPI_Attr_delete(MPI_Comm comm, int keyval);
1285-
int PMPI_Attr_get(MPI_Comm comm, int keyval, void *attribute_val, int *flag);
1286-
int PMPI_Attr_put(MPI_Comm comm, int keyval, void *attribute_val);
12871288
int PMPI_Barrier(MPI_Comm comm);
12881289
int PMPI_Barrier_init(MPI_Comm comm, MPI_Info info, MPI_Request *request);
12891290
int PMPI_Bcast(void *buffer, int count, MPI_Datatype datatype, int root, MPI_Comm comm);
@@ -1475,7 +1476,6 @@ int PMPI_Get_count(const MPI_Status *status, MPI_Datatype datatype, int *count);
14751476
int PMPI_Get_count_c(const MPI_Status *status, MPI_Datatype datatype, MPI_Count *count);
14761477
int PMPI_Get_elements(const MPI_Status *status, MPI_Datatype datatype, int *count);
14771478
int PMPI_Get_elements_c(const MPI_Status *status, MPI_Datatype datatype, MPI_Count *count);
1478-
int PMPI_Get_elements_x(const MPI_Status *status, MPI_Datatype datatype, MPI_Count *count);
14791479
int PMPI_Get_hw_resource_info(MPI_Info *hw_info);
14801480
int PMPI_Get_library_version(char *version, int *resultlen);
14811481
int PMPI_Get_processor_name(char *name, int *resultlen);
@@ -1580,8 +1580,6 @@ int PMPI_Isendrecv_replace(void *buf, int count, MPI_Datatype datatype, int dest
15801580
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);
15811581
int PMPI_Issend(const void *buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request *request);
15821582
int PMPI_Issend_c(const void *buf, MPI_Count count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm, MPI_Request *request);
1583-
int PMPI_Keyval_create(MPI_Copy_function *copy_fn, MPI_Delete_function *delete_fn, int *keyval, void *extra_state);
1584-
int PMPI_Keyval_free(int *keyval);
15851583
int PMPI_Lookup_name(const char *service_name, MPI_Info info, char *port_name);
15861584
int PMPI_Mprobe(int source, int tag, MPI_Comm comm, MPI_Message *message, MPI_Status *status);
15871585
int PMPI_Mrecv(void *buf, int count, MPI_Datatype datatype, MPI_Message *message, MPI_Status *status);
@@ -1719,7 +1717,6 @@ int PMPI_Status_get_tag(MPI_Status *status, int *tag);
17191717
int PMPI_Status_set_cancelled(MPI_Status *status, int flag);
17201718
int PMPI_Status_set_elements(MPI_Status *status, MPI_Datatype datatype, int count);
17211719
int PMPI_Status_set_elements_c(MPI_Status *status, MPI_Datatype datatype, MPI_Count count);
1722-
int PMPI_Status_set_elements_x(MPI_Status *status, MPI_Datatype datatype, MPI_Count count);
17231720
int PMPI_Status_set_error(MPI_Status *status, int error);
17241721
int PMPI_Status_set_source(MPI_Status *status, int source);
17251722
int PMPI_Status_set_tag(MPI_Status *status, int tag);
@@ -1763,11 +1760,9 @@ int PMPI_Type_get_envelope(MPI_Datatype datatype, int *num_integers, int *num_ad
17631760
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);
17641761
int PMPI_Type_get_extent(MPI_Datatype datatype, MPI_Aint *lb, MPI_Aint *extent);
17651762
int PMPI_Type_get_extent_c(MPI_Datatype datatype, MPI_Count *lb, MPI_Count *extent);
1766-
int PMPI_Type_get_extent_x(MPI_Datatype datatype, MPI_Count *lb, MPI_Count *extent);
17671763
int PMPI_Type_get_name(MPI_Datatype datatype, char *type_name, int *resultlen);
17681764
int PMPI_Type_get_true_extent(MPI_Datatype datatype, MPI_Aint *true_lb, MPI_Aint *true_extent);
17691765
int PMPI_Type_get_true_extent_c(MPI_Datatype datatype, MPI_Count *true_lb, MPI_Count *true_extent);
1770-
int PMPI_Type_get_true_extent_x(MPI_Datatype datatype, MPI_Count *true_lb, MPI_Count *true_extent);
17711766
int PMPI_Type_get_value_index(MPI_Datatype value_type, MPI_Datatype index_type, MPI_Datatype *pair_type);
17721767
int PMPI_Type_indexed(int count, const int array_of_blocklengths[], const int array_of_displacements[], MPI_Datatype oldtype, MPI_Datatype *newtype);
17731768
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);
@@ -1776,7 +1771,6 @@ int PMPI_Type_set_attr(MPI_Datatype datatype, int type_keyval, void *attribute_v
17761771
int PMPI_Type_set_name(MPI_Datatype datatype, const char *type_name);
17771772
int PMPI_Type_size(MPI_Datatype datatype, int *size);
17781773
int PMPI_Type_size_c(MPI_Datatype datatype, MPI_Count *size);
1779-
int PMPI_Type_size_x(MPI_Datatype datatype, MPI_Count *size);
17801774
int PMPI_Type_vector(int count, int blocklength, int stride, MPI_Datatype oldtype, MPI_Datatype *newtype);
17811775
int PMPI_Type_vector_c(MPI_Count count, MPI_Count blocklength, MPI_Count stride, MPI_Datatype oldtype, MPI_Datatype *newtype);
17821776
int PMPI_Unpack(const void *inbuf, int insize, int *position, void *outbuf, int outcount, MPI_Datatype datatype, MPI_Comm comm);
@@ -1864,6 +1858,18 @@ MPI_Session PMPI_Session_f2c(MPI_Fint session);
18641858
MPI_Fint PMPI_Win_c2f(MPI_Win win);
18651859
MPI_Win PMPI_Win_f2c(MPI_Fint win);
18661860

1861+
/* PMPI deprecated functions */
1862+
#define PMPI_Attr_delete PMPI_Comm_delete_attr
1863+
#define PMPI_Attr_get PMPI_Comm_get_attr
1864+
#define PMPI_Attr_put PMPI_Comm_set_attr
1865+
#define PMPI_Get_elements_x PMPI_Get_elements_c
1866+
#define PMPI_Keyval_create PMPI_Comm_create_keyval
1867+
#define PMPI_Keyval_free PMPI_Comm_free_keyval
1868+
#define PMPI_Status_set_elements_x PMPI_Status_set_elements_c
1869+
#define PMPI_Type_get_extent_x PMPI_Type_get_extent_c
1870+
#define PMPI_Type_get_true_extent_x PMPI_Type_get_true_extent_c
1871+
#define PMPI_Type_size_x PMPI_Type_size_c
1872+
18671873
/* PMPI_T functions */
18681874
int PMPI_T_category_changed(int *update_number);
18691875
int PMPI_T_category_get_categories(int cat_index, int len, int indices[]);

0 commit comments

Comments
 (0)