Skip to content

Commit f28e52b

Browse files
correct bug in restore PM1 state stage 1 with -b2 setted
1 parent ad9e006 commit f28e52b

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

src/core/App.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -819,7 +819,7 @@ int App::run() {
819819
bool haveS1 = File(s1f).exists() || File(s1f + ".old").exists();
820820
bool haveS2 = File(s2f).exists() || File(s2f + ".old").exists() || File(s2f + ".new").exists();
821821

822-
if ((haveS2 || haveS1) && options.nmax == 0 && options.K == 0) {
822+
if ((haveS2) && options.nmax == 0 && options.K == 0) {
823823
std::ostringstream msg;
824824
msg << "Detected P-1 checkpoint(s): "
825825
<< (haveS2 ? "[Stage 2] " : "")
@@ -831,6 +831,14 @@ int App::run() {
831831
rc_local = runPM1Stage2Marin();
832832
ran_local = true;
833833
} else {
834+
if(haveS1){
835+
std::ostringstream msg;
836+
msg << "Detected P-1 checkpoint(s): "
837+
<< (haveS2 ? "[Stage 2] " : "")
838+
<< (haveS1 ? "[Stage 1] " : "")
839+
<< "→ jumping to Stage1()";
840+
std::cout << msg.str() << std::endl;
841+
}
834842
std::string msg = "No P-1 checkpoints found → running Stage 1 (runPM1Marin)";
835843
std::cout << msg << std::endl;
836844
if (guiServer_) { guiServer_->appendLog(msg); guiServer_->setStatus("Running P-1 Stage 1"); }

src/modes/RunPM1.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -882,10 +882,10 @@ int App::runPM1Stage2Marin() {
882882
eng->get_mpz(zh, static_cast<engine::Reg>(RSTATE));
883883
eng->get_mpz(zhq, static_cast<engine::Reg>(RACC_R));
884884
eng->get_mpz(zq, static_cast<engine::Reg>(RACC_L));
885-
std::cout << "[DEBUG S2] H=" << mpz_class(zh) << std::endl;
886-
std::cout << "[DEBUG S2] p0=" << p0.get_ui() << std::endl;
887-
std::cout << "[DEBUG S2] H^p0=" << mpz_class(zhq) << std::endl;
888-
std::cout << "[DEBUG S2] Q0=" << mpz_class(zq) << std::endl;
885+
//std::cout << "[DEBUG S2] H=" << mpz_class(zh) << std::endl;
886+
//std::cout << "[DEBUG S2] p0=" << p0.get_ui() << std::endl;
887+
//std::cout << "[DEBUG S2] H^p0=" << mpz_class(zhq) << std::endl;
888+
//std::cout << "[DEBUG S2] Q0=" << mpz_class(zq) << std::endl;
889889
mpz_clears(zh, zhq, zq, nullptr);
890890
}
891891
}

0 commit comments

Comments
 (0)