Skip to content

Commit 3c25d76

Browse files
authored
Merge pull request #200 from EXP-code/copilot/sub-pr-198
Fix checkpoint restart file check for single-process runs
2 parents d3dc68f + a8d1f57 commit 3c25d76

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,4 @@ src/exp
2525
src/user/CylindricalDisk.cc
2626
src/user/EllipsoidForce.cc
2727
src/user/SLSphere.cc
28+
_codeql_detected_source_root

src/OutHDF5.cc

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -193,13 +193,15 @@ void OutHDF5::initialize()
193193
else {
194194
std::ostringstream fname;
195195

196-
if (chkpt)
196+
if (chkpt) {
197197
fname << outdir
198-
<< "checkpoint_" << runtag << ".1";
199-
else
198+
<< "checkpoint_" << runtag;
199+
if (numprocs>1) fname << ".1";
200+
} else {
200201
fname << outdir
201202
<< filename << "_" << setw(5) << setfill('0') << nbeg
202203
<< ".1";
204+
}
203205

204206
std::filesystem::path file_path = fname.str();
205207

0 commit comments

Comments
 (0)