mirror of
https://github.com/NGSolve/netgen.git
synced 2024-12-24 04:50:34 +05:00
parallel Cluster update
This commit is contained in:
parent
db494f4239
commit
d1ee6efc14
@ -16,7 +16,7 @@ namespace netgen
|
||||
;
|
||||
}
|
||||
|
||||
void AnisotropicClusters :: Update(NgTaskManager tm, NgTracer tracer)
|
||||
void AnisotropicClusters :: Update()
|
||||
{
|
||||
static Timer timer("clusters");
|
||||
// static int timer1 = NgProfiler::CreateTimer ("clusters1");
|
||||
@ -81,13 +81,14 @@ namespace netgen
|
||||
cluster_reps.Elem(nnums[j]) = nnums[j];
|
||||
}
|
||||
*/
|
||||
ParallelForRange
|
||||
(tm, ne,
|
||||
[&] (size_t begin, size_t end)
|
||||
ngcore::ParallelForRange
|
||||
(mesh.VolumeElements().Range(),
|
||||
[&] (auto myrange)
|
||||
{
|
||||
NgArray<int> nnums, ednums, fanums;
|
||||
for (int i = begin+1; i <= end; i++)
|
||||
for (int i_ : myrange)
|
||||
{
|
||||
int i = i_+1;
|
||||
const Element & el = mesh.VolumeElement(i);
|
||||
ELEMENT_TYPE typ = el.GetType();
|
||||
|
||||
@ -110,7 +111,7 @@ namespace netgen
|
||||
for (int j = 0; j < nnums.Size(); j++)
|
||||
cluster_reps.Elem(nnums[j]) = nnums[j];
|
||||
}
|
||||
});
|
||||
}, ngcore::TasksPerThread(4));
|
||||
|
||||
// NgProfiler::StopTimer(timer1);
|
||||
// NgProfiler::StartTimer(timer2);
|
||||
@ -137,13 +138,14 @@ namespace netgen
|
||||
cluster_reps.Elem(nnums[j]) = nnums[j];
|
||||
}
|
||||
*/
|
||||
ParallelForRange
|
||||
(tm, nse,
|
||||
[&] (size_t begin, size_t end)
|
||||
ngcore::ParallelForRange
|
||||
(mesh.SurfaceElements().Range(),
|
||||
[&] (auto myrange)
|
||||
{
|
||||
NgArrayMem<int,9> nnums, ednums;
|
||||
for (int i = begin+1; i <= end; i++)
|
||||
for (int i_ : myrange)
|
||||
{
|
||||
int i = i_+1;
|
||||
const Element2d & el = mesh.SurfaceElement(i);
|
||||
ELEMENT_TYPE typ = el.GetType();
|
||||
|
||||
@ -163,7 +165,7 @@ namespace netgen
|
||||
for (int j = 0; j < nnums.Size(); j++)
|
||||
cluster_reps.Elem(nnums[j]) = nnums[j];
|
||||
}
|
||||
});
|
||||
}, ngcore::TasksPerThread(4));
|
||||
|
||||
|
||||
// NgProfiler::StopTimer(timer2);
|
||||
|
@ -27,7 +27,7 @@ public:
|
||||
AnisotropicClusters (const Mesh & amesh);
|
||||
~AnisotropicClusters();
|
||||
|
||||
void Update(NgTaskManager tm = &DummyTaskManager, NgTracer trace = &DummyTracer);
|
||||
void Update();
|
||||
|
||||
int GetVertexRepresentant (int vnr) const
|
||||
{ return cluster_reps.Get(vnr); }
|
||||
|
@ -6706,7 +6706,7 @@ namespace netgen
|
||||
static Timer t("Update Topology"); RegionTimer reg(t);
|
||||
topology.Update(tm, tracer);
|
||||
(*tracer)("call update clusters", false);
|
||||
clusters->Update(tm, tracer);
|
||||
clusters->Update();
|
||||
(*tracer)("call update clusters", true);
|
||||
#ifdef PARALLEL
|
||||
if (paralleltop)
|
||||
|
Loading…
Reference in New Issue
Block a user