From ed071f486d9a53a37a29c5fc0d16f3226443bcc9 Mon Sep 17 00:00:00 2001 From: Axel Huebl Date: Thu, 2 Jan 2025 17:12:39 -0800 Subject: [PATCH] Attempt `omp parallel for` --- Src/Base/AMReX_Random.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Src/Base/AMReX_Random.cpp b/Src/Base/AMReX_Random.cpp index 963e6a5b48..e36b291383 100644 --- a/Src/Base/AMReX_Random.cpp +++ b/Src/Base/AMReX_Random.cpp @@ -98,10 +98,10 @@ InitRandom (ULong cpu_seed, int nprocs, ULong gpu_seed) #endif #ifdef AMREX_USE_OMP -#pragma omp parallel firstprivate(cpu_seed, nprocs) +#pragma omp parallel for #endif + for (int tid = 0; tid < nthreads; tid++) { { - int tid = OpenMP::get_thread_num(); ULong init_seed = cpu_seed + tid*nprocs; generators[tid].seed(init_seed); }