From cdf733bdd6fd13d65a3557221f4d46a7f68e51e4 Mon Sep 17 00:00:00 2001
From: pordyna
Date: Tue, 3 Mar 2026 06:43:03 -0800
Subject: [PATCH] fix restarting pmls in 2D
---
.../plugins/openPMD/restart/RestartFieldLoader.hpp | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/include/picongpu/plugins/openPMD/restart/RestartFieldLoader.hpp b/include/picongpu/plugins/openPMD/restart/RestartFieldLoader.hpp
index 1ec638d982..42b471e070 100644
--- a/include/picongpu/plugins/openPMD/restart/RestartFieldLoader.hpp
+++ b/include/picongpu/plugins/openPMD/restart/RestartFieldLoader.hpp
@@ -120,13 +120,21 @@ namespace picongpu
}
log("openPMD: (end) collect PML sizes for %1%") % objectName;
- if(auto const& extentOnDisk = mesh.begin()->second.getExtent();
- extentOnDisk != ::openPMD::Extent{1, 1, pmlTotalSize})
+
+ auto const expectedExtent = [&pmlTotalSize]()
+ {
+ if constexpr(simDim == 3u)
+ return ::openPMD::Extent{1u, 1u, pmlTotalSize};
+ else
+ return ::openPMD::Extent{1u, pmlTotalSize};
+ }();
+
+ if(auto const& extentOnDisk = mesh.begin()->second.getExtent(); extentOnDisk != expectedExtent)
{
log(
"openPMD: Skip loading for PML fields. Expecting extent %1%, found extent %2% on disk. "
"This may happen when restarting with a different domain decomposition.")
- % pmlTotalSize % extentOnDisk.at(2);
+ % pmlTotalSize % extentOnDisk.at(simDim - 1u);
return;
}