From 684fcd217fe3907675c1a83aa2a9f29e84cdd87b Mon Sep 17 00:00:00 2001 From: philippun Date: Wed, 13 Sep 2023 10:55:05 +0200 Subject: [PATCH] changed default numbeer of cores to max-1 --- include/tug/Simulation.hpp | 2 +- src/FTCS.cpp | 2 -- src/Simulation.cpp | 2 +- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/include/tug/Simulation.hpp b/include/tug/Simulation.hpp index 3383471..641167b 100644 --- a/include/tug/Simulation.hpp +++ b/include/tug/Simulation.hpp @@ -72,7 +72,7 @@ class Simulation { * must be set. For the BTCS approach, the Thomas algorithm is used as * the default linear equation solver as this is faster for tridiagonal * matrices. CSV output, console output and time measure are off by default. - * Also, the number of cores is set to the maximum number of cores by default. + * Also, the number of cores is set to the maximum number of cores -1 by default. * * @param grid Valid grid object * @param bc Valid boundary condition object diff --git a/src/FTCS.cpp b/src/FTCS.cpp index 8be7d67..647c885 100644 --- a/src/FTCS.cpp +++ b/src/FTCS.cpp @@ -11,8 +11,6 @@ #include #include -#define NUM_THREADS 6 - using namespace std; diff --git a/src/Simulation.cpp b/src/Simulation.cpp index 31e2de1..09e5198 100644 --- a/src/Simulation.cpp +++ b/src/Simulation.cpp @@ -23,7 +23,7 @@ Simulation::Simulation(Grid &grid, Boundary &bc, APPROACH approach) : grid(grid) this->timestep = -1; // error per default; needs to be set this->iterations = -1; this->innerIterations = 1; - this->numThreads = omp_get_num_procs(); + this->numThreads = omp_get_num_procs()-1; this->csv_output = CSV_OUTPUT_OFF; this->console_output = CONSOLE_OUTPUT_OFF;