diff --git a/libsrc/meshing/improve3.cpp b/libsrc/meshing/improve3.cpp index c841081d..0c48b38f 100644 --- a/libsrc/meshing/improve3.cpp +++ b/libsrc/meshing/improve3.cpp @@ -419,10 +419,12 @@ void MeshOptimize3d :: BuildEdgeList( const Mesh & mesh, const TABLE>> thread_edges(ngcore::TaskManager::GetMaxThreads()); + int ntasks = 2*ngcore::TaskManager::GetMaxThreads(); + Array>> task_edges(ntasks); - ParallelForRange(mesh.Points().Range(), [&] (auto myrange) + ParallelFor(IntRange(ntasks), [&] (int ti) { + auto myrange = mesh.Points().Range().Split(ti, ntasks); ArrayMem, 100> local_edges; for (auto pi : myrange) { @@ -449,17 +451,17 @@ void MeshOptimize3d :: BuildEdgeList( const Mesh & mesh, const TABLE