A class that provides basic simulation methods. Once the simulation object has been explicitly or implicitly destroyed, then any call to the WRENCH APIs has undefied behavior (due to memory_manager_service being de-allocated).
More...
#include <Simulation.h>
A class that provides basic simulation methods. Once the simulation object has been explicitly or implicitly destroyed, then any call to the WRENCH APIs has undefied behavior (due to memory_manager_service being de-allocated).
◆ add()
template<class T >
std::shared_ptr<T> wrench::Simulation::add |
( |
T * |
t | ) |
|
|
inline |
Method to add a service to the simulation.
- Template Parameters
-
T | The service class (base class is Service) |
- Parameters
-
- Returns
- a shared_ptr to the service object
◆ addFile()
std::shared_ptr< DataFile > wrench::Simulation::addFile |
( |
std::string |
id, |
|
|
double |
size |
|
) |
| |
|
static |
Add a new file to the simulation (use at your own peril if you're using the workflow API - use Workflow::addFile() instead)
- Parameters
-
id | a unique string id |
size | a file size in bytes |
- Returns
- the DataFile instance
- Exceptions
-
◆ createSimulation()
std::shared_ptr< Simulation > wrench::Simulation::createSimulation |
( |
| ) |
|
|
static |
Create a simulation.
- Returns
- a simulation
◆ getEnergyConsumed() [1/2]
double wrench::Simulation::getEnergyConsumed |
( |
const std::string & |
hostname | ) |
|
Obtains the current energy consumption of a host.
- Parameters
-
- Returns
- current energy consumption in joules
- Exceptions
-
◆ getEnergyConsumed() [2/2]
std::map< std::string, double > wrench::Simulation::getEnergyConsumed |
( |
const std::vector< std::string > & |
hostnames | ) |
|
Obtains the current energy consumption of a host.
- Parameters
-
hostnames | the list of hostnames |
- Returns
- current energy consumption in joules for each host, as a map indexed by hostnames
- Exceptions
-
◆ getFileByID()
std::shared_ptr< DataFile > wrench::Simulation::getFileByID |
( |
const std::string & |
id | ) |
|
|
static |
Find a DataFile based on its ID.
- Parameters
-
- Returns
- the DataFile instance (or throws a std::invalid_argument if not found)
- Exceptions
-
◆ getFileMap()
std::map< std::string, std::shared_ptr< DataFile > > & wrench::Simulation::getFileMap |
( |
| ) |
|
|
static |
Get the list of all files in the simulation.
- Returns
- a reference to the map of files in the simulation, indexed by file ID
◆ getHostFlopRate()
double wrench::Simulation::getHostFlopRate |
( |
std::string |
hostname | ) |
|
|
static |
Get the flop rate of one core of a host given a hostname.
- Parameters
-
- Returns
- a flop rate (flop / sec)
◆ getHostMemoryCapacity()
double wrench::Simulation::getHostMemoryCapacity |
( |
std::string |
hostname | ) |
|
|
static |
Get the memory_manager_service capacity of a host given a hostname.
- Parameters
-
- Returns
- a memory_manager_service capacity in bytes
◆ getHostnameList()
std::vector< std::string > wrench::Simulation::getHostnameList |
( |
| ) |
|
|
static |
Get the list of names of all the physical hosts in the platform.
- Returns
- a vector of hostnames
◆ getHostnameListByCluster()
std::map< std::string, std::vector< std::string > > wrench::Simulation::getHostnameListByCluster |
( |
| ) |
|
|
static |
**
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()
unsigned long wrench::Simulation::getHostNumCores |
( |
std::string |
hostname | ) |
|
|
static |
Get the number of cores of a host given a hostname.
- Parameters
-
- Returns
- a number of cores
◆ getListOfPstates()
std::vector< int > wrench::Simulation::getListOfPstates |
( |
const std::string & |
hostname | ) |
|
|
static |
Get the list of power states available for a host.
- Parameters
-
- Returns
- a list of power states available for the host (as specified in the platform xml description file)
◆ getMaxPowerConsumption()
double wrench::Simulation::getMaxPowerConsumption |
( |
const std::string & |
hostname | ) |
|
|
static |
Get the maximum power consumption for the host (i.e., 100% utilization) at its current pstate.
- Parameters
-
- Returns
- The "100% used" power consumption (as specified in the platform xml description file)
◆ getMinPowerConsumption()
double wrench::Simulation::getMinPowerConsumption |
( |
const std::string & |
hostname | ) |
|
|
static |
Get the minimum power consumption for the host (i.e., idling) at its current pstate.
- Parameters
-
- Returns
- The "idling" power consumption (as specified in the platform xml description file)
◆ getNumberofPstates()
int wrench::Simulation::getNumberofPstates |
( |
const std::string & |
hostname | ) |
|
|
static |
Get the total number of power states of a host.
- Parameters
-
- Returns
- The number of power states available for the host (as specified in the platform xml description file)
◆ 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
-
◆ instantiatePlatform() [1/2]
void wrench::Simulation::instantiatePlatform |
( |
const std::function< void()> & |
creation_function | ) |
|
Instantiate a simulated platform.
- Parameters
-
creation_function | void() function to create the platform |
◆ instantiatePlatform() [2/2]
void wrench::Simulation::instantiatePlatform |
( |
std::string |
filename | ) |
|
Instantiate a simulated platform.
- Parameters
-
filename | the path to a SimGrid XML platform description file |
- Exceptions
-
◆ isInitialized()
bool wrench::Simulation::isInitialized |
( |
| ) |
|
|
static |
Determine if the simulation has been initialized.
- Returns
- true or false
◆ launch()
void wrench::Simulation::launch |
( |
| ) |
|
Launch the simulation.
- Exceptions
-
◆ removeFile()
void wrench::Simulation::removeFile |
( |
std::shared_ptr< DataFile > |
file | ) |
|
|
static |
Remove a file from the simulation (use at your own peril if you're using the workflow API - use Workflow::removeFile() instead)
- Parameters
-
◆ stageFile() [1/2]
void wrench::Simulation::stageFile |
( |
std::shared_ptr< DataFile > |
file, |
|
|
std::shared_ptr< StorageService > |
storage_service |
|
) |
| |
Stage a copy of a file at a storage service in the root of the (unique) mount point.
- Parameters
-
file | a file to stage on a storage service |
storage_service | a storage service |
- Exceptions
-
std::runtime_error | |
std::invalid_argument | |
◆ stageFile() [2/2]
void wrench::Simulation::stageFile |
( |
std::shared_ptr< DataFile > |
file, |
|
|
std::shared_ptr< StorageService > |
storage_service, |
|
|
std::string |
directory_absolute_path |
|
) |
| |
Stage a copy of a file at a storage service in a particular directory.
- Parameters
-
file | a file to stage on a storage service |
storage_service | a storage service |
directory_absolute_path | the absolute path of the directory where the file should be stored |
- Exceptions
-
std::runtime_error | |
std::invalid_argument | |
The documentation for this class was generated from the following files: