Skip to content

Commit

Permalink
Fix OMP bug in AMReX-Codes#4238
Browse files Browse the repository at this point in the history
  • Loading branch information
WeiqunZhang committed Dec 9, 2024
1 parent 96db0a6 commit e9f49de
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Src/EB/AMReX_EBFabFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ EBFArrayBoxFactory::EBFArrayBoxFactory (const EB2::Level& a_level,
m_parent(&a_level)
{
auto const& ebflags = getMultiEBCellFlagFab();
{
// If we do not do this here, there would a race condition when
// calling const_array() in getEBData, because const_arrays() is not
// thread safe.
auto const& ma = ebflags.const_arrays();
amrex::ignore_unused(ma);
}
#ifdef AMREX_USE_GPU
m_eb_data.resize(EBData::real_data_size*ebflags.local_size());
Gpu::PinnedVector<Array4<Real const>> eb_data_hv;
Expand Down

0 comments on commit e9f49de

Please sign in to comment.