Skip to content

Commit 8af9377

Browse files
author
Marius Causemann
committed
set IGL num threads
1 parent fb76ab1 commit 8af9377

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/main.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@
3030

3131
#include <igl/Timer.h>
3232
#include <igl/write_triangle_mesh.h>
33+
#include "igl/default_num_threads.h"
34+
3335

3436
#ifdef LIBIGL_WITH_TETGEN
3537
#include <igl/copyleft/tetgen/tetrahedralize.h>
@@ -277,6 +279,9 @@ int main(int argc, char** argv)
277279
std::cout << "TBB threads " << num_threads << std::endl;
278280
tbb::global_control parallelism_limit(tbb::global_control::max_allowed_parallelism, num_threads);
279281
tbb::global_control stack_size_limit(tbb::global_control::thread_stack_size, stack_size);
282+
// IGL has issues with a nested for loop and oversubscription, see
283+
// https://github.com/libigl/libigl/issues/2412
284+
igl::default_num_threads(std::ceil(std::sqrt(num_threads)));
280285
#endif
281286

282287
// if(params.is_quiet){

0 commit comments

Comments
 (0)