From df065348a76ad46fba94e40311181f9018a38b7e Mon Sep 17 00:00:00 2001 From: Henrique Dante de Almeida Date: Tue, 3 Sep 2024 15:59:11 -0300 Subject: [PATCH 1/3] Fix compilation with OpenMP disabled (single-threaded build) --- src/lib/onesource.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib/onesource.cpp b/src/lib/onesource.cpp index 8cc06a9..a43f61e 100644 --- a/src/lib/onesource.cpp +++ b/src/lib/onesource.cpp @@ -776,8 +776,9 @@ void onesource::fitIR(vector &fulllibIR, } // Catch the name of the local thread in the parallelisation + int thread_id = 0; #ifdef _OPENMP - int thread_id = omp_get_thread_num(); + thread_id = omp_get_thread_num(); #pragma omp for #endif // Loop over all SEDs from the library From cbc0bfc5263e6e095c6e4efbe9134f18c6ea52b4 Mon Sep 17 00:00:00 2001 From: Johann Cohen-Tanugi Date: Sat, 7 Sep 2024 11:31:48 +0200 Subject: [PATCH 2/3] fix clang --- src/lib/onesource.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib/onesource.cpp b/src/lib/onesource.cpp index a43f61e..e86f1d3 100644 --- a/src/lib/onesource.cpp +++ b/src/lib/onesource.cpp @@ -405,8 +405,8 @@ void onesource::fit(vector &fulllib, const vector> &flux, firstprivate(s2n, invsab, invsabSq, abinvsabSq, imagm, nbul, busul, \ priorLib, number_threads, thread_id) private(il) { - // Catch the name of the local thread in the parrallelisation - thread_id = omp_get_thread_num(); + // Catch the name of the local thread in the parrallelisation + thread_id = omp_get_thread_num(); #endif // Compute normalisation and chi2 @@ -775,7 +775,7 @@ void onesource::fitIR(vector &fulllibIR, } } -// Catch the name of the local thread in the parallelisation + // Catch the name of the local thread in the parallelisation int thread_id = 0; #ifdef _OPENMP thread_id = omp_get_thread_num(); From 4e0d3b95b7998c564e4bb56e1e3e7824e305a21a Mon Sep 17 00:00:00 2001 From: Johann Cohen-Tanugi Date: Sat, 7 Sep 2024 11:52:56 +0200 Subject: [PATCH 3/3] fix clang --- src/lib/onesource.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/onesource.cpp b/src/lib/onesource.cpp index e86f1d3..ff85d43 100644 --- a/src/lib/onesource.cpp +++ b/src/lib/onesource.cpp @@ -405,8 +405,8 @@ void onesource::fit(vector &fulllib, const vector> &flux, firstprivate(s2n, invsab, invsabSq, abinvsabSq, imagm, nbul, busul, \ priorLib, number_threads, thread_id) private(il) { - // Catch the name of the local thread in the parrallelisation - thread_id = omp_get_thread_num(); + // Catch the name of the local thread in the parrallelisation + thread_id = omp_get_thread_num(); #endif // Compute normalisation and chi2