A class that provides basic simulation methods. More...
#include <Simulation.h>
Public Member Functions | |
Simulation () | |
Constructor. | |
~Simulation () | |
Destructor. | |
ComputeService * | add (ComputeService *) |
Add a ComputeService to the simulation. The simulation takes ownership of the reference and will call the destructor. More... | |
StorageService * | add (StorageService *) |
Add a StorageService to the simulation. The simulation takes ownership of the reference and will call the destructor. More... | |
NetworkProximityService * | add (NetworkProximityService *) |
Add a NetworkProximityService to the simulation. The simulation takes ownership of the reference and will call the destructor. More... | |
WMS * | add (WMS *) |
Add a WMS for the simulation. The simulation takes ownership of the reference and will call the destructor. More... | |
FileRegistryService * | add (FileRegistryService *) |
Set a FileRegistryService for the simulation. The simulation takes ownership of the reference and will call the destructor. More... | |
double | getEnergyConsumed (const std::string &hostname, bool record_as_time_stamp=false) |
Obtains the current energy consumption of a host and will add SimulationTimestampEnergyConsumption to simulation output if can_record is set to true. More... | |
std::map< std::string, double > | getEnergyConsumed (const std::vector< std::string > &hostnames, bool record_as_time_stamps=false) |
Obtains the current energy consumption of a host and will add SimulationTimestampEnergyConsumption to simulation output if can_record is set to true. More... | |
std::vector< std::string > | getHostnameList () |
Get the list of names of all the hosts in the platform. More... | |
std::map< std::string, std::vector< std::string > > | getHostnameListByCluster () |
Get the list of names of all the hosts in each cluster composing the platform. More... | |
SimulationOutput & | getOutput () |
Get the simulation output object. More... | |
void | init (int *, char **) |
Initialize the simulation, which parses out WRENCH-specific and SimGrid-specific command-line arguments, if any. More... | |
void | instantiatePlatform (std::string) |
Instantiate a simulated platform. More... | |
void | launch () |
Launch the simulation. More... | |
void | setPstate (const std::string &hostname, int pstate) |
Set the power state of the host. More... | |
void | stageFile (WorkflowFile *file, StorageService *storage_service) |
Stage a copy of a file on a storage service (to the "/" partition) More... | |
void | stageFile (WorkflowFile *file, StorageService *storage_service, std::string partition) |
Stage a copy of a file on a storage service. More... | |
void | stageFiles (std::map< std::string, WorkflowFile *> files, StorageService *storage_service) |
Stage file copies on a storage service (to the "/" partition) More... | |
void | stageFiles (std::map< std::string, WorkflowFile *> files, StorageService *storage_service, std::string partition) |
Stage file copies on a storage service. More... | |
Static Public Member Functions | |
static int | getCurrentPstate (const std::string &hostname) |
Get the current power state of a host. More... | |
static double | getHostFlopRate (std::string hostname) |
Get the flop rate of one core of a host given a hostname. More... | |
static double | getHostMemoryCapacity (std::string hostname) |
Get the memory capacity of a host given a hostname. More... | |
static unsigned long | getHostNumCores (std::string hostname) |
Get the number of cores of a host given a hostname. More... | |
static std::vector< int > | getListOfPstates (const std::string &hostname) |
Get the list of power states available for a host. More... | |
static double | getMaxPowerConsumption (const std::string &hostname) |
Get the maximum power consumption for the host (i.e., 100% utilization) at its current pstate. More... | |
static double | getMinPowerConsumption (const std::string &hostname) |
Get the minimum power consumption for the host (i.e., idling) at its current pstate. More... | |
static int | getNumberofPstates (const std::string &hostname) |
Get the total number of power states of a host. More... | |
Detailed Description
A class that provides basic simulation methods.
Member Function Documentation
◆ add() [1/5]
ComputeService * wrench::Simulation::add | ( | ComputeService * | service | ) |
Add a ComputeService to the simulation. The simulation takes ownership of the reference and will call the destructor.
- Parameters
-
service a compute service
- Returns
- the ComputeService
- Exceptions
-
std::invalid_argument std::runtime_error
◆ add() [2/5]
StorageService * wrench::Simulation::add | ( | StorageService * | service | ) |
Add a StorageService to the simulation. The simulation takes ownership of the reference and will call the destructor.
- Parameters
-
service a storage service
- Returns
- the StorageService
- Exceptions
-
std::invalid_argument std::runtime_error
◆ add() [3/5]
NetworkProximityService * wrench::Simulation::add | ( | NetworkProximityService * | service | ) |
Add a NetworkProximityService to the simulation. The simulation takes ownership of the reference and will call the destructor.
- Parameters
-
service a network proximity service
- Returns
- the NetworkProximityService
- Exceptions
-
std::invalid_argument std::runtime_error
◆ add() [4/5]
◆ add() [5/5]
FileRegistryService * wrench::Simulation::add | ( | FileRegistryService * | file_registry_service | ) |
Set a FileRegistryService for the simulation. The simulation takes ownership of the reference and will call the destructor.
- Parameters
-
file_registry_service a file registry service
- Returns
- the FileRegistryService
- Exceptions
-
std::invalid_argument
◆ getCurrentPstate()
|
static |
Get the current power state of a host.
- Parameters
-
hostname the host name
- Returns
- The index of the current pstate of the host (as specified in the platform xml description file)
◆ getEnergyConsumed() [1/2]
double wrench::Simulation::getEnergyConsumed | ( | const std::string & | hostname, |
bool | record_as_time_stamp = false |
||
) |
Obtains the current energy consumption of a host and will add SimulationTimestampEnergyConsumption to simulation output if can_record is set to true.
- Parameters
-
hostname the host name record_as_time_stamp bool signaling whether or not to record a SimulationTimestampEnergyConsumption object
- Returns
- current energy consumption in joules
- Exceptions
-
std::invalid_argument
◆ getEnergyConsumed() [2/2]
std::map< std::string, double > wrench::Simulation::getEnergyConsumed | ( | const std::vector< std::string > & | hostnames, |
bool | record_as_time_stamps = false |
||
) |
Obtains the current energy consumption of a host and will add SimulationTimestampEnergyConsumption to simulation output if can_record is set to true.
- Parameters
-
hostnames the list of hostnames record_as_time_stamps whether or not to record a SimulationTimestampEnergyConsumption object for each host when this method is called
- Returns
- current energy consumption in joules for each host, as a map indexed by hostnames
- Exceptions
-
std::invalid_argument
◆ getHostFlopRate()
|
static |
Get the flop rate of one core of a host given a hostname.
- Parameters
-
hostname the hostname
- Returns
- a flop rate (flop / sec)
◆ getHostMemoryCapacity()
|
static |
Get the memory capacity of a host given a hostname.
- Parameters
-
hostname the hostname
- Returns
- a memory capacity in bytes
◆ getHostnameList()
std::vector< std::string > wrench::Simulation::getHostnameList | ( | ) |
Get the list of names of all the hosts in the platform.
- Returns
- a vector of hostnames
◆ getHostnameListByCluster()
std::map< std::string, std::vector< std::string > > wrench::Simulation::getHostnameListByCluster | ( | ) |
Get the list of names of all the hosts in each cluster composing the platform.
- Returns
- a map of lists of hosts, indexed by cluster name
◆ getHostNumCores()
|
static |
Get the number of cores of a host given a hostname.
- Parameters
-
hostname the hostname
- Returns
- a number of cores
◆ getListOfPstates()
|
static |
Get the list of power states available for a host.
- Parameters
-
hostname the host name
- Returns
- a list of power states available for the host (as specified in the platform xml description file)
◆ getMaxPowerConsumption()
|
static |
Get the maximum power consumption for the host (i.e., 100% utilization) at its current pstate.
- Parameters
-
hostname the host name
- Returns
- The "100% used" power consumption (as specified in the platform xml description file)
◆ getMinPowerConsumption()
|
static |
Get the minimum power consumption for the host (i.e., idling) at its current pstate.
- Parameters
-
hostname the host name
- Returns
- The "idling" power consumption (as specified in the platform xml description file)
◆ getNumberofPstates()
|
static |
Get the total number of power states of a host.
- Parameters
-
hostname the host name
- Returns
- The number of power states available for the host (as specified in the platform xml description file)
◆ getOutput()
SimulationOutput & wrench::Simulation::getOutput | ( | ) |
Get the simulation output object.
- Returns
- simulation output object
◆ init()
void wrench::Simulation::init | ( | int * | argc, |
char ** | argv | ||
) |
Initialize the simulation, which parses out WRENCH-specific and SimGrid-specific command-line arguments, if any.
- Parameters
-
argc main()'s argument count argv main()'s argument list
- Exceptions
-
std::invalid_argument
◆ instantiatePlatform()
void wrench::Simulation::instantiatePlatform | ( | std::string | filename | ) |
Instantiate a simulated platform.
- Parameters
-
filename the path to a SimGrid XML platform description file
- Exceptions
-
std::runtime_error
◆ launch()
void wrench::Simulation::launch | ( | ) |
Launch the simulation.
- Exceptions
-
std::runtime_error
◆ setPstate()
void wrench::Simulation::setPstate | ( | const std::string & | hostname, |
int | pstate | ||
) |
Set the power state of the host.
- Parameters
-
hostname the host name pstate the power state index (as specified in the platform xml description file)
◆ stageFile() [1/2]
void wrench::Simulation::stageFile | ( | WorkflowFile * | file, |
StorageService * | storage_service | ||
) |
Stage a copy of a file on a storage service (to the "/" partition)
- Parameters
-
file a file to stage on a storage service storage_service the storage service
- Exceptions
-
std::runtime_error std::invalid_argument
◆ stageFile() [2/2]
void wrench::Simulation::stageFile | ( | WorkflowFile * | file, |
StorageService * | storage_service, | ||
std::string | partition | ||
) |
Stage a copy of a file on a storage service.
- Parameters
-
file a file to stage on a storage service storage_service the storage service partition the partition on which to store the files
- Exceptions
-
std::runtime_error std::invalid_argument
◆ stageFiles() [1/2]
void wrench::Simulation::stageFiles | ( | std::map< std::string, WorkflowFile *> | files, |
StorageService * | storage_service | ||
) |
Stage file copies on a storage service (to the "/" partition)
- Parameters
-
files a map of files (indexed by file ids) to stage on a storage service storage_service the storage service
- Exceptions
-
std::runtime_error std::invalid_argument
◆ stageFiles() [2/2]
void wrench::Simulation::stageFiles | ( | std::map< std::string, WorkflowFile *> | files, |
StorageService * | storage_service, | ||
std::string | partition | ||
) |
Stage file copies on a storage service.
- Parameters
-
files a map of files (indexed by file ids) to stage on a storage service storage_service the storage service partition the partition on which to store the files
- Exceptions
-
std::runtime_error std::invalid_argument
The documentation for this class was generated from the following files:
- /Users/rafsilva/Documents/isi/workspace/wrench/wrench/include/wrench/simulation/Simulation.h
- /Users/rafsilva/Documents/isi/workspace/wrench/wrench/src/wrench/simulation/Simulation.cpp