-
Notifications
You must be signed in to change notification settings - Fork 20
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
added option to allow openPMD-api directly from AMReX I/O #489
base: development
Are you sure you want to change the base?
Conversation
(AMREX_USE_OPENPMD_API is on)
for more information, see https://pre-commit.ci
/* | ||
using SrcData = WarpXParticleContainer::ParticleTileType::ConstParticleTileDataType; | ||
tmp.copyParticles(*pc, | ||
[=] AMREX_GPU_HOST_DEVICE (const SrcData& src, int ip, const amrex::RandomEngine& engine) | ||
{ | ||
const SuperParticleType& p = src.getSuperParticle(ip); | ||
return random_filter(p, engine) * uniform_filter(p, engine) | ||
* parser_filter(p, engine) * geometry_filter(p, engine); | ||
}, true); | ||
*/ |
Check notice
Code scanning / CodeQL
Commented-out code Note
/* should be covered by amrex-openpmd-io | ||
// SoA: Real | ||
{ | ||
std::vector<std::string> real_soa_names(RealSoA::names_s.size()); | ||
std::copy(RealSoA::names_s.begin(), RealSoA::names_s.end(), real_soa_names.begin()); | ||
for (auto real_idx = 0; real_idx < RealSoA::nattribs; real_idx++) { | ||
auto const component_name = real_soa_names.at(real_idx); | ||
getComponentRecord(component_name).resetDataset(d_fl); | ||
} | ||
} | ||
// SoA: Int | ||
static_assert(IntSoA::nattribs == 0); // not yet used | ||
*/ |
Check notice
Code scanning / CodeQL
Commented-out code Note
@@ -73,6 +73,8 @@ macro(find_ablastr) | |||
|
|||
# shared libs, i.e. for Python bindings, need relocatable code | |||
if(ImpactX_PYTHON OR BUILD_SHARED_LIBS) | |||
set(AMReX_TINY_PROFILE ON CACHE BOOL "") | |||
set(AMReX_OPENPMD_API ON CACHE BOOL "") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have our own variable for this:
set(AMReX_OPENPMD_API ON CACHE BOOL "") | |
set(AMReX_OPENPMD ${ImpactX_OPENPMD} CACHE BOOL "" FORCE) |
} else if (element_type == "beam_plotplus") { | ||
#ifdef AMREX_USE_OPENPMD_API | ||
std::string openpmd_name = element_name; | ||
pp_element.queryAdd("name", openpmd_name); | ||
std::string openpmd_backend = "default"; | ||
pp_element.queryAdd("backend", openpmd_backend); | ||
std::string openpmd_encoding{"g"}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's simply update beam_monitor
and let us not add another element.
@@ -36,6 +36,7 @@ | |||
#include "SoftQuad.H" | |||
#include "ThinDipole.H" | |||
#include "diagnostics/openPMD.H" | |||
#include "diagnostics/plotplus.H" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#include "diagnostics/plotplus.H" |
#ifdef AMREX_USE_OPENPMD_API | ||
diagnostics::BeamPlotplus, | ||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's update diagnostics::BeamMonitor
instead
#ifdef AMREX_USE_OPENPMD_API | |
diagnostics::BeamPlotplus, | |
#endif |
@@ -1,4 +1,5 @@ | |||
target_sources(lib | |||
PRIVATE | |||
openPMD.cpp | |||
plotplus.cpp |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
plotplus.cpp |
This pull request is to be merged after AMReX openPMD-api I/O is approved: AMReX-Codes/amrex#3666