A class that provides basic simulation methods. More...

#include <Simulation.h>

Public Member Functions

 Simulation ()
 Constructor.
 
 ~Simulation ()
 Destructor.
 
ComputeServiceadd (ComputeService *)
 Add a ComputeService to the simulation. The simulation takes ownership of the reference and will call the destructor. More...
 
StorageServiceadd (StorageService *)
 Add a StorageService to the simulation. The simulation takes ownership of the reference and will call the destructor. More...
 
NetworkProximityServiceadd (NetworkProximityService *)
 Add a NetworkProximityService to the simulation. The simulation takes ownership of the reference and will call the destructor. More...
 
WMSadd (WMS *)
 Add a WMS for the simulation. The simulation takes ownership of the reference and will call the destructor. More...
 
FileRegistryServiceadd (FileRegistryService *)
 Set a FileRegistryService for the simulation. The simulation takes ownership of the reference and will call the destructor. 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...
 
SimulationOutputgetOutput ()
 Get the simulation output object. More...
 
bool hostExists (std::string hostname)
 Check that a hostname exists in the platform. 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 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 getEnergyConsumedByHost (const std::string &hostname)
 Get the energy consumed by the host up to now. 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 getMaxPowerPossible (const std::string &hostname)
 Get the maximum power available for a host. More...
 
static double getMinPowerAvailable (const std::string &hostname)
 Get the minimum power available for a host. 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 void setPstate (const std::string &hostname, int pstate)
 Set the power state of the host. More...
 

Detailed Description

A class that provides basic simulation methods.

Member Function Documentation

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
servicea compute service
Returns
the ComputeService
Exceptions
std::invalid_argument
std::runtime_error
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
servicea storage service
Returns
the StorageService
Exceptions
std::invalid_argument
std::runtime_error
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
servicea network proximity service
Returns
the NetworkProximityService
Exceptions
std::invalid_argument
std::runtime_error
WMS * wrench::Simulation::add ( WMS wms)

Add a WMS for the simulation. The simulation takes ownership of the reference and will call the destructor.

Parameters
wmsa WMS
Returns
the WMS
Exceptions
std::invalid_argument
std::runtime_error
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_servicea file registry service
Returns
the FileRegistryService
Exceptions
std::invalid_argument
int wrench::Simulation::getCurrentPstate ( const std::string &  hostname)
static

Get the current power state of a host.

Parameters
hostnamethe host name
Returns
The index of the current pstate of the host (as specified in the platform xml description file)
double wrench::Simulation::getEnergyConsumedByHost ( const std::string &  hostname)
static

Get the energy consumed by the host up to now.

Parameters
hostnamethe host name
Returns
the energy consumed by the host in Joules
double wrench::Simulation::getHostFlopRate ( std::string  hostname)
static

Get the flop rate of one core of a host given a hostname.

Parameters
hostnamethe hostname
Returns
a flop rate (flop / sec)
double wrench::Simulation::getHostMemoryCapacity ( std::string  hostname)
static

Get the memory capacity of a host given a hostname.

Parameters
hostnamethe hostname
Returns
a memory capacity in bytes
std::vector< std::string > wrench::Simulation::getHostnameList ( )

Get the list of names of all the hosts in the platform.

Returns
a vector of hostnames
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
unsigned long wrench::Simulation::getHostNumCores ( std::string  hostname)
static

Get the number of cores of a host given a hostname.

Parameters
hostnamethe hostname
Returns
a number of cores
std::vector< int > wrench::Simulation::getListOfPstates ( const std::string &  hostname)
static

Get the list of power states available for a host.

Parameters
hostnamethe host name
Returns
a list of power states available for the host (as specified in the platform xml description file)
double wrench::Simulation::getMaxPowerPossible ( const std::string &  hostname)
static

Get the maximum power available for a host.

Parameters
hostnamethe host name
Returns
The maximum power available for the host (as specified in the platform xml description file)
double wrench::Simulation::getMinPowerAvailable ( const std::string &  hostname)
static

Get the minimum power available for a host.

Parameters
hostnamethe host name
Returns
The minimum power available for the host (as specified in the platform xml description file)
int wrench::Simulation::getNumberofPstates ( const std::string &  hostname)
static

Get the total number of power states of a host.

Parameters
hostnamethe host name
Returns
The number of power states available for the host (as specified in the platform xml description file)
SimulationOutput & wrench::Simulation::getOutput ( )

Get the simulation output object.

Returns
simulation output object
double wrench::Simulation::getTotalEnergyConsumed ( const std::vector< std::string > &  hostnames)
static

Get the total energy consumed by a set of hosts.

Parameters
thelist of hostnames
Returns
The total energy consumed by all the hosts in Joules
bool wrench::Simulation::hostExists ( std::string  hostname)

Check that a hostname exists in the platform.

Parameters
hostnamea host name
Returns
true or false
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
argcmain()'s argument count
argvmain()'s argument list
Exceptions
std::invalid_argument
void wrench::Simulation::instantiatePlatform ( std::string  filename)

Instantiate a simulated platform.

Parameters
filenamethe path to a SimGrid XML platform description file
Exceptions
std::runtime_error
void wrench::Simulation::launch ( )

Launch the simulation.

Exceptions
std::runtime_error
void wrench::Simulation::setPstate ( const std::string &  hostname,
int  pstate 
)
static

Set the power state of the host.

Parameters
hostnamethe host name
pstatethe power state index (the power state index is specified in the platform xml description file)
void wrench::Simulation::stageFile ( WorkflowFile file,
StorageService storage_service 
)

Stage a copy of a file on a storage service (to the "/" partition)

Parameters
filea file to stage on a storage service
storage_servicethe storage service
Exceptions
std::runtime_error
std::invalid_argument
void wrench::Simulation::stageFile ( WorkflowFile file,
StorageService storage_service,
std::string  partition 
)

Stage a copy of a file on a storage service.

Parameters
filea file to stage on a storage service
storage_servicethe storage service
partitionthe partition on which to store the files
Exceptions
std::runtime_error
std::invalid_argument
void wrench::Simulation::stageFiles ( std::map< std::string, WorkflowFile * >  files,
StorageService storage_service 
)

Stage file copies on a storage service (to the "/" partition)

Parameters
filesa map of files (indexed by file ids) to stage on a storage service
storage_servicethe storage service
Exceptions
std::runtime_error
std::invalid_argument
void wrench::Simulation::stageFiles ( std::map< std::string, WorkflowFile * >  files,
StorageService storage_service,
std::string  partition 
)

Stage file copies on a storage service.

Parameters
filesa map of files (indexed by file ids) to stage on a storage service
storage_servicethe storage service
partitionthe 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:
  • /home/wrench/wrench/include/wrench/simulation/Simulation.h
  • /home/wrench/wrench/src/wrench/simulation/Simulation.cpp