Skip to content

Commit

Permalink
Update MFIter::finalized
Browse files Browse the repository at this point in the history
Co-authored-by: Weiqun Zhang <WeiqunZhang@lbl.gov>
  • Loading branch information
ax3l and WeiqunZhang committed Oct 11, 2022
1 parent ea536b7 commit 525cc22
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Src/Base/AMReX_MFIter.H
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ protected:
IndexType typ;

bool dynamic;
bool initialized;
bool finalized = false;

struct DeviceSync {
DeviceSync () = default;
Expand Down
11 changes: 2 additions & 9 deletions Src/Base/AMReX_MFIter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -215,13 +215,13 @@ MFIter::~MFIter ()
void
MFIter::Finalize ()
{
if (!initialized) return;
if (finalized) return;
finalized = true;

#ifdef AMREX_USE_OMP
#pragma omp master
#endif
{
initialized = false;
depth = 0;
}

Expand Down Expand Up @@ -357,13 +357,6 @@ MFIter::Initialize ()

typ = fabArray.boxArray().ixType();
}

#ifdef AMREX_USE_OMP
#pragma omp master
#endif
{
initialized = true;
}
}

Box
Expand Down

0 comments on commit 525cc22

Please sign in to comment.