Skip to content

Commit e9f49de

Browse files
committed
Fix OMP bug in AMReX-Codes#4238
1 parent 96db0a6 commit e9f49de

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Src/EB/AMReX_EBFabFactory.cpp

+7
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,13 @@ EBFArrayBoxFactory::EBFArrayBoxFactory (const EB2::Level& a_level,
2222
m_parent(&a_level)
2323
{
2424
auto const& ebflags = getMultiEBCellFlagFab();
25+
{
26+
// If we do not do this here, there would a race condition when
27+
// calling const_array() in getEBData, because const_arrays() is not
28+
// thread safe.
29+
auto const& ma = ebflags.const_arrays();
30+
amrex::ignore_unused(ma);
31+
}
2532
#ifdef AMREX_USE_GPU
2633
m_eb_data.resize(EBData::real_data_size*ebflags.local_size());
2734
Gpu::PinnedVector<Array4<Real const>> eb_data_hv;

0 commit comments

Comments
 (0)