diff options
author | 2022-02-17 22:21:00 -0500 | |
---|---|---|
committer | 2022-02-17 19:21:00 -0800 | |
commit | 8e1517ae8c09c65f6602c772e6bf9f0dcb5829a8 (patch) | |
tree | 532afc5113eb03ddcfa85a36140e7bf3982cb281 /Source/Diagnostics/FlushFormats/FlushFormatOpenPMD.cpp | |
parent | bc6991e6b58f455a139401c96d77dccfa35003a6 (diff) | |
download | WarpX-8e1517ae8c09c65f6602c772e6bf9f0dcb5829a8.tar.gz WarpX-8e1517ae8c09c65f6602c772e6bf9f0dcb5829a8.tar.zst WarpX-8e1517ae8c09c65f6602c772e6bf9f0dcb5829a8.zip |
openPMD: Add ADIOS2 Engine Parameter Control (#2872)
* Adds support for ADIOS engines #2866
Input file can now have lines like
diag1.adios2_engine.parameters.NumAggregators=2
* Docs for ADIOS engine type and parameters #2866
* Aesthetic edit in adios2 engine documentation #2866
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Removed debug print statement #2866
* Style Updates
Co-authored-by: Mehta, Kshitij V <kshitij-v-mehta@github.com>
Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja>
Diffstat (limited to 'Source/Diagnostics/FlushFormats/FlushFormatOpenPMD.cpp')
-rw-r--r-- | Source/Diagnostics/FlushFormats/FlushFormatOpenPMD.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/Source/Diagnostics/FlushFormats/FlushFormatOpenPMD.cpp b/Source/Diagnostics/FlushFormats/FlushFormatOpenPMD.cpp index 401d0e184..a3f549718 100644 --- a/Source/Diagnostics/FlushFormats/FlushFormatOpenPMD.cpp +++ b/Source/Diagnostics/FlushFormats/FlushFormatOpenPMD.cpp @@ -76,10 +76,27 @@ FlushFormatOpenPMD::FlushFormatOpenPMD (const std::string& diag_name) operator_parameters.insert({k, v}); } + // ADIOS2 engine type & parameters + std::string engine_type; + pp_diag_name.query("adios2_engine.type", engine_type); + std::string const engine_prefix = diag_name + ".adios2_engine.parameters"; + ParmParse ppe; + auto eng_entr = ppe.getEntries(engine_prefix); + + std::map< std::string, std::string > engine_parameters; + auto const prefixlen = engine_prefix.size() + 1; + for (std::string k : eng_entr) { + std::string v; + ppe.get(k.c_str(), v); + k.erase(0, prefixlen); + engine_parameters.insert({k, v}); + } + auto & warpx = WarpX::GetInstance(); m_OpenPMDPlotWriter = std::make_unique<WarpXOpenPMDPlot>( encoding, openpmd_backend, operator_type, operator_parameters, + engine_type, engine_parameters, warpx.getPMLdirections() ); |