From 01583c0bb83c02a0d4da7a7ba3f76128c6642db1 Mon Sep 17 00:00:00 2001 From: Edoardo Zoni Date: Fri, 22 Nov 2024 14:40:26 -0800 Subject: [PATCH] Fix `ThreadSanitizer` data races --- Src/Base/AMReX_Random.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Src/Base/AMReX_Random.cpp b/Src/Base/AMReX_Random.cpp index 891a69e140a..25076ddd05e 100644 --- a/Src/Base/AMReX_Random.cpp +++ b/Src/Base/AMReX_Random.cpp @@ -103,7 +103,8 @@ InitRandom (ULong cpu_seed, int nprocs, ULong gpu_seed) { int tid = OpenMP::get_thread_num(); ULong init_seed = cpu_seed + tid*nprocs; - generators[tid].seed(init_seed); + //generators[tid].seed(init_seed); + generators.at(tid).seed(init_seed); } #ifdef AMREX_USE_GPU