From cddac0b380b3608626b99d64ba9082676cbc6e0e Mon Sep 17 00:00:00 2001 From: "Martin D. Weinberg" Date: Sun, 1 Feb 2026 11:07:46 -0500 Subject: [PATCH 1/7] Implement restarting checkpoint directories in OutHDF5 --- src/OutHDF5.cc | 70 +++++++++++++++++++++++++++++++------------------- 1 file changed, 43 insertions(+), 27 deletions(-) diff --git a/src/OutHDF5.cc b/src/OutHDF5.cc index 9c28459ed..dd2f3ee75 100644 --- a/src/OutHDF5.cc +++ b/src/OutHDF5.cc @@ -175,8 +175,13 @@ void OutHDF5::initialize() // if (directory) { std::ostringstream dname; - dname << outdir - << filename << "_" << setw(5) << setfill('0') << nbeg; + + if (chkpt) + dname << outdir + << "checkpoint_" << runtag; + else + dname << outdir + << filename << "_" << setw(5) << setfill('0') << nbeg; std::filesystem::path dir_path = dname.str(); @@ -187,9 +192,14 @@ void OutHDF5::initialize() } else { std::ostringstream fname; - fname << outdir - << filename << "_" << setw(5) << setfill('0') << nbeg - << ".1"; + + if (chkpt) + fname << outdir + << "checkpoint_" << runtag << ".1"; + else + fname << outdir + << filename << "_" << setw(5) << setfill('0') << nbeg + << ".1"; std::filesystem::path file_path = fname.str(); @@ -200,31 +210,37 @@ void OutHDF5::initialize() // Find starting index // - for (; nbeg<100000; nbeg++) { - // Path name - // - std::ostringstream fname; - fname << outdir - << filename << "_" << setw(5) << setfill('0') << nbeg; - - if (not directory) fname << ".1"; - - std::filesystem::path path = fname.str(); - - // See if we can open the directory or file - // - if (directory) { - if (not std::filesystem::is_directory(path)) break; - } else - if (not std::filesystem::is_regular_file(path)) break; + if (not chkpt) { + for (; nbeg<100000; nbeg++) { + // Path name + // + std::ostringstream fname; + if (chkpt) + fname << outdir + << "checkpoint_" << runtag; + else + fname << outdir + << filename << "_" << setw(5) << setfill('0') << nbeg; + + if (not directory) fname << ".1"; + + std::filesystem::path path = fname.str(); + + // See if we can open the directory or file + // + if (directory) { + if (not std::filesystem::is_directory(path)) break; + } else + if (not std::filesystem::is_regular_file(path)) break; + } + + std::cout << "---- OutHDF5: found last file <" << nbeg << ">" << std::endl; } - std::cout << "---- OutHDF5: found last file <" << nbeg << ">" << std::endl; + // Communicate starting file index to all nodes + // + MPI_Bcast(&nbeg, 1, MPI_INT, 0, MPI_COMM_WORLD); } - - // Communicate starting file index to all nodes - // - MPI_Bcast(&nbeg, 1, MPI_INT, 0, MPI_COMM_WORLD); } return; From 1967a881860bf0135630ff1ed491dbcb6dbfc769 Mon Sep 17 00:00:00 2001 From: "Martin D. Weinberg" Date: Sun, 1 Feb 2026 15:09:11 -0500 Subject: [PATCH 2/7] Mistakenly misordered MPI reduction for OutHDF5 restart --- src/OutHDF5.cc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/OutHDF5.cc b/src/OutHDF5.cc index dd2f3ee75..3d3e9a74a 100644 --- a/src/OutHDF5.cc +++ b/src/OutHDF5.cc @@ -236,11 +236,13 @@ void OutHDF5::initialize() std::cout << "---- OutHDF5: found last file <" << nbeg << ">" << std::endl; } - - // Communicate starting file index to all nodes - // - MPI_Bcast(&nbeg, 1, MPI_INT, 0, MPI_COMM_WORLD); + // END: snapshot mode loop } + // END: root node read + + // Communicate starting file index to all nodes for snapshot mode + // + if (not chkpt) MPI_Bcast(&nbeg, 1, MPI_INT, 0, MPI_COMM_WORLD); } return; From 492a404d7b2522311bea7963bb6a65f0aae0fa15 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 4 Feb 2026 14:50:14 +0000 Subject: [PATCH 3/7] Initial plan From d3dc68fbfdc2a566f7cb53ddca49897e5efd9974 Mon Sep 17 00:00:00 2001 From: Martin Weinberg Date: Wed, 4 Feb 2026 09:50:57 -0500 Subject: [PATCH 4/7] Update src/OutHDF5.cc Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- src/OutHDF5.cc | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/OutHDF5.cc b/src/OutHDF5.cc index 3d3e9a74a..5c65a4562 100644 --- a/src/OutHDF5.cc +++ b/src/OutHDF5.cc @@ -215,12 +215,8 @@ void OutHDF5::initialize() // Path name // std::ostringstream fname; - if (chkpt) - fname << outdir - << "checkpoint_" << runtag; - else - fname << outdir - << filename << "_" << setw(5) << setfill('0') << nbeg; + fname << outdir + << filename << "_" << setw(5) << setfill('0') << nbeg; if (not directory) fname << ".1"; From 8678f4b55933311dd70307eb4574868efe0b6048 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 4 Feb 2026 14:52:21 +0000 Subject: [PATCH 5/7] Fix checkpoint restart file check to match Run() logic Co-authored-by: The9Cat <25960766+The9Cat@users.noreply.github.com> --- src/OutHDF5.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/OutHDF5.cc b/src/OutHDF5.cc index 3d3e9a74a..7259adcaa 100644 --- a/src/OutHDF5.cc +++ b/src/OutHDF5.cc @@ -193,13 +193,15 @@ void OutHDF5::initialize() else { std::ostringstream fname; - if (chkpt) + if (chkpt) { fname << outdir - << "checkpoint_" << runtag << ".1"; - else + << "checkpoint_" << runtag; + if (numprocs>1) fname << ".1"; + } else { fname << outdir << filename << "_" << setw(5) << setfill('0') << nbeg << ".1"; + } std::filesystem::path file_path = fname.str(); From 71c9bb30bae20bfff3379b6b4a9a6355fc076c57 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 4 Feb 2026 14:53:16 +0000 Subject: [PATCH 6/7] Complete checkpoint restart fix Co-authored-by: The9Cat <25960766+The9Cat@users.noreply.github.com> --- _codeql_detected_source_root | 1 + 1 file changed, 1 insertion(+) create mode 120000 _codeql_detected_source_root diff --git a/_codeql_detected_source_root b/_codeql_detected_source_root new file mode 120000 index 000000000..945c9b46d --- /dev/null +++ b/_codeql_detected_source_root @@ -0,0 +1 @@ +. \ No newline at end of file From a8d1f57575984dfd05ae0bbacaccd0517c6f6646 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 4 Feb 2026 14:53:32 +0000 Subject: [PATCH 7/7] Remove CodeQL artifact and update gitignore Co-authored-by: The9Cat <25960766+The9Cat@users.noreply.github.com> --- .gitignore | 1 + _codeql_detected_source_root | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) delete mode 120000 _codeql_detected_source_root diff --git a/.gitignore b/.gitignore index 319d66928..9f36e853c 100644 --- a/.gitignore +++ b/.gitignore @@ -25,3 +25,4 @@ src/exp src/user/CylindricalDisk.cc src/user/EllipsoidForce.cc src/user/SLSphere.cc +_codeql_detected_source_root diff --git a/_codeql_detected_source_root b/_codeql_detected_source_root deleted file mode 120000 index 945c9b46d..000000000 --- a/_codeql_detected_source_root +++ /dev/null @@ -1 +0,0 @@ -. \ No newline at end of file