@@ -143,24 +143,6 @@ int MPI_Gengather(void *sendbuf, int sendcount, MPI_Datatype sendtype,
143143 }
144144}
145145
146- int MPI_Gengatherv (const void *sendbuf, int64_t sendcount,
147- MPI_Datatype sendtype, void *recvbuf,
148- const int64_t *recvcounts, const int64_t *displs,
149- MPI_Datatype recvtype, int root_pe, MPI_Comm comm,
150- bool all_gather) {
151- const MPI_Aint *mpi_displs = reinterpret_cast <const MPI_Aint *>(displs);
152- const MPI_Count *mpi_recvcounts =
153- reinterpret_cast <const MPI_Count *>(recvcounts);
154- if (all_gather) {
155- return MPI_Allgatherv_c (sendbuf, sendcount, sendtype, recvbuf,
156- mpi_recvcounts, mpi_displs, recvtype, comm);
157- } else {
158- return MPI_Gatherv_c (sendbuf, sendcount, sendtype, recvbuf,
159- mpi_recvcounts, mpi_displs, recvtype, root_pe,
160- comm);
161- }
162- }
163-
164146std::shared_ptr<array_info> gather_array (std::shared_ptr<array_info> in_arr,
165147 bool all_gather, bool is_parallel,
166148 int mpi_root, int n_pes, int myrank,
@@ -575,14 +557,15 @@ std::shared_ptr<array_info> scatter_array(
575557 is_sender = (mpi_root == MPI_ROOT);
576558 if (is_sender) {
577559 CHECK_MPI (MPI_Comm_remote_size (*comm_ptr, &n_pes),
578- " scatter_array: MPI error on MPI_Comm_remote_size:" );
560+ " _distributed.cpp::scatter_array: MPI error on "
561+ " MPI_Comm_remote_size:" );
579562 }
580563 }
581564
582565 // Broadcast length
583566 int64_t n_rows = in_arr->length ;
584567 CHECK_MPI (MPI_Bcast (&n_rows, 1 , MPI_INT64_T, mpi_root, comm),
585- " _distributed.h::c_bcast : MPI error on MPI_Bcast:" );
568+ " _distributed.cpp::scatter_array : MPI error on MPI_Bcast:" );
586569
587570 Bodo_CTypes::CTypeEnum dtype = in_arr->dtype ;
588571 bodo_array_type::arr_type_enum arr_type = in_arr->arr_type ;
@@ -635,23 +618,22 @@ std::shared_ptr<array_info> scatter_array(
635618 out_arr = alloc_array_top_level (n_loc, -1 , -1 , arr_type, dtype, -1 ,
636619 0 , num_categories);
637620
638- CHECK_MPI (
639- MPI_Scatterv_c (send_ptr, send_count_bytes.data (),
640- send_disp_bytes.data (), mpi_typ,
641- out_arr->data1 (), n_recv_bytes, mpi_typ,
642- mpi_root, comm),
643- " _distributed.cpp::c_scatterv: MPI error on MPI_Scatterv:" );
621+ CHECK_MPI (MPI_Genscatterv (send_ptr, send_count_bytes.data (),
622+ send_disp_bytes.data (), out_arr->data1 (),
623+ n_recv_bytes, mpi_typ, mpi_root, comm),
624+ " _distributed.cpp::scatter_array: MPI error on "
625+ " MPI_Genscatterv:" );
644626
645627 } else {
646628 MPI_Datatype mpi_typ = get_MPI_typ (dtype);
647629 out_arr = alloc_array_top_level (n_loc, -1 , -1 , arr_type, dtype, -1 ,
648630 0 , num_categories);
649631 char *data1_ptr = out_arr->data1 ();
650- CHECK_MPI (
651- MPI_Scatterv_c (in_arr-> data1 (), send_counts .data (),
652- rows_disps. data (), mpi_typ, data1_ptr, n_loc ,
653- mpi_typ, mpi_root, comm),
654- " _distributed.cpp::c_scatterv: MPI error on MPI_Scatterv :" );
632+ CHECK_MPI (MPI_Genscatterv (in_arr-> data1 (), send_counts. data (),
633+ rows_disps .data (), data1_ptr, n_loc ,
634+ mpi_typ, mpi_root, comm) ,
635+ " _distributed.cpp::scatter_array: MPI error on "
636+ " MPI_Genscatterv :" );
655637 }
656638 // Set scale and precision for decimal type
657639 if (dtype == Bodo_CTypes::DECIMAL) {
@@ -664,14 +646,16 @@ std::shared_ptr<array_info> scatter_array(
664646 num_categories);
665647 char *data1_ptr = out_arr->data1 ();
666648 char *data2_ptr = out_arr->data2 ();
667- CHECK_MPI (MPI_Scatterv_c (in_arr->data1 (), send_counts.data (),
668- rows_disps.data (), mpi_typ, data1_ptr, n_loc,
669- mpi_typ, mpi_root, comm),
670- " _distributed.cpp::c_scatterv: MPI error on MPI_Scatterv:" );
671- CHECK_MPI (MPI_Scatterv_c (in_arr->data2 (), send_counts.data (),
672- rows_disps.data (), mpi_typ, data2_ptr, n_loc,
673- mpi_typ, mpi_root, comm),
674- " _distributed.cpp::c_scatterv: MPI error on MPI_Scatterv:" );
649+ CHECK_MPI (
650+ MPI_Genscatterv (in_arr->data1 (), send_counts.data (),
651+ rows_disps.data (), data1_ptr, n_loc, mpi_typ,
652+ mpi_root, comm),
653+ " _distributed.cpp::scatter_array: MPI error on MPI_Genscatterv:" );
654+ CHECK_MPI (
655+ MPI_Genscatterv (in_arr->data2 (), send_counts.data (),
656+ rows_disps.data (), data2_ptr, n_loc, mpi_typ,
657+ mpi_root, comm),
658+ " _distributed.cpp::scatter_array: MPI error on MPI_Genscatterv:" );
675659
676660 } else if (arr_type == bodo_array_type::STRING) {
677661 MPI_Datatype mpi_typ32 = get_MPI_typ (Bodo_CTypes::UINT32);
@@ -702,7 +686,7 @@ std::shared_ptr<array_info> scatter_array(
702686 }
703687 CHECK_MPI (MPI_Bcast (send_counts_chars.data (), n_pes, MPI_INT64_T,
704688 mpi_root, comm),
705- " _distributed.h::c_bcast : MPI error on MPI_Bcast:" );
689+ " _distributed.cpp::scatter_array : MPI error on MPI_Bcast:" );
706690 calc_disp (rows_disps_chars, send_counts_chars);
707691 int64_t n_loc_chars =
708692 0 ? (is_intercomm && is_sender) : send_counts_chars[myrank];
@@ -713,21 +697,20 @@ std::shared_ptr<array_info> scatter_array(
713697 // Scatter string lengths
714698 std::vector<uint32_t > recv_arr_lens (n_loc);
715699 CHECK_MPI (
716- MPI_Scatterv_c (send_arr_lens.data (), send_counts.data (),
717- rows_disps.data (), mpi_typ32, recv_arr_lens.data (),
718- n_loc, mpi_typ32, mpi_root, comm),
719- " _distributed.cpp::c_scatterv : MPI error on MPI_Scatterv :" );
700+ MPI_Genscatterv (send_arr_lens.data (), send_counts.data (),
701+ rows_disps.data (), recv_arr_lens.data (), n_loc ,
702+ mpi_typ32, mpi_root, comm),
703+ " _distributed.cpp::scatter_array : MPI error on MPI_Genscatterv :" );
720704 convert_len_arr_to_offset (recv_arr_lens.data (),
721705 (offset_t *)out_arr->data2 (),
722706 (size_t )out_arr->length );
723707 recv_arr_lens.clear ();
724708
725709 // Scatter string characters
726- CHECK_MPI (
727- MPI_Scatterv_c (in_arr->data1 (), send_counts_chars.data (),
728- rows_disps_chars.data (), mpi_typ8, out_arr->data1 (),
729- n_loc_chars, mpi_typ8, mpi_root, comm),
730- " _distributed.cpp::c_scatterv: MPI error on MPI_Scatterv:" );
710+ CHECK_MPI (MPI_Genscatterv (in_arr->data1 (), send_counts_chars.data (),
711+ rows_disps_chars.data (), out_arr->data1 (),
712+ n_loc_chars, mpi_typ8, mpi_root, comm),
713+ " scatter_array: MPI error on MPI_Genscatterv:" );
731714 } else if (arr_type == bodo_array_type::DICT) {
732715 // broadcast the dictionary data (string array)
733716 std::shared_ptr<array_info> dict_arr = in_arr->child_arrays [0 ];
@@ -748,14 +731,16 @@ std::shared_ptr<array_info> scatter_array(
748731 num_categories);
749732 char *data1_ptr = out_arr->data1 ();
750733 char *data2_ptr = out_arr->data2 ();
751- CHECK_MPI (MPI_Scatterv_c (in_arr->data1 (), send_counts.data (),
752- rows_disps.data (), utc_mpi_typ, data1_ptr,
753- n_loc, utc_mpi_typ, mpi_root, comm),
754- " _distributed.cpp::c_scatterv: MPI error on MPI_Scatterv:" );
755- CHECK_MPI (MPI_Scatterv_c (in_arr->data2 (), send_counts.data (),
756- rows_disps.data (), offset_mpi_typ, data2_ptr,
757- n_loc, offset_mpi_typ, mpi_root, comm),
758- " _distributed.cpp::c_scatterv: MPI error on MPI_Scatterv:" );
734+ CHECK_MPI (
735+ MPI_Genscatterv (in_arr->data1 (), send_counts.data (),
736+ rows_disps.data (), data1_ptr, n_loc, utc_mpi_typ,
737+ mpi_root, comm),
738+ " _distributed.cpp::scatter_array: MPI error on MPI_Genscatterv:" );
739+ CHECK_MPI (
740+ MPI_Genscatterv (in_arr->data2 (), send_counts.data (),
741+ rows_disps.data (), data2_ptr, n_loc, offset_mpi_typ,
742+ mpi_root, comm),
743+ " _distributed.cpp::scatter_array: MPI error on MPI_Genscatterv:" );
759744 } else if (arr_type == bodo_array_type::ARRAY_ITEM) {
760745 MPI_Datatype mpi_typ32 = get_MPI_typ (Bodo_CTypes::UINT32);
761746
@@ -784,7 +769,7 @@ std::shared_ptr<array_info> scatter_array(
784769 }
785770 CHECK_MPI (MPI_Bcast (send_counts_items.data (), n_pes, MPI_INT64_T,
786771 mpi_root, comm),
787- " _distributed.h::c_bcast : MPI error on MPI_Bcast:" );
772+ " _distributed.cpp::scatter_array : MPI error on MPI_Bcast:" );
788773 calc_disp (rows_disps_items, send_counts_items);
789774
790775 std::shared_ptr<array_info> out_inner =
@@ -796,10 +781,10 @@ std::shared_ptr<array_info> scatter_array(
796781 // Scatter string lengths
797782 std::vector<uint32_t > recv_arr_lens (n_loc);
798783 CHECK_MPI (
799- MPI_Scatterv_c (send_arr_lens.data (), send_counts.data (),
800- rows_disps.data (), mpi_typ32, recv_arr_lens.data (),
801- n_loc, mpi_typ32, mpi_root, comm),
802- " _distributed.cpp::c_scatterv : MPI error on MPI_Scatterv :" );
784+ MPI_Genscatterv (send_arr_lens.data (), send_counts.data (),
785+ rows_disps.data (), recv_arr_lens.data (), n_loc ,
786+ mpi_typ32, mpi_root, comm),
787+ " _distributed.cpp::scatter_array : MPI error on MPI_Genscatterv :" );
803788 convert_len_arr_to_offset (recv_arr_lens.data (),
804789 (offset_t *)out_arr->data1 (),
805790 (size_t )out_arr->length );
@@ -852,10 +837,10 @@ std::shared_ptr<array_info> scatter_array(
852837 }
853838
854839 CHECK_MPI (
855- MPI_Scatterv_c (send_ptr, send_count_bytes.data (),
856- send_disp_bytes.data (), mpi_typ , null_bitmask_o,
857- n_recv_bytes, mpi_typ, mpi_root, comm),
858- " _distributed.cpp::c_scatterv : MPI error on MPI_Scatterv :" );
840+ MPI_Genscatterv (send_ptr, send_count_bytes.data (),
841+ send_disp_bytes.data (), null_bitmask_o,
842+ n_recv_bytes, mpi_typ, mpi_root, comm),
843+ " _distributed.cpp::scatter_array : MPI error on MPI_Genscatterv :" );
859844 }
860845
861846 return out_arr;
0 commit comments