From 51c9a6e6e6ab496e267126ac92ef9151507a99fd Mon Sep 17 00:00:00 2001 From: James Yang Date: Tue, 26 Nov 2024 21:22:29 -0800 Subject: [PATCH] Add full parallelization no matter what for constraint handling stuff since they tend to not be parallelized that much anyways. --- adelie/src/include/adelie_core/solver/solver_base.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/adelie/src/include/adelie_core/solver/solver_base.hpp b/adelie/src/include/adelie_core/solver/solver_base.hpp index d6cad768..1fb3bc90 100644 --- a/adelie/src/include/adelie_core/solver/solver_base.hpp +++ b/adelie/src/include/adelie_core/solver/solver_base.hpp @@ -94,7 +94,7 @@ inline void update_abs_grad( try_failed = true; } }; - util::omp_parallel_for(routine, 0, groups.size(), n_threads * (n_threads <= static_cast(groups.size()))); + util::omp_parallel_for(routine, 0, groups.size(), n_threads); if (try_failed) { throw util::adelie_core_solver_error( "exception raised in constraint->solve_zero(). " @@ -192,7 +192,7 @@ inline auto sparsify_dual( constraint->dual(indices_v, values_v); indices_v += dual_groups[i]; }; - util::omp_parallel_for(routine, 0, n_constraints, n_threads * (n_threads <= n_constraints)); + util::omp_parallel_for(routine, 0, n_constraints, n_threads); } const auto last_constraint = constraints[n_constraints-1];