Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Escape code in BeamMonitor when openPMD is off #631

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions src/particles/elements/diagnostics/openPMD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ namespace detail

void BeamMonitor::finalize ()
{
#ifdef ImpactX_USE_OPENPMD
// close shared series alias
if (m_series.has_value())
{
Expand All @@ -150,6 +151,7 @@ namespace detail
// remove from unique series map
if (m_unique_series.count(m_series_name) != 0u)
m_unique_series.erase(m_series_name);
#endif // ImpactX_USE_OPENPMD
}

BeamMonitor::BeamMonitor (std::string series_name, std::string backend, std::string encoding) :
Expand Down Expand Up @@ -303,7 +305,7 @@ namespace detail
throw std::runtime_error("BeamMonitor: int_soa_names output not yet implemented!");
#else
amrex::ignore_unused(pc, step);
#endif
#endif // ImpactX_USE_OPENPMD
}

void
Expand All @@ -312,6 +314,7 @@ namespace detail
int step
)
{
#ifdef ImpactX_USE_OPENPMD
std::string profile_name = "impactx::Push::" + std::string(BeamMonitor::name);
BL_PROFILE(profile_name);

Expand Down Expand Up @@ -368,6 +371,9 @@ namespace detail

// close iteration
iteration.close();
#else
amrex::ignore_unused(pc, step);
#endif // ImpactX_USE_OPENPMD
}

void
Expand Down Expand Up @@ -446,7 +452,7 @@ namespace detail
series.flush();
#else
amrex::ignore_unused(pti, ref_part);
#endif
#endif // ImpactX_USE_OPENPMD
}

} // namespace impactx::diagnostics
Loading