Stride Reference Manual  1.0
stride::run::Runner Class Reference

Helper for parsing the config, and starting the simulators. More...

#include <Runner.h>

Collaboration diagram for stride::run::Runner:
Collaboration graph

Public Member Functions

 Runner (const std::vector< std::string > &overrides_list, const std::string &config_file, const RunMode &mode, int timestep)
 
void printInfo ()
 
void initSimulators ()
 
void run ()
 
boost::property_tree::ptree getConfig ()
 
boost::property_tree::ptree getRegionsConfig (const std::vector< string > &names)
 
void write (std::ostream &out, const boost::property_tree::ptree &)
 

Static Public Member Functions

static void setup ()
 

Private Member Functions

void parseConfig ()
 
void initOutputs (Simulator &sim)
 
std::shared_ptr< SimulatoraddLocalSimulator (const string &name, const boost::property_tree::ptree &config)
 
std::shared_ptr< AsyncSimulatoraddRemoteSimulator (const string &name, const boost::property_tree::ptree &config)
 
void initMpi ()
 
void makeSetupStruct ()
 
boost::filesystem::path hdf5Path (const string &name)
 

Private Attributes

std::map< std::string, std::string > m_overrides
 
std::string m_config_file
 
RunMode m_mode
 
bool m_uses_mpi = false
 
bool m_is_master = true
 
int m_timestep
 
int m_world_rank
 
int m_world_size
 
shared_ptr< RemoteSimulatorReceiverm_local_receiver
 
thread m_listen_thread
 
string m_processor_name
 
boost::bimap< string, int > m_worldranks
 
boost::property_tree::ptree m_config
 
std::map< std::string, boost::property_tree::ptree > m_region_configs
 
std::vector< std::string > m_region_order
 
std::map< std::string, shared_ptr< Simulator > > m_local_simulators
 
std::map< std::string, shared_ptr< AsyncSimulator > > m_async_simulators
 
std::shared_ptr< Coordinatorm_coord
 
std::string m_name
 
boost::filesystem::path m_output_dir
 
std::string m_travel_schedule
 
std::map< std::string, std::shared_ptr< Hdf5Saver > > m_hdf5_savers
 
std::map< std::string, std::shared_ptr< ClusterSaver > > m_vis_savers
 

Detailed Description

Helper for parsing the config, and starting the simulators.

Definition at line 39 of file Runner.h.

Constructor & Destructor Documentation

Runner::Runner ( const std::vector< std::string > &  overrides_list,
const std::string &  config_file,
const RunMode mode,
int  timestep 
)

Member Function Documentation

void Runner::setup ( )
static

Definition at line 27 of file Runner.cpp.

Referenced by initMpi().

void Runner::printInfo ( )

Definition at line 79 of file Runner.cpp.

References m_name, and m_region_configs.

Referenced by main().

pt::ptree Runner::getConfig ( )

Definition at line 407 of file Runner.cpp.

References getRegionsConfig(), and m_region_order.

pt::ptree Runner::getRegionsConfig ( const std::vector< string > &  names)

Definition at line 411 of file Runner.cpp.

References m_config, and m_region_configs.

Referenced by getConfig(), and initSimulators().

void stride::run::Runner::write ( std::ostream &  out,
const boost::property_tree::ptree &   
)
void Runner::parseConfig ( )
private

Definition at line 49 of file Runner.cpp.

References m_config, m_config_file, m_name, m_overrides, m_region_configs, m_region_order, and m_travel_schedule.

Referenced by Runner().

shared_ptr< Simulator > Runner::addLocalSimulator ( const string &  name,
const boost::property_tree::ptree &  config 
)
private
shared_ptr< AsyncSimulator > Runner::addRemoteSimulator ( const string &  name,
const boost::property_tree::ptree &  config 
)
private

Definition at line 275 of file Runner.cpp.

References m_async_simulators.

Referenced by initSimulators().

void Runner::initMpi ( )
private
void Runner::makeSetupStruct ( )
private

Definition at line 260 of file Runner.cpp.

Referenced by initMpi().

fs::path Runner::hdf5Path ( const string &  name)
private

Definition at line 421 of file Runner.cpp.

References m_output_dir.

Referenced by addLocalSimulator(), and initOutputs().

Member Data Documentation

std::map<std::string, std::string> stride::run::Runner::m_overrides
private

Definition at line 73 of file Runner.h.

Referenced by parseConfig(), and Runner().

std::string stride::run::Runner::m_config_file
private

Definition at line 74 of file Runner.h.

Referenced by parseConfig().

RunMode stride::run::Runner::m_mode
private

Definition at line 75 of file Runner.h.

Referenced by addLocalSimulator(), initOutputs(), and run().

bool stride::run::Runner::m_uses_mpi = false
private

Definition at line 76 of file Runner.h.

Referenced by initMpi(), initSimulators(), and run().

bool stride::run::Runner::m_is_master = true
private

Definition at line 77 of file Runner.h.

Referenced by initMpi(), initSimulators(), and run().

int stride::run::Runner::m_timestep
private

Definition at line 78 of file Runner.h.

Referenced by addLocalSimulator(), initOutputs(), and run().

int stride::run::Runner::m_world_rank
private

Definition at line 81 of file Runner.h.

Referenced by initMpi(), initSimulators(), and run().

int stride::run::Runner::m_world_size
private

Definition at line 82 of file Runner.h.

Referenced by initMpi(), and run().

shared_ptr<RemoteSimulatorReceiver> stride::run::Runner::m_local_receiver
private

Definition at line 83 of file Runner.h.

thread stride::run::Runner::m_listen_thread
private

Definition at line 84 of file Runner.h.

Referenced by run().

string stride::run::Runner::m_processor_name
private

Definition at line 85 of file Runner.h.

Referenced by initMpi(), and run().

boost::bimap<string, int> stride::run::Runner::m_worldranks
private

Definition at line 86 of file Runner.h.

Referenced by initMpi().

boost::property_tree::ptree stride::run::Runner::m_config
private

Definition at line 91 of file Runner.h.

Referenced by getRegionsConfig(), initOutputs(), initSimulators(), parseConfig(), and run().

std::map<std::string, boost::property_tree::ptree> stride::run::Runner::m_region_configs
private

Definition at line 92 of file Runner.h.

Referenced by getRegionsConfig(), initMpi(), initSimulators(), parseConfig(), printInfo(), and run().

std::vector<std::string> stride::run::Runner::m_region_order
private

Definition at line 93 of file Runner.h.

Referenced by getConfig(), and parseConfig().

std::map<std::string, shared_ptr<Simulator> > stride::run::Runner::m_local_simulators
private

Definition at line 95 of file Runner.h.

Referenced by addLocalSimulator(), initSimulators(), and run().

std::map<std::string, shared_ptr<AsyncSimulator> > stride::run::Runner::m_async_simulators
private

Definition at line 97 of file Runner.h.

Referenced by addLocalSimulator(), addRemoteSimulator(), initSimulators(), and run().

std::shared_ptr<Coordinator> stride::run::Runner::m_coord
private

Definition at line 98 of file Runner.h.

Referenced by initSimulators(), and run().

std::string stride::run::Runner::m_name
private

Definition at line 101 of file Runner.h.

Referenced by initSimulators(), parseConfig(), printInfo(), and Runner().

boost::filesystem::path stride::run::Runner::m_output_dir
private

Definition at line 102 of file Runner.h.

Referenced by hdf5Path(), initOutputs(), run(), and Runner().

std::string stride::run::Runner::m_travel_schedule
private

Definition at line 103 of file Runner.h.

Referenced by initSimulators(), and parseConfig().

std::map<std::string, std::shared_ptr<Hdf5Saver> > stride::run::Runner::m_hdf5_savers
private

Definition at line 105 of file Runner.h.

Referenced by initOutputs().

std::map<std::string, std::shared_ptr<ClusterSaver> > stride::run::Runner::m_vis_savers
private

Definition at line 106 of file Runner.h.

Referenced by initOutputs().


The documentation for this class was generated from the following files: