Wrappers around S4U's basic simulation methods. More...
#include <S4U_Simulation.h>
Public Member Functions | |
std::vector< std::string > | getAllHostnames () |
Get the list of hostnames. More... | |
void | initialize (int *argc, char **argv) |
Initialize the Simgrid simulation. More... | |
bool | isInitialized () |
Returns true if S4U_Simulation::initialize() has been called successfully previously. More... | |
bool | isPlatformSetup () |
Returns true if S4U_Simulation::setupPlatform() has been called successfully previously. More... | |
void | runSimulation () |
Start the simulation. More... | |
void | setupPlatform (std::string &) |
Initialize the simulated platform. Must only be called once. Due to the current SimGrid implementation, if the file is not readable or not correctly formatted, this method will call exit() instead of throwing an exception. More... | |
void | shutdown () |
Shutdown the simulation. | |
Static Public Member Functions | |
static void | compute (double) |
Simulates a computation on host on which the calling actor is running. More... | |
static void | computeZeroFlop () |
Compute zero flop, which take zero time but will block if the host's pstate has a zero flop/sec speed, until the host's pstate is changed to a pstate with non-zero flop/sec speed. | |
static std::map< std::string, std::vector< std::string > > | getAllHostnamesByCluster () |
Get the by-cluster structure of the platform. More... | |
static double | getClock () |
Get the current simulation date. More... | |
static int | getCurrentPstate (const std::string &hostname) |
Get the current power state of a host. More... | |
static double | getEnergyConsumedByHost (const std::string &hostname) |
Get the energy consumed by the host up to now. More... | |
static double | getFlopRate () |
Get the flop rate of the current host. More... | |
static double | getHostFlopRate (std::string hostname) |
Get the flop rate of a host. More... | |
static double | getHostMemoryCapacity (std::string hostname) |
Get the memory capacity of a host given a hostname. More... | |
static std::string | getHostName () |
Get the hostname on which the calling actor is running. More... | |
static unsigned int | getHostNumCores (std::string hostname) |
Get the number of cores of a host. More... | |
static std::string | getHostProperty (std::string hostname, std::string property_name) |
Get the property associated to the host specified in the platform file. 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 (i.e., 100% load) for a host at its current pstate. More... | |
static double | getMemoryCapacity () |
Get the memory capacity of the current host. More... | |
static double | getMinPowerConsumption (const std::string &hostname) |
Get the minimum power consumption (i.e., idling) for a host at its current pstate. More... | |
static int | getNumberofPstates (const std::string &hostname) |
Get the total number of power states of a host. More... | |
static double | getTotalEnergyConsumed (const std::vector< std::string > &hostnames) |
Get the total energy consumed by a set of hosts. More... | |
static bool | hostExists (std::string hostname) |
Determines whether a host exists for a given hostname. More... | |
static void | setPstate (const std::string &hostname, int pstate) |
Set the power state of the host. More... | |
static void | sleep (double) |
Simulates a sleep. More... | |
Detailed Description
Wrappers around S4U's basic simulation methods.
Member Function Documentation
◆ compute()
|
static |
Simulates a computation on host on which the calling actor is running.
- Parameters
-
flops the number of flops
- Exceptions
-
std::shared_ptr<HostError>
◆ getAllHostnames()
std::vector< std::string > wrench::S4U_Simulation::getAllHostnames | ( | ) |
Get the list of hostnames.
- Returns
- a vector of hostnames
◆ getAllHostnamesByCluster()
|
static |
Get the by-cluster structure of the platform.
- Returns
- a map of all cluster names and their associated hostname list
◆ getClock()
|
static |
Get the current simulation date.
- Returns
- the simulation clock
◆ 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)
- Exceptions
-
std::runtime_error
◆ getEnergyConsumedByHost()
|
static |
Get the energy consumed by the host up to now.
- Parameters
-
hostname the host name
- Returns
- the energy consumed by the host in Joules
- Exceptions
-
std::runtime_error
◆ getFlopRate()
|
static |
Get the flop rate of the current host.
- Returns
- the flop rate in floating point operations per second
- Exceptions
-
std::invalid_argument
◆ getHostFlopRate()
|
static |
Get the flop rate of a host.
- Parameters
-
hostname the name of the host
- Returns
- the flop rate in floating point operations per second
- Exceptions
-
std::invalid_argument
◆ getHostMemoryCapacity()
|
static |
Get the memory capacity of a host given a hostname.
- Parameters
-
hostname the name of the host
- Returns
- a memory capacity in bytes
◆ getHostName()
|
static |
Get the hostname on which the calling actor is running.
- Returns
- the hostname as a string
◆ getHostNumCores()
|
static |
Get the number of cores of a host.
- Parameters
-
hostname the name of the host
- Returns
- the number of cores of the host
- Exceptions
-
std::invalid_argument
◆ getHostProperty()
|
static |
Get the property associated to the host specified in the platform file.
- Returns
- a string relating to the property specified in the platform file
◆ 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)
- Exceptions
-
std::runtime_error
◆ getMaxPowerConsumption()
|
static |
Get the maximum power consumption (i.e., 100% load) for a host at its current pstate.
- Parameters
-
hostname the host name
- Returns
- The power consumption for this host if 100% used (as specified in the platform xml description file)
- Exceptions
-
std::runtime_error
◆ getMemoryCapacity()
|
static |
Get the memory capacity of the current host.
- Returns
- a memory capacity in bytes
◆ getMinPowerConsumption()
|
static |
Get the minimum power consumption (i.e., idling) for a host at its current pstate.
- Parameters
-
hostname the host name
- Returns
- The power consumption for this host if idle (as specified in the platform xml description file)
- Exceptions
-
std::runtime_error
◆ 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)
- Exceptions
-
std::runtime_error
◆ getTotalEnergyConsumed()
|
static |
Get the total energy consumed by a set of hosts.
- Parameters
-
the list of hostnames
- Returns
- The total energy consumed by all the hosts in Joules
- Exceptions
-
std::runtime_error
◆ hostExists()
|
static |
Determines whether a host exists for a given hostname.
- Parameters
-
hostname the name of the host
- Returns
- true or false
◆ initialize()
void wrench::S4U_Simulation::initialize | ( | int * | argc, |
char ** | argv | ||
) |
Initialize the Simgrid simulation.
- Parameters
-
argc the C-style argument counts argv the C-style argument list
◆ isInitialized()
bool wrench::S4U_Simulation::isInitialized | ( | ) |
Returns true if S4U_Simulation::initialize() has been called successfully previously.
- Returns
- true or false
◆ isPlatformSetup()
bool wrench::S4U_Simulation::isPlatformSetup | ( | ) |
Returns true if S4U_Simulation::setupPlatform() has been called successfully previously.
- Returns
- true or false
◆ runSimulation()
void wrench::S4U_Simulation::runSimulation | ( | ) |
Start the simulation.
- Exceptions
-
std::runtime_error
◆ setPstate()
|
static |
Set the power state of the host.
- Parameters
-
hostname the host name pstate the power state index (the power state index is specified in the platform xml description file)
- Exceptions
-
std::runtime_error
◆ setupPlatform()
void wrench::S4U_Simulation::setupPlatform | ( | std::string & | filename | ) |
Initialize the simulated platform. Must only be called once. Due to the current SimGrid implementation, if the file is not readable or not correctly formatted, this method will call exit() instead of throwing an exception.
- Parameters
-
filename the path to an XML platform description file
◆ sleep()
|
static |
Simulates a sleep.
- Parameters
-
duration the number of seconds to sleep
- Exceptions
-
std::shared_ptr<HostError>
The documentation for this class was generated from the following files:
- /Users/rafsilva/Documents/isi/workspace/wrench/wrench/include/wrench/simgrid_S4U_util/S4U_Simulation.h
- /Users/rafsilva/Documents/isi/workspace/wrench/wrench/src/wrench/simgrid_S4U_util/S4U_Simulation.cpp