Skip to content

Commit b2945bf

Browse files
ax3lWeiqunZhang
andcommitted
Update MFIter::finalized
Co-authored-by: Weiqun Zhang <[email protected]>
1 parent ea536b7 commit b2945bf

File tree

2 files changed

+3
-17
lines changed

2 files changed

+3
-17
lines changed

Src/Base/AMReX_MFIter.H

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ protected:
180180
IndexType typ;
181181

182182
bool dynamic;
183-
bool initialized;
183+
bool finalized = false;
184184

185185
struct DeviceSync {
186186
DeviceSync () = default;

Src/Base/AMReX_MFIter.cpp

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -215,15 +215,8 @@ MFIter::~MFIter ()
215215
void
216216
MFIter::Finalize ()
217217
{
218-
if (!initialized) return;
219-
220-
#ifdef AMREX_USE_OMP
221-
#pragma omp master
222-
#endif
223-
{
224-
initialized = false;
225-
depth = 0;
226-
}
218+
if (finalized) return;
219+
finalized = true;
227220

228221
#ifdef BL_USE_TEAM
229222
if ( ! (flags & NoTeamBarrier) )
@@ -357,13 +350,6 @@ MFIter::Initialize ()
357350

358351
typ = fabArray.boxArray().ixType();
359352
}
360-
361-
#ifdef AMREX_USE_OMP
362-
#pragma omp master
363-
#endif
364-
{
365-
initialized = true;
366-
}
367353
}
368354

369355
Box

0 commit comments

Comments
 (0)