diff --git a/include/trick/MonteCarlo.hh b/include/trick/MonteCarlo.hh index 2fdee33f..5ce4e490 100644 --- a/include/trick/MonteCarlo.hh +++ b/include/trick/MonteCarlo.hh @@ -254,6 +254,9 @@ namespace Trick { ALL /**< report all messages (error, informational & warning) */ }; + /** Options to be passed to the slave sim. */ + std::string slave_sim_options; + private: int run_queue(Trick::ScheduledJobQueue* queue, std::string in_string) ; diff --git a/include/trick/montecarlo_c_intf.h b/include/trick/montecarlo_c_intf.h index fee6f41b..54690d47 100644 --- a/include/trick/montecarlo_c_intf.h +++ b/include/trick/montecarlo_c_intf.h @@ -95,6 +95,18 @@ unsigned int mc_get_max_tries(); */ void mc_set_user_cmd_string(const char *user_cmd_string); +/** + * @relates Trick::MonteCarlo + * set #Trick::MonteCarlo::slave_sim_options + */ +void mc_set_slave_sim_options(const char *slave_sim_options); + +/** + * @relates Trick::MonteCarlo + * get #Trick::MonteCarlo::slave_sim_options + */ +const char *mc_get_slave_sim_options(); + /** * @relates Trick::MonteCarlo * @copydoc get_user_cmd_string diff --git a/trick_source/sim_services/MonteCarlo/MonteCarlo_c_intf.cpp b/trick_source/sim_services/MonteCarlo/MonteCarlo_c_intf.cpp index e2ec025b..6d99fa02 100644 --- a/trick_source/sim_services/MonteCarlo/MonteCarlo_c_intf.cpp +++ b/trick_source/sim_services/MonteCarlo/MonteCarlo_c_intf.cpp @@ -104,6 +104,19 @@ extern "C" const char *mc_get_user_cmd_string() { return NULL ; } +extern "C" void mc_set_slave_sim_options(const char *slave_sim_options) { + if ( the_mc != NULL ) { + the_mc->slave_sim_options = std::string(slave_sim_options ? slave_sim_options : ""); + } +} + +extern "C" const char *mc_get_slave_sim_options() { + if ( the_mc != NULL ) { + return the_mc->slave_sim_options.c_str(); + } + return NULL ; +} + extern "C" void mc_set_custom_pre_text(const char *custom_pre_text) { if ( the_mc != NULL ) { the_mc->set_custom_pre_text(std::string(custom_pre_text ? custom_pre_text : "")); diff --git a/trick_source/sim_services/MonteCarlo/MonteCarlo_spawn_slaves.cpp b/trick_source/sim_services/MonteCarlo/MonteCarlo_spawn_slaves.cpp index e6b6caa4..02a796c5 100644 --- a/trick_source/sim_services/MonteCarlo/MonteCarlo_spawn_slaves.cpp +++ b/trick_source/sim_services/MonteCarlo/MonteCarlo_spawn_slaves.cpp @@ -53,6 +53,11 @@ void Trick::MonteCarlo::initialize_slave(Trick::MonteSlave* slave_to_init) { << " -O " << run_directory; buffer += ss.str(); + /**
  • Append user sim options. */ + if (!slave_sim_options.empty()) { + buffer += " " + slave_sim_options; + } + /**
  • if this is a custom slave dispatch, append the #custom_post_text. */ if (custom_slave_dispatch) { buffer += custom_post_text;