WRENCH
1.11
Cyberinfrastructure Simulation Workbench
|
Overview | Installation | Getting Started | WRENCH 101 | WRENCH 102 |
Wrappers around S4U's basic simulation methods. More...
#include <S4U_Simulation.h>
Public Member Functions | |
void | checkLinkBandwidths () |
Method to check that all link bandwidths are >0. | |
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 (const std::function< void()> &creation_function) |
Initialize the simulated platform. Must only be called once. More... | |
void | setupPlatform (std::string &) |
Initialize the simulated platform. Must only be called once. 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::vector< std::string > | getAllHostnames () |
Get the list of physical hostnames. More... | |
static std::map< std::string, std::vector< std::string > > | getAllHostnamesByCluster () |
Get the by-cluster structure of the platform. More... | |
static std::vector< std::string > | getAllLinknames () |
Get the list of link names. More... | |
static double | getClock () |
Get the current simulation date. More... | |
static unsigned long | getCurrentPstate (const std::string &hostname) |
Get the current power state of a host. More... | |
static double | getDiskCapacity (std::string hostname, std::string mount_point) |
Gets the capacity of a disk attached to some host for a given mount point. More... | |
static std::vector< std::string > | getDisks (std::string hostname) |
Gets set of disks, i.e., mount points, available at 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_manager_service 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 double | getLinkBandwidth (std::string name) |
Get a link's bandwidth. More... | |
static double | getLinkUsage (std::string name) |
Get a link's bandwidth usage. 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_manager_service 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 unsigned int | getNumCores () |
Get the number of cores of the current host. More... | |
static std::vector< std::string > | getRoute (std::string &src_host, std::string &dst_host) |
Get the list of link names on the route between two hosts. More... | |
static bool | hostExists (std::string hostname) |
Determines whether a host exists for a given hostname. More... | |
static bool | hostHasMountPoint (std::string hostname, std::string mount_point) |
Determines whether a mount point is defined at a host. More... | |
static bool | isHostOn (std::string hostname) |
Returns whether a host is on or not. More... | |
static bool | isLinkOn (std::string linkname) |
Returns whether a link is on or not. More... | |
static bool | linkExists (std::string linkname) |
Determines whether a link exists for a given linkname. More... | |
static void | readFromDisk (double num_bytes, std::string hostname, std::string mount_point) |
Simulates a disk read. More... | |
static void | readFromDiskAndWriteToDiskConcurrently (double num_bytes_to_read, double num_bytes_to_write, std::string hostname, std::string read_mount_point, std::string write_mount_point) |
Read from a local disk and write to a local disk concurrently. More... | |
static void | setHostProperty (std::string hostname, std::string property_name, std::string property_value) |
Set a property associated to a host specified in the platform file. More... | |
static void | setPstate (const std::string &hostname, unsigned long pstate) |
Set the power state of the host. More... | |
static void | sleep (double) |
Simulates a sleep. More... | |
static void | turnOffHost (std::string hostname) |
Turn off a host. More... | |
static void | turnOffLink (std::string linkname) |
Turn off a link. More... | |
static void | turnOnHost (std::string hostname) |
Turn on a host. More... | |
static void | turnOnLink (std::string linkname) |
Turn on a link. More... | |
static void | writeToDisk (double num_bytes, std::string hostname, std::string mount_point) |
Simulates a disk write. More... | |
static void | yield () |
Simulates a yield. | |
Static Public Attributes | |
static constexpr double | DEFAULT_RAM = (1024.0 * 1024.0 * 1024.0 * 1024.0 * 1024.0) |
The ram capacity of a physical host whenever not specified in the platform description file. | |
Wrappers around S4U's basic simulation methods.
|
static |
Simulates a computation on host on which the calling actor is running.
flops | the number of flops |
|
static |
Get the list of physical hostnames.
|
static |
Get the by-cluster structure of the platform.
|
static |
Get the list of link names.
|
static |
Get the current simulation date.
|
static |
Get the current power state of a host.
hostname | the host name |
std::runtime_error |
|
static |
Gets the capacity of a disk attached to some host for a given mount point.
hostname | the host's name |
mount_point | the mount point (e.g., "/home") |
std::invalid_argument |
|
static |
Gets set of disks, i.e., mount points, available at a host.
hostname | the host's name |
std::invalid_argument |
|
static |
Get the energy consumed by the host up to now.
hostname | the host name |
std::invalid_argument | |
std::runtime_error |
|
static |
Get the flop rate of the current host.
std::invalid_argument |
|
static |
Get the flop rate of a host.
hostname | the name of the host |
std::invalid_argument |
|
static |
Get the memory_manager_service capacity of a host given a hostname.
hostname | the name of the host |
|
static |
Get the hostname on which the calling actor is running.
|
static |
Get the number of cores of a host.
hostname | the name of the host |
std::invalid_argument |
|
static |
Get the property associated to the host specified in the platform file.
hostname | the host name |
property_name | the property name |
|
static |
Get a link's bandwidth.
name | the link's name |
|
static |
Get a link's bandwidth usage.
name | the link's name |
|
static |
Get the list of power states available for a host.
hostname | the host name |
std::invalid_argument | |
std::runtime_error |
|
static |
Get the maximum power consumption (i.e., 100% load) for a host at its current pstate.
hostname | the host name |
std::invalid_argument | |
std::runtime_error |
|
static |
Get the memory_manager_service capacity of the current host.
|
static |
Get the minimum power consumption (i.e., idling) for a host at its current pstate.
hostname | the host name |
std::invalid_argument | |
std::runtime_error |
|
static |
Get the total number of power states of a host.
hostname | the host name |
std::invalid_argument | |
std::runtime_error |
|
static |
Get the number of cores of the current host.
|
static |
Get the list of link names on the route between two hosts.
src_host | src hostname |
dst_host | dst hostname |
|
static |
Determines whether a host exists for a given hostname.
hostname | the name of the host |
|
static |
Determines whether a mount point is defined at a host.
hostname | the host's name |
mount_point | the mount point |
void wrench::S4U_Simulation::initialize | ( | int * | argc, |
char ** | argv | ||
) |
Initialize the Simgrid simulation.
argc | the C-style argument counts |
argv | the C-style argument list |
|
static |
Returns whether a host is on or not.
hostname | the name of the host |
std::invalid_argument |
bool wrench::S4U_Simulation::isInitialized | ( | ) |
Returns true if S4U_Simulation::initialize() has been called successfully previously.
|
static |
Returns whether a link is on or not.
linkname | the name of the link |
std::invalid_argument |
bool wrench::S4U_Simulation::isPlatformSetup | ( | ) |
Returns true if S4U_Simulation::setupPlatform() has been called successfully previously.
|
static |
Determines whether a link exists for a given linkname.
linkname | the name of the link |
|
static |
Simulates a disk read.
num_bytes | number of bytes to read |
hostname | name of host to which disk is attached |
mount_point | mount point |
|
static |
Read from a local disk and write to a local disk concurrently.
num_bytes_to_read | number of bytes to read |
num_bytes_to_write | number of bytes to write |
hostname | the host at which the disks are located |
read_mount_point | the mountpoint to read from |
write_mount_point | the mountpoint to write to |
void wrench::S4U_Simulation::runSimulation | ( | ) |
Start the simulation.
std::runtime_error |
|
static |
Set a property associated to a host specified in the platform file.
hostname | the host name |
property_name | the property name |
property_value | the property value |
|
static |
Set the power state of the host.
hostname | the host name |
pstate | the power state index (the power state index is specified in the platform xml description file) |
std::invalid_argument | |
std::runtime_error |
void wrench::S4U_Simulation::setupPlatform | ( | const std::function< void()> & | creation_function | ) |
Initialize the simulated platform. Must only be called once.
creation_function | void() function to create the platform |
std::invalid_argument |
void wrench::S4U_Simulation::setupPlatform | ( | std::string & | filename | ) |
Initialize the simulated platform. Must only be called once.
filename | the path to an XML platform description file |
std::invalid_argument |
|
static |
Simulates a sleep.
duration | the number of seconds to sleep |
|
static |
Turn off a host.
hostname | the name of the host to turn off |
std::invalid_argument |
|
static |
Turn off a link.
linkname | the name of the link to turn off |
std::invalid_argument |
|
static |
Turn on a host.
hostname | the name of the host to turn on |
std::invalid_argument |
|
static |
Turn on a link.
linkname | the name of the link to turn on |
std::invalid_argument |
|
static |
Simulates a disk write.
num_bytes | number of bytes to write |
hostname | name of host to which disk is attached |
mount_point | mount point |