Skip to content

Commit

Permalink
Limit automatic freeze and re-run to when simulation is in run mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Mrockwell2 committed May 31, 2024
1 parent ac82444 commit 08ed1e2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions include/trick/CheckPointRestart.hh
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ namespace Trick {
*/
class CheckPointRestart : public Trick::Scheduler {

private:
/** Flag to track if an automatic freeze has been triggered */
bool auto_freeze = false; /* ** */

protected:
/** queue to hold jobs to be called before a checkpoint is dumped. */
Trick::ScheduledJobQueue checkpoint_queue ; /* ** */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -328,11 +328,11 @@ void Trick::CheckPointRestart::load_checkpoint(std::string file_name) {
message_publish(MSG_WARNING, msg_format.c_str(),
file_name.c_str(), simModeCharString(mode), mode);

// return;
the_exec->freeze();
auto_freeze = true;
}

load_checkpoint_file_name = file_name ;
the_exec->freeze();
}

void Trick::CheckPointRestart::load_checkpoint(std::string file_name, bool stls_on) {
Expand Down Expand Up @@ -377,7 +377,7 @@ int Trick::CheckPointRestart::load_checkpoint_job() {
message_publish(MSG_INFO, "Could not find checkpoint file %s.\n", load_checkpoint_file_name.c_str()) ;
}
load_checkpoint_file_name.clear() ;
the_exec->run();
if(auto_freeze) the_exec->run();
}

return(0) ;
Expand Down

0 comments on commit 08ed1e2

Please sign in to comment.