diff --git a/src/libcadet/SimulatorImpl.cpp b/src/libcadet/SimulatorImpl.cpp index f0cac3bcc..000271dc1 100644 --- a/src/libcadet/SimulatorImpl.cpp +++ b/src/libcadet/SimulatorImpl.cpp @@ -1507,6 +1507,10 @@ namespace cadet { // Ensure numThreads >= 0 const int numThreads = paramProvider.getInt("NTHREADS"); +#ifndef CADET_PARALLELIZE + if (numThreads != 1) + throw InvalidParameterException("Non-Parallelized version of CADET-Core is used, but field NTHREADS demands " + std::to_string(numThreads) + " threads. Please set NTHREADS to 1 or use the multithreaded version of CADET-Core."); +#endif // CADET_PARALLELIZE _nThreads = std::max(numThreads, 0); } else diff --git a/test/ColumnTests.cpp b/test/ColumnTests.cpp index 3dcab63ca..140d6046c 100644 --- a/test/ColumnTests.cpp +++ b/test/ColumnTests.cpp @@ -470,7 +470,7 @@ namespace column setupJson["solver"]["CONSISTENT_INIT_MODE"] = pp.getInt("CONSISTENT_INIT_MODE"); if (pp.exists("CONSISTENT_INIT_MODE_SENS")) setupJson["solver"]["CONSISTENT_INIT_MODE_SENS"] = pp.getInt("CONSISTENT_INIT_MODE_SENS"); - setupJson["solver"]["NTHREADS"] = pp.getInt("NTHREADS"); + //setupJson["solver"]["NTHREADS"] = pp.getInt("NTHREADS"); nlohmann::json timeIntegrator; pp.pushScope("time_integrator"); timeIntegrator["ABSTOL"] = copy ? pp.getDouble("ABSTOL") : 1e-8; diff --git a/test/data/configuration_PBM_CSTR_growthSizeDep_benchmark1.json b/test/data/configuration_PBM_CSTR_growthSizeDep_benchmark1.json index c6b80269c..7601b3563 100644 --- a/test/data/configuration_PBM_CSTR_growthSizeDep_benchmark1.json +++ b/test/data/configuration_PBM_CSTR_growthSizeDep_benchmark1.json @@ -697,7 +697,7 @@ } }, "solver": { - "NTHREADS": 8, + "NTHREADS": 1, "USER_SOLUTION_TIMES": [ 0.0, 181.8181818181818, diff --git a/test/data/configuration_PBM_CSTR_growth_benchmark1.json b/test/data/configuration_PBM_CSTR_growth_benchmark1.json index 7f85d037a..5f5cced16 100644 --- a/test/data/configuration_PBM_CSTR_growth_benchmark1.json +++ b/test/data/configuration_PBM_CSTR_growth_benchmark1.json @@ -697,7 +697,7 @@ } }, "solver": { - "NTHREADS": 8, + "NTHREADS": 1, "USER_SOLUTION_TIMES": [ 0.0, 181.8181818181818, diff --git a/test/data/configuration_PBM_CSTR_primaryNucleationAndGrowth_benchmark1.json b/test/data/configuration_PBM_CSTR_primaryNucleationAndGrowth_benchmark1.json index 64847d55a..8b3687d9a 100644 --- a/test/data/configuration_PBM_CSTR_primaryNucleationAndGrowth_benchmark1.json +++ b/test/data/configuration_PBM_CSTR_primaryNucleationAndGrowth_benchmark1.json @@ -697,7 +697,7 @@ } }, "solver": { - "NTHREADS": 8, + "NTHREADS": 1, "USER_SOLUTION_TIMES": [ 0.0, 181.8181818181818, diff --git a/test/data/configuration_PBM_CSTR_primaryNucleationGrowthGrowthRateDispersion_benchmark1.json b/test/data/configuration_PBM_CSTR_primaryNucleationGrowthGrowthRateDispersion_benchmark1.json index cf50e32eb..f88fb7def 100644 --- a/test/data/configuration_PBM_CSTR_primaryNucleationGrowthGrowthRateDispersion_benchmark1.json +++ b/test/data/configuration_PBM_CSTR_primaryNucleationGrowthGrowthRateDispersion_benchmark1.json @@ -697,7 +697,7 @@ } }, "solver": { - "NTHREADS": 8, + "NTHREADS": 1, "USER_SOLUTION_TIMES": [ 0.0, 181.8181818181818, diff --git a/test/data/configuration_PBM_CSTR_primarySecondaryNucleationAndGrowth_benchmark1.json b/test/data/configuration_PBM_CSTR_primarySecondaryNucleationAndGrowth_benchmark1.json index 77b1b9f8d..c8f20a885 100644 --- a/test/data/configuration_PBM_CSTR_primarySecondaryNucleationAndGrowth_benchmark1.json +++ b/test/data/configuration_PBM_CSTR_primarySecondaryNucleationAndGrowth_benchmark1.json @@ -697,7 +697,7 @@ } }, "solver": { - "NTHREADS": 8, + "NTHREADS": 1, "USER_SOLUTION_TIMES": [ 0.0, 181.8181818181818,