changed default numbeer of cores to max-1

This commit is contained in:
philippun 2023-09-13 10:55:05 +02:00
parent fc4689461e
commit 684fcd217f
3 changed files with 2 additions and 4 deletions

View File

@ -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

View File

@ -11,8 +11,6 @@
#include <iostream>
#include <omp.h>
#define NUM_THREADS 6
using namespace std;

View File

@ -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;