Add ability to pass options to slave sims

Refs #395
This commit is contained in:
Derek Bankieris 2017-03-20 10:46:10 -05:00
parent 73cbbd96cd
commit 47847a8aef
4 changed files with 33 additions and 0 deletions

View File

@ -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) ;

View File

@ -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

View File

@ -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 : ""));

View File

@ -53,6 +53,11 @@ void Trick::MonteCarlo::initialize_slave(Trick::MonteSlave* slave_to_init) {
<< " -O " << run_directory;
buffer += ss.str();
/** <li> Append user sim options. */
if (!slave_sim_options.empty()) {
buffer += " " + slave_sim_options;
}
/** <li> if this is a custom slave dispatch, append the #custom_post_text. */
if (custom_slave_dispatch) {
buffer += custom_post_text;