Skip to content

Commit

Permalink
MFIter: Make Finalize Public (AMReX-Codes#2985)
Browse files Browse the repository at this point in the history
Follow-up to AMReX-Codes#2983
  • Loading branch information
ax3l committed Oct 12, 2022
1 parent 5acfe07 commit ed1ecd6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Src/Base/AMReX_MFIter.H
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,8 @@ public:

static int allowMultipleMFIters (int allow);

void Finalize ();

protected:

std::unique_ptr<FabArrayBase> m_fa; //!< This must be the first member!
Expand Down Expand Up @@ -202,7 +204,6 @@ protected:
static AMREX_EXPORT int allow_multiple_mfiters;

void Initialize ();
void Finalize ();
};

//! Is it safe to have these two MultiFabs in the same MFiter?
Expand Down
4 changes: 4 additions & 0 deletions Src/Base/AMReX_MFIter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -215,9 +215,13 @@ MFIter::~MFIter ()
void
MFIter::Finalize ()
{
// avoid double finalize
if (finalized) return;
finalized = true;

// mark as invalid
currentIndex = endIndex;

#ifdef AMREX_USE_OMP
#pragma omp master
#endif
Expand Down

0 comments on commit ed1ecd6

Please sign in to comment.