diff --git a/src/mesh/GmshReader.cpp b/src/mesh/GmshReader.cpp index 5b9e6516449ae6b29f827b9f0f2287357716263a..babd97e8cf21ba09ff87bb98448adf45b4960b2f 100644 --- a/src/mesh/GmshReader.cpp +++ b/src/mesh/GmshReader.cpp @@ -305,12 +305,13 @@ GmshReader::GmshReader(const std::string& filename) } if (commSize() > 1) { - pout() << "Sequential mesh read! Need to be dispatched\n"; + pout() << "Sequential mesh read! Need to be dispatched\n" << std::flush; + CSRGraph mesh_graph; + CellValue<int> cell_parts; if (commRank() == 0) { mesh_graph = m_mesh->cellToCellGraph(); - CellValue<int> cell_parts; switch(m_mesh->meshDimension()) { case 1: { @@ -337,8 +338,24 @@ GmshReader::GmshReader(const std::string& filename) std::exit(1); } } - Partitioner P; - cell_parts = P.partition(mesh_graph); + } + + Partitioner P; + Array<int> cell_new_owner = broadcast(P.partition(mesh_graph), 0); + + for (int i_rank=0; i_rank<commSize(); ++i_rank) { + if (commRank() == i_rank) { + size_t cpt=0; + std::cout << i_rank << " -> "; + for (size_t i=0; i<cell_new_owner.size(); ++i) { + if (commRank() == cell_new_owner[i]) { + std::cout << i << ' '; + cpt++; + } + } + std::cout << " [" << cpt << "]\n" << std::flush; + } + barrier(); } Messenger::destroy();