Implemented call to clear Monte Carlo job queues when the Executive restarts.

This commit is contained in:
Pherring04 2024-04-17 12:28:29 -05:00
parent 04822023de
commit ece3c702f6
3 changed files with 31 additions and 0 deletions

View File

@ -777,6 +777,13 @@ namespace Trick {
int write(char* data, int size);
int read(char* data, int size);
/** Reset job queues for checkpoint restart
*
*
*/
void clear_job_queues();
#if 0
/**
Overload default implentation of Scheduler::add_sim_object

View File

@ -9,6 +9,9 @@
#include "trick/memorymanager_c_intf.h"
#include "trick/ScheduledJobQueue.hh"
#include "trick/Threads.hh"
#include "trick/MonteCarlo.hh"
extern Trick::MonteCarlo *the_mc;
/**
@details
@ -43,6 +46,10 @@ int Trick::Executive::restart() {
all_jobs_vector.clear() ;
all_tagged_jobs.clear() ;
if(the_mc) {
the_mc->clear_job_queues();
}
/* Create a temporary all_jobs map to use to restore job data from all_jobs_for_checkpoint */
for ( sit = sim_objects.begin() ; sit != sim_objects.end() ; sit++ ) {
for ( jit = (*sit)->jobs.begin() ; jit != (*sit)->jobs.end() ; jit++ ) {

View File

@ -0,0 +1,17 @@
#include "trick/MonteCarlo.hh"
#include "trick/message_proto.h"
#include "trick/message_type.h"
void Trick::MonteCarlo::clear_job_queues() {
master_init_queue.clear();
master_pre_queue.clear();
master_post_queue.clear();
master_shutdown_queue.clear();
slave_init_queue.clear();
slave_pre_queue.clear();
slave_post_queue.clear();
slave_shutdown_queue.clear();
}