Merge branch 'mpi_topo' into 'master'

Mpi topo

See merge request jschoeberl/netgen!141
This commit is contained in:
Joachim Schöberl 2019-03-09 20:31:15 +00:00
commit f57ad036b5
4 changed files with 15 additions and 1 deletions

View File

@ -884,6 +884,9 @@ namespace netgen
throw NgException ("mesh file not found");
}
int rank = GetCommunicator().Rank();
int ntasks = GetCommunicator().Size();
char str[100];
int i, n;

View File

@ -80,7 +80,14 @@ namespace netgen
MyMPI_Bcast(dim, comm);
const_cast<MeshTopology&>(GetTopology()).Update();
// If the topology is not already updated, we do not need to
// build edges/faces.
auto & top = const_cast<MeshTopology&>(GetTopology());
if(top.NeedsUpdate()) {
top.SetBuildEdges(false);
top.SetBuildFaces(false);
top.Update();
}
PrintMessage ( 3, "Sending nr of elements");

View File

@ -51,6 +51,9 @@ namespace netgen
MeshTopology :: ~MeshTopology () { ; }
bool MeshTopology :: NeedsUpdate() const
{ return (timestamp <= mesh->GetTimeStamp()); }
template <typename FUNC>
void LoopOverEdges (const Mesh & mesh, MeshTopology & top, PointIndex v,
FUNC func)

View File

@ -84,6 +84,7 @@ public:
{ return buildfaces; }
void Update(TaskManager tm = &DummyTaskManager, Tracer tracer = &DummyTracer);
bool NeedsUpdate() const;
int GetNEdges () const { return edge2vert.Size(); }