Skip to content
Snippets Groups Projects
Commit 33c10b9c authored by Stéphane Del Pino's avatar Stéphane Del Pino
Browse files

Test broadcast to dispatch cells

parent e4254467
No related branches found
No related tags found
1 merge request!11Feature/mpi
......@@ -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);
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();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment