20 const std::string fname = __FUNCTION__;
32 uint64_t local_node_count = 0;
37 static_cast<int64_t
>(local_node_count);
38 local_node_count += cell_mapping.NumNodes();
43 MPI_Allgather(&local_node_count,
45 MPI_UNSIGNED_LONG_LONG,
48 MPI_UNSIGNED_LONG_LONG,
53 uint64_t running_block_address = 0;
61 const uint64_t global_node_count = running_block_address;
68 std::map<int, std::vector<uint64_t>> ghost_cell_ids_consolidated;
73 const int locI =
static_cast<int>(cell.partition_id_);
75 std::vector<uint64_t>& locI_cell_id_list =
76 ghost_cell_ids_consolidated[locI];
78 locI_cell_id_list.
push_back(cell.global_id_);
83 const std::map<int, std::vector<uint64_t>> query_ghost_cell_ids_consolidated =
85 MPI_UNSIGNED_LONG_LONG);
88 std::map<int, std::vector<uint64_t>> mapped_ghost_cell_ids_consolidated;
89 for (
const auto& [pid, cell_id_list] : query_ghost_cell_ids_consolidated)
91 std::vector<uint64_t>& map_list = mapped_ghost_cell_ids_consolidated[pid];
93 for (uint64_t cell_global_id : cell_id_list)
97 const uint64_t cell_block_address =
99 map_list.push_back(cell_block_address);
105 const std::map<int, std::vector<uint64_t>> global_id_mapping =
107 MPI_UNSIGNED_LONG_LONG);
110 for (
const auto& [pid, mapping_list] : global_id_mapping)
112 const auto& global_id_list = ghost_cell_ids_consolidated.at(pid);
114 if (mapping_list.size() != global_id_list.size())
115 throw std::logic_error(fname +
": Ghost cell mapping error.");
117 const size_t list_size = mapping_list.size();
118 for (
size_t k = 0; k < list_size; ++k)
120 global_id_list[k],
static_cast<int64_t
>(mapping_list[k]));
125 <<
"Local dof count, start, total " << local_node_count <<
" "
static chi::MPI_Info & mpi
LogStream LogAllVerbose2()
const MPI_Comm & comm
MPI communicator.
const int & process_count
Total number of processes.
const CellMapping & GetCellMapping(const chi_mesh::Cell &cell) const
std::vector< uint64_t > locJ_block_size_
uint64_t globl_base_block_size_
uint64_t local_base_block_size_
uint64_t local_block_address_
const chi_mesh::MeshContinuum & ref_grid_
std::vector< int64_t > cell_local_block_address_
std::vector< std::pair< uint64_t, int64_t > > neighbor_cell_block_address_
std::vector< uint64_t > GetGhostGlobalIDs() const
void push_back(std::unique_ptr< chi_mesh::Cell > new_cell)
LocalCellHandler local_cells
std::map< K, std::vector< T > > MapAllToAll(const std::map< K, std::vector< T > > &pid_data_pairs, const MPI_Datatype data_mpi_type, const MPI_Comm communicator=Chi::mpi.comm)