@@ -209,11 +209,15 @@ namespace picongpu
209209
210210 void checkpoint (uint32_t currentStep, std::string const & checkpointDirectory) override
211211 {
212- /*
213- * Create folder for openPMD checkpoint files.
214- * openPMD would also do it automatically, but let's keep things explicit.
215- */
216- pmacc::Filesystem::get ().createDirectoryWithPermissions (checkpointDirectory + " /" + this ->foldername );
212+ GridController<simDim>& gc = Environment<simDim>::get ().GridController ();
213+ if (gc.getGlobalRank () == 0 )
214+ {
215+ /*
216+ * Create folder for openPMD checkpoint files.
217+ * openPMD would also do it automatically, but let's keep things explicit.
218+ */
219+ pmacc::Filesystem::get ().createDirectoryWithPermissions (checkpointDirectory + " /" + this ->foldername );
220+ }
217221 auto dataSize = this ->dBufLeftParsCalorimeter ->capacityND ();
218222 HBufCalorimeter hBufLeftParsCalorimeter (dataSize);
219223 HBufCalorimeter hBufTotal (dataSize);
@@ -356,8 +360,12 @@ namespace picongpu
356360 this ->calorimeterFrameVecY ,
357361 this ->calorimeterFrameVecZ );
358362
359- /* create folder for openPMD files*/
360- pmacc::Filesystem::get ().createDirectoryWithPermissions (this ->foldername );
363+ bool const isIORank = this ->allGPU_reduce ->hasResult (mpi::reduceMethods::Reduce ());
364+ if (isIORank)
365+ {
366+ /* create folder for openPMD files*/
367+ pmacc::Filesystem::get ().createDirectoryWithPermissions (this ->foldername );
368+ }
361369
362370 // set how often the plugin should be executed while PIConGPU is running
363371 Environment<>::get ().PluginConnector ().setNotificationPeriod (this , m_help->notifyPeriod .get (m_id));
0 commit comments