From 234db6d79a94896643a56d4e3eb868626d035dd6 Mon Sep 17 00:00:00 2001 From: Hui Zhou Date: Tue, 16 Feb 2021 23:12:11 -0600 Subject: [PATCH] binding: use _large_impl suffix for internal large interface Unfortunately our fortran bindings uses _c_impl and _c to refer to C versions of Fortran binding, causing conflicts with the large count interface. Since it is easier to change the C bindings, we use _large_impl to differentiate. I think it is more readable than _c suffix anyway. --- maint/local_python/binding_c.py | 4 +- ...lgatherv_inter_remote_gather_local_bcast.c | 2 +- ...rv_inter_sched_remote_gather_local_bcast.c | 2 +- src/mpi/coll/op/op_impl.c | 2 +- src/mpi/datatype/type_contents.c | 18 +++---- src/mpi/datatype/type_create.c | 52 +++++++++---------- src/mpi/datatype/type_create_darray.c | 9 ++-- src/mpi/datatype/type_create_subarray.c | 8 +-- .../typerep/src/typerep_dataloop_darray.c | 16 +++--- .../typerep/src/typerep_dataloop_subarray.c | 20 +++---- 10 files changed, 67 insertions(+), 66 deletions(-) diff --git a/maint/local_python/binding_c.py b/maint/local_python/binding_c.py index c6b1f3eb341..4f5a6ea0ea5 100644 --- a/maint/local_python/binding_c.py +++ b/maint/local_python/binding_c.py @@ -1083,7 +1083,7 @@ def push_impl_decl(func, impl_name=None): if func['_map_type'] == "BIG": # add suffix to differentiate - impl_name = re.sub(r'_impl$', '_c_impl', impl_name) + impl_name = re.sub(r'_impl$', '_large_impl', impl_name) if func['_impl_param_list']: params = ', '.join(func['_impl_param_list']) @@ -1266,7 +1266,7 @@ def dump_body_impl(func, prefix='mpir'): impl = func['name'] if func['_map_type'] == "BIG" and func['_poly_impl'] == "separate": - impl += '_c' + impl += '_large' if prefix == 'mpid': impl = re.sub(r'^MPIX?_', 'MPID_', impl) else: diff --git a/src/mpi/coll/allgatherv/allgatherv_inter_remote_gather_local_bcast.c b/src/mpi/coll/allgatherv/allgatherv_inter_remote_gather_local_bcast.c index 81e103bf096..3865a912bf0 100644 --- a/src/mpi/coll/allgatherv/allgatherv_inter_remote_gather_local_bcast.c +++ b/src/mpi/coll/allgatherv/allgatherv_inter_remote_gather_local_bcast.c @@ -94,7 +94,7 @@ int MPIR_Allgatherv_inter_remote_gather_local_bcast(const void *sendbuf, MPI_Ain newcomm_ptr = comm_ptr->local_comm; - mpi_errno = MPIR_Type_indexed_c_impl(remote_size, recvcounts, displs, recvtype, &newtype); + mpi_errno = MPIR_Type_indexed_large_impl(remote_size, recvcounts, displs, recvtype, &newtype); MPIR_ERR_CHECK(mpi_errno); mpi_errno = MPIR_Type_commit_impl(&newtype); diff --git a/src/mpi/coll/iallgatherv/iallgatherv_inter_sched_remote_gather_local_bcast.c b/src/mpi/coll/iallgatherv/iallgatherv_inter_sched_remote_gather_local_bcast.c index 361122e7795..7b5c55d7fc6 100644 --- a/src/mpi/coll/iallgatherv/iallgatherv_inter_sched_remote_gather_local_bcast.c +++ b/src/mpi/coll/iallgatherv/iallgatherv_inter_sched_remote_gather_local_bcast.c @@ -70,7 +70,7 @@ int MPIR_Iallgatherv_inter_sched_remote_gather_local_bcast(const void *sendbuf, newcomm_ptr = comm_ptr->local_comm; - mpi_errno = MPIR_Type_indexed_c_impl(remote_size, recvcounts, displs, recvtype, &newtype); + mpi_errno = MPIR_Type_indexed_large_impl(remote_size, recvcounts, displs, recvtype, &newtype); MPIR_ERR_CHECK(mpi_errno); mpi_errno = MPIR_Type_commit_impl(&newtype); diff --git a/src/mpi/coll/op/op_impl.c b/src/mpi/coll/op/op_impl.c index fa8804acd15..cee1ab58c6c 100644 --- a/src/mpi/coll/op/op_impl.c +++ b/src/mpi/coll/op/op_impl.c @@ -76,7 +76,7 @@ int MPIR_Op_create_impl(MPI_User_function * user_fn, int commute, MPIR_Op ** p_o goto fn_exit; } -int MPIR_Op_create_c_impl(MPI_User_function_c * user_fn, int commute, MPIR_Op ** p_op_ptr) +int MPIR_Op_create_large_impl(MPI_User_function_c * user_fn, int commute, MPIR_Op ** p_op_ptr) { return MPIR_Op_create_impl((void *) user_fn, commute, p_op_ptr); } diff --git a/src/mpi/datatype/type_contents.c b/src/mpi/datatype/type_contents.c index 4d311d96e6e..52ee8041afd 100644 --- a/src/mpi/datatype/type_contents.c +++ b/src/mpi/datatype/type_contents.c @@ -82,11 +82,11 @@ int MPIR_Type_get_contents_impl(MPI_Datatype datatype, int max_integers, int max return mpi_errno; } -int MPIR_Type_get_contents_c_impl(MPI_Datatype datatype, MPI_Aint max_integers, - MPI_Aint max_addresses, MPI_Aint max_counts, - MPI_Aint max_datatypes, int array_of_integers[], - MPI_Aint array_of_addresses[], MPI_Count array_of_counts[], - MPI_Datatype array_of_datatypes[]) +int MPIR_Type_get_contents_large_impl(MPI_Datatype datatype, MPI_Aint max_integers, + MPI_Aint max_addresses, MPI_Aint max_counts, + MPI_Aint max_datatypes, int array_of_integers[], + MPI_Aint array_of_addresses[], MPI_Count array_of_counts[], + MPI_Datatype array_of_datatypes[]) { int mpi_errno = MPI_SUCCESS; @@ -158,10 +158,10 @@ int MPIR_Type_get_envelope_impl(MPI_Datatype datatype, return mpi_errno; } -int MPIR_Type_get_envelope_c_impl(MPI_Datatype datatype, - MPI_Aint * num_integers, MPI_Aint * num_addresses, - MPI_Aint * num_large_counts, MPI_Aint * num_datatypes, - int *combiner) +int MPIR_Type_get_envelope_large_impl(MPI_Datatype datatype, + MPI_Aint * num_integers, MPI_Aint * num_addresses, + MPI_Aint * num_large_counts, MPI_Aint * num_datatypes, + int *combiner) { MPIR_Type_get_envelope(datatype, num_integers, num_addresses, num_large_counts, num_datatypes, combiner); diff --git a/src/mpi/datatype/type_create.c b/src/mpi/datatype/type_create.c index 1ebcdf4b79f..d399133b12f 100644 --- a/src/mpi/datatype/type_create.c +++ b/src/mpi/datatype/type_create.c @@ -370,7 +370,7 @@ int MPIR_Type_contiguous_impl(int count, MPI_Datatype oldtype, MPI_Datatype * ne goto fn_exit; } -int MPIR_Type_contiguous_c_impl(MPI_Aint count, MPI_Datatype oldtype, MPI_Datatype * newtype) +int MPIR_Type_contiguous_large_impl(MPI_Aint count, MPI_Datatype oldtype, MPI_Datatype * newtype) { int mpi_errno = MPI_SUCCESS; MPIR_Datatype *new_dtp; @@ -428,8 +428,8 @@ int MPIR_Type_vector_impl(int count, int blocklength, int stride, MPI_Datatype o goto fn_exit; } -int MPIR_Type_vector_c_impl(MPI_Aint count, MPI_Aint blocklength, MPI_Aint stride, - MPI_Datatype oldtype, MPI_Datatype * newtype) +int MPIR_Type_vector_large_impl(MPI_Aint count, MPI_Aint blocklength, MPI_Aint stride, + MPI_Datatype oldtype, MPI_Datatype * newtype) { int mpi_errno = MPI_SUCCESS; MPI_Datatype new_handle; @@ -484,8 +484,8 @@ int MPIR_Type_create_hvector_impl(int count, int blocklength, MPI_Aint stride, goto fn_exit; } -int MPIR_Type_create_hvector_c_impl(MPI_Aint count, MPI_Aint blocklength, MPI_Aint stride, - MPI_Datatype oldtype, MPI_Datatype * newtype) +int MPIR_Type_create_hvector_large_impl(MPI_Aint count, MPI_Aint blocklength, MPI_Aint stride, + MPI_Datatype oldtype, MPI_Datatype * newtype) { int mpi_errno = MPI_SUCCESS; MPI_Datatype new_handle; @@ -560,9 +560,9 @@ int MPIR_Type_create_indexed_block_impl(int count, goto fn_exit; } -int MPIR_Type_create_indexed_block_c_impl(MPI_Aint count, MPI_Aint blocklength, - const MPI_Aint array_of_displacements[], - MPI_Datatype oldtype, MPI_Datatype * newtype) +int MPIR_Type_create_indexed_block_large_impl(MPI_Aint count, MPI_Aint blocklength, + const MPI_Aint array_of_displacements[], + MPI_Datatype oldtype, MPI_Datatype * newtype) { int mpi_errno = MPI_SUCCESS; MPI_Datatype new_handle; @@ -627,9 +627,9 @@ int MPIR_Type_create_hindexed_block_impl(int count, int blocklength, goto fn_exit; } -int MPIR_Type_create_hindexed_block_c_impl(MPI_Aint count, MPI_Aint blocklength, - const MPI_Aint array_of_displacements[], - MPI_Datatype oldtype, MPI_Datatype * newtype) +int MPIR_Type_create_hindexed_block_large_impl(MPI_Aint count, MPI_Aint blocklength, + const MPI_Aint array_of_displacements[], + MPI_Datatype oldtype, MPI_Datatype * newtype) { int mpi_errno = MPI_SUCCESS; MPI_Datatype new_handle; @@ -718,10 +718,10 @@ int MPIR_Type_indexed_impl(int count, const int *array_of_blocklengths, goto fn_exit; } -int MPIR_Type_indexed_c_impl(MPI_Aint count, - const MPI_Aint * array_of_blocklengths, - const MPI_Aint * array_of_displacements, - MPI_Datatype oldtype, MPI_Datatype * newtype) +int MPIR_Type_indexed_large_impl(MPI_Aint count, + const MPI_Aint * array_of_blocklengths, + const MPI_Aint * array_of_displacements, + MPI_Datatype oldtype, MPI_Datatype * newtype) { int mpi_errno = MPI_SUCCESS; MPI_Datatype new_handle; @@ -805,10 +805,10 @@ int MPIR_Type_create_hindexed_impl(int count, const int array_of_blocklengths[], goto fn_exit; } -int MPIR_Type_create_hindexed_c_impl(MPI_Aint count, - const MPI_Aint array_of_blocklengths[], - const MPI_Aint array_of_displacements[], - MPI_Datatype oldtype, MPI_Datatype * newtype) +int MPIR_Type_create_hindexed_large_impl(MPI_Aint count, + const MPI_Aint array_of_blocklengths[], + const MPI_Aint array_of_displacements[], + MPI_Datatype oldtype, MPI_Datatype * newtype) { int mpi_errno = MPI_SUCCESS; MPI_Datatype new_handle; @@ -842,10 +842,10 @@ int MPIR_Type_create_hindexed_c_impl(MPI_Aint count, goto fn_exit; } -int MPIR_Type_create_struct_c_impl(MPI_Aint count, - const MPI_Aint * array_of_blocklengths, - const MPI_Aint * array_of_displacements, - const MPI_Datatype * array_of_types, MPI_Datatype * newtype) +int MPIR_Type_create_struct_large_impl(MPI_Aint count, + const MPI_Aint * array_of_blocklengths, + const MPI_Aint * array_of_displacements, + const MPI_Datatype * array_of_types, MPI_Datatype * newtype) { int mpi_errno = MPI_SUCCESS; MPI_Datatype new_handle; @@ -1004,8 +1004,8 @@ int MPIR_Type_create_resized_impl(MPI_Datatype oldtype, MPI_Aint lb, MPI_Aint ex goto fn_exit; } -int MPIR_Type_create_resized_c_impl(MPI_Datatype oldtype, MPI_Aint lb, MPI_Aint extent, - MPI_Datatype * newtype) +int MPIR_Type_create_resized_large_impl(MPI_Datatype oldtype, MPI_Aint lb, MPI_Aint extent, + MPI_Datatype * newtype) { int mpi_errno = MPI_SUCCESS; MPI_Datatype new_handle; @@ -1031,7 +1031,7 @@ int MPIR_Type_create_resized_c_impl(MPI_Datatype oldtype, MPI_Aint lb, MPI_Aint goto fn_exit; } -/* FIXME: replace this routine with MPIR_Type_contiguous_c_impl -- require yaksa large count support */ +/* FIXME: replace this routine with MPIR_Type_contiguous_large_impl -- require yaksa large count support */ int MPIR_Type_contiguous_x_impl(MPI_Count count, MPI_Datatype oldtype, MPI_Datatype * newtype) { /* to make 'count' fit MPI-3 type processing routines (which take integer diff --git a/src/mpi/datatype/type_create_darray.c b/src/mpi/datatype/type_create_darray.c index 7a41370b393..eca5759e5ea 100644 --- a/src/mpi/datatype/type_create_darray.c +++ b/src/mpi/datatype/type_create_darray.c @@ -504,10 +504,11 @@ int MPIR_Type_create_darray_impl(int size, int rank, int ndims, goto fn_exit; } -int MPIR_Type_create_darray_c_impl(int size, int rank, int ndims, - const MPI_Aint array_of_gsizes[], const int array_of_distribs[], - const int array_of_dargs[], const int array_of_psizes[], - int order, MPI_Datatype oldtype, MPI_Datatype * newtype) +int MPIR_Type_create_darray_large_impl(int size, int rank, int ndims, + const MPI_Aint array_of_gsizes[], + const int array_of_distribs[], const int array_of_dargs[], + const int array_of_psizes[], int order, MPI_Datatype oldtype, + MPI_Datatype * newtype) { int mpi_errno = MPI_SUCCESS; diff --git a/src/mpi/datatype/type_create_subarray.c b/src/mpi/datatype/type_create_subarray.c index 55b0fa2f24c..91ea82c3ac1 100644 --- a/src/mpi/datatype/type_create_subarray.c +++ b/src/mpi/datatype/type_create_subarray.c @@ -169,10 +169,10 @@ int MPIR_Type_create_subarray_impl(int ndims, const int array_of_sizes[], goto fn_exit; } -int MPIR_Type_create_subarray_c_impl(int ndims, const MPI_Aint array_of_sizes[], - const MPI_Aint array_of_subsizes[], - const MPI_Aint array_of_starts[], int order, - MPI_Datatype oldtype, MPI_Datatype * newtype) +int MPIR_Type_create_subarray_large_impl(int ndims, const MPI_Aint array_of_sizes[], + const MPI_Aint array_of_subsizes[], + const MPI_Aint array_of_starts[], int order, + MPI_Datatype oldtype, MPI_Datatype * newtype) { int mpi_errno = MPI_SUCCESS; diff --git a/src/mpi/datatype/typerep/src/typerep_dataloop_darray.c b/src/mpi/datatype/typerep/src/typerep_dataloop_darray.c index 523dd48c68e..af848e1eeed 100644 --- a/src/mpi/datatype/typerep/src/typerep_dataloop_darray.c +++ b/src/mpi/datatype/typerep/src/typerep_dataloop_darray.c @@ -141,7 +141,7 @@ int MPII_Typerep_convert_darray(int size, int rank, int ndims, const MPI_Aint * MPL_free(st_offsets); MPL_free(coords); - mpi_errno = MPIR_Type_create_struct_c_impl(3, blklens, disps, types, newtype); + mpi_errno = MPIR_Type_create_struct_large_impl(3, blklens, disps, types, newtype); MPIR_ERR_CHECK(mpi_errno); MPIR_Type_free_impl(&type_new); @@ -187,22 +187,22 @@ static int type_block(const MPI_Aint * array_of_gsizes, int dim, int ndims, int stride = orig_extent; if (order == MPI_ORDER_FORTRAN) { if (dim == 0) { - mpi_errno = MPIR_Type_contiguous_c_impl(mysize, type_old, type_new); + mpi_errno = MPIR_Type_contiguous_large_impl(mysize, type_old, type_new); MPIR_ERR_CHECK(mpi_errno); } else { for (int i = 0; i < dim; i++) stride *= (MPI_Aint) (array_of_gsizes[i]); - mpi_errno = MPIR_Type_create_hvector_c_impl(mysize, 1, stride, type_old, type_new); + mpi_errno = MPIR_Type_create_hvector_large_impl(mysize, 1, stride, type_old, type_new); MPIR_ERR_CHECK(mpi_errno); } } else { if (dim == ndims - 1) { - mpi_errno = MPIR_Type_contiguous_c_impl(mysize, type_old, type_new); + mpi_errno = MPIR_Type_contiguous_large_impl(mysize, type_old, type_new); MPIR_ERR_CHECK(mpi_errno); } else { for (int i = ndims - 1; i > dim; i--) stride *= (MPI_Aint) (array_of_gsizes[i]); - mpi_errno = MPIR_Type_create_hvector_c_impl(mysize, 1, stride, type_old, type_new); + mpi_errno = MPIR_Type_create_hvector_large_impl(mysize, 1, stride, type_old, type_new); MPIR_ERR_CHECK(mpi_errno); } } @@ -262,7 +262,7 @@ static int type_cyclic(const MPI_Aint * array_of_gsizes, int dim, int ndims, int for (int i = ndims - 1; i > dim; i--) stride *= (MPI_Aint) (array_of_gsizes[i]); - mpi_errno = MPIR_Type_create_hvector_c_impl(count, blksize, stride, type_old, type_new); + mpi_errno = MPIR_Type_create_hvector_large_impl(count, blksize, stride, type_old, type_new); MPIR_ERR_CHECK(mpi_errno); if (rem) { @@ -276,7 +276,7 @@ static int type_cyclic(const MPI_Aint * array_of_gsizes, int dim, int ndims, int blklens[0] = 1; blklens[1] = rem; - mpi_errno = MPIR_Type_create_struct_c_impl(2, blklens, disps, types, &type_tmp); + mpi_errno = MPIR_Type_create_struct_large_impl(2, blklens, disps, types, &type_tmp); MPIR_ERR_CHECK(mpi_errno); MPIR_Type_free_impl(type_new); @@ -295,7 +295,7 @@ static int type_cyclic(const MPI_Aint * array_of_gsizes, int dim, int ndims, int disps[2] = orig_extent * ((MPI_Aint) (array_of_gsizes[dim])); blklens[0] = blklens[1] = blklens[2] = 1; - mpi_errno = MPIR_Type_create_struct_c_impl(3, blklens, disps, types, &type_tmp); + mpi_errno = MPIR_Type_create_struct_large_impl(3, blklens, disps, types, &type_tmp); MPIR_ERR_CHECK(mpi_errno); MPIR_Type_free_impl(type_new); diff --git a/src/mpi/datatype/typerep/src/typerep_dataloop_subarray.c b/src/mpi/datatype/typerep/src/typerep_dataloop_subarray.c index 975de5be70d..843e3f84976 100644 --- a/src/mpi/datatype/typerep/src/typerep_dataloop_subarray.c +++ b/src/mpi/datatype/typerep/src/typerep_dataloop_subarray.c @@ -22,18 +22,18 @@ int MPII_Typerep_convert_subarray(int ndims, MPI_Aint * array_of_sizes, if (order == MPI_ORDER_FORTRAN) { /* dimension 0 changes fastest */ if (ndims == 1) { - mpi_errno = MPIR_Type_contiguous_c_impl(array_of_subsizes[0], oldtype, &tmp1); + mpi_errno = MPIR_Type_contiguous_large_impl(array_of_subsizes[0], oldtype, &tmp1); MPIR_ERR_CHECK(mpi_errno); } else { - mpi_errno = MPIR_Type_vector_c_impl(array_of_subsizes[1], array_of_subsizes[0], - array_of_sizes[0], oldtype, &tmp1); + mpi_errno = MPIR_Type_vector_large_impl(array_of_subsizes[1], array_of_subsizes[0], + array_of_sizes[0], oldtype, &tmp1); MPIR_ERR_CHECK(mpi_errno); size = (MPI_Aint) (array_of_sizes[0]) * extent; for (i = 2; i < ndims; i++) { size *= (MPI_Aint) (array_of_sizes[i - 1]); mpi_errno = - MPIR_Type_create_hvector_c_impl(array_of_subsizes[i], 1, size, tmp1, &tmp2); + MPIR_Type_create_hvector_large_impl(array_of_subsizes[i], 1, size, tmp1, &tmp2); MPIR_ERR_CHECK(mpi_errno); MPIR_Type_free_impl(&tmp1); tmp1 = tmp2; @@ -51,19 +51,19 @@ int MPII_Typerep_convert_subarray(int ndims, MPI_Aint * array_of_sizes, } else { /* order == MPI_ORDER_C */ /* dimension ndims-1 changes fastest */ if (ndims == 1) { - mpi_errno = MPIR_Type_contiguous_c_impl(array_of_subsizes[0], oldtype, &tmp1); + mpi_errno = MPIR_Type_contiguous_large_impl(array_of_subsizes[0], oldtype, &tmp1); MPIR_ERR_CHECK(mpi_errno); } else { - mpi_errno = MPIR_Type_vector_c_impl(array_of_subsizes[ndims - 2], - array_of_subsizes[ndims - 1], - array_of_sizes[ndims - 1], oldtype, &tmp1); + mpi_errno = MPIR_Type_vector_large_impl(array_of_subsizes[ndims - 2], + array_of_subsizes[ndims - 1], + array_of_sizes[ndims - 1], oldtype, &tmp1); MPIR_ERR_CHECK(mpi_errno); size = (MPI_Aint) (array_of_sizes[ndims - 1]) * extent; for (i = ndims - 3; i >= 0; i--) { size *= (MPI_Aint) (array_of_sizes[i + 1]); mpi_errno = - MPIR_Type_create_hvector_c_impl(array_of_subsizes[i], 1, size, tmp1, &tmp2); + MPIR_Type_create_hvector_large_impl(array_of_subsizes[i], 1, size, tmp1, &tmp2); MPIR_ERR_CHECK(mpi_errno); MPIR_Type_free_impl(&tmp1); tmp1 = tmp2; @@ -91,7 +91,7 @@ int MPII_Typerep_convert_subarray(int ndims, MPI_Aint * array_of_sizes, types[1] = tmp1; types[2] = MPI_UB; - mpi_errno = MPIR_Type_create_struct_c_impl(3, blklens, disps, types, newtype); + mpi_errno = MPIR_Type_create_struct_large_impl(3, blklens, disps, types, newtype); MPIR_ERR_CHECK(mpi_errno); MPIR_Type_free_impl(&tmp1);