Commit c74b4815 authored by NICLAUSSE Nicolas's avatar NICLAUSSE Nicolas
Browse files

skip remap when communicator size is 1

parent 9e1feb45
......@@ -356,19 +356,20 @@ inline bool dtkDistributedGraph::read(const QString& filename)
qDebug() << "read done in "<< time.elapsed() << "ms";
time.restart();
}
dtkDistributedMapper *mapper = new dtkDistributedMapper;
mapper->initMap(2 * edges_count, m_comm->size());
qlonglong offset = 0;
for (qlonglong i = 0; i < m_comm->size(); ++i) {
mapper->setMap(offset ,i);
offset += m_edge_count->at(i);
}
m_edges->remap(mapper);
if (this->wid() == 0) {
qDebug() << "remap done in "<< time.elapsed() << "ms";
if (m_comm->size() > 1) {
dtkDistributedMapper *mapper = new dtkDistributedMapper;
mapper->initMap(2 * edges_count, m_comm->size());
qlonglong offset = 0;
for (qlonglong i = 0; i < m_comm->size(); ++i) {
mapper->setMap(offset ,i);
offset += m_edge_count->at(i);
}
m_edges->remap(mapper);
if (this->wid() == 0) {
qDebug() << "remap done in "<< time.elapsed() << "ms";
}
}
return true;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment