From 36916088d19c7661ec0ea9ce528a28d170f59bf6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franz=20P=C3=B6schel?= Date: Thu, 15 Dec 2022 15:49:51 +0100 Subject: [PATCH] Don't actually keep the checkpointing file open --- include/picongpu/plugins/radiation/Radiation.hpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/include/picongpu/plugins/radiation/Radiation.hpp b/include/picongpu/plugins/radiation/Radiation.hpp index f07155b42b..966cba0e8d 100644 --- a/include/picongpu/plugins/radiation/Radiation.hpp +++ b/include/picongpu/plugins/radiation/Radiation.hpp @@ -143,8 +143,7 @@ namespace picongpu mpi::MPIReduce reduce; static const int numberMeshRecords = 3; - std::optional<::openPMD::Series> m_outputSeries; - std::optional<::openPMD::Series> m_checkpointSeries; + std::optional<::openPMD::Series> m_series; std::string openPMDSuffix = "_%T_0_0_0." + openPMD::getDefaultExtension(openPMD::ExtensionPreference::HDF5); std::string openPMDConfig = "{}"; @@ -283,11 +282,16 @@ namespace picongpu // write backup file if(isMaster) { + /* + * No need to keep the Series open for checkpointing, so + * just quickly open it here. + */ + std::optional<::openPMD::Series> tmp; writeOpenPMDfile( tmp_result, restartDirectory, speciesName + std::string("_radRestart"), - m_checkpointSeries); + tmp); } } @@ -542,7 +546,7 @@ namespace picongpu timeSumArray, std::string("radiationOpenPMD/"), speciesName + std::string("_radAmplitudes"), - m_outputSeries); + m_series); } } @@ -669,7 +673,9 @@ namespace picongpu * * Arguments: * Amplitude* values - array of complex amplitude values - * std::string name - path and beginning of file name to store data to + * std::string const & path - directory for data storage + * std::string const & name - file name to store data to + * std::optional<::openPMD::Series>& series - Series to be used, maybe already initialized */ void writeOpenPMDfile( std::vector& values,