From b0023bf07c40fc2a8d5ac433a5e42aacb3441fb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franz=20P=C3=B6schel?= Date: Tue, 3 Jan 2023 13:06:07 +0100 Subject: [PATCH] Write attributes as early as possible in openPMD plugin --- include/picongpu/plugins/openPMD/openPMDWriter.hpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/include/picongpu/plugins/openPMD/openPMDWriter.hpp b/include/picongpu/plugins/openPMD/openPMDWriter.hpp index 13df4c9cbf..1900383c6e 100644 --- a/include/picongpu/plugins/openPMD/openPMDWriter.hpp +++ b/include/picongpu/plugins/openPMD/openPMDWriter.hpp @@ -1524,6 +1524,13 @@ make sure that environment variable OPENPMD_BP_BACKEND is not set to ADIOS1. threadParams->openSeries(::openPMD::Access::CREATE); } + /* attributes written here are pure meta data */ + WriteMeta writeMetaAttributes; + writeMetaAttributes( + *threadParams->openPMDSeries, + (*threadParams->openPMDSeries).writeIterations()[threadParams->currentStep], + threadParams->currentStep); + bool dumpAllParticles = plugins::misc::containsObject(vectorOfDataSourceNames, "species_all"); /* write fields */ @@ -1602,13 +1609,6 @@ make sure that environment variable OPENPMD_BP_BACKEND is not set to ADIOS1. writeIdProviderStartId(*threadParams, idProviderState.startId, idProviderState.maxNumProc); writeIdProviderNextId(*threadParams, idProviderState.nextId); - /* attributes written here are pure meta data */ - WriteMeta writeMetaAttributes; - writeMetaAttributes( - *threadParams->openPMDSeries, - (*threadParams->openPMDSeries).writeIterations()[threadParams->currentStep], - threadParams->currentStep); - // avoid deadlock between not finished pmacc tasks and mpi calls in // openPMD __getTransactionEvent().waitForFinished();