SimGrid  3.18
Versatile Simulation of Distributed Systems
simgrid::s4u::VirtualMachine Class Reference

Detailed Description

A VM represents a virtual machine (or a container) that hosts actors.

The total computing power that the contained actors can get is constrained to the virtual machine size.

#include <VirtualMachine.hpp>

Inheritance diagram for simgrid::s4u::VirtualMachine:
simgrid::s4u::Host simgrid::xbt::Extendable< Host >

Public Member Functions

 VirtualMachine (const char *name, s4u::Host *hostPm, int coreAmount)
 
 VirtualMachine (const char *name, s4u::Host *hostPm, int coreAmount, size_t ramsize)
 
 VirtualMachine (VirtualMachine const &)=delete
 
VirtualMachineoperator= (VirtualMachine const &)=delete
 
void start ()
 
void suspend ()
 
void resume ()
 
void shutdown ()
 
bool isMigrating ()
 
void getParameters (vm_params_t params)
 
void setParameters (vm_params_t params)
 
simgrid::s4u::HostgetPm ()
 
size_t getRamsize ()
 
void setRamsize (size_t ramsize)
 
void setBound (double bound)
 
e_surf_vm_state_t getState ()
 
- Public Member Functions inherited from simgrid::s4u::Host
 Host (const char *name)
 
void destroy ()
 Fire the required callbacks and destroy the object. More...
 
 Host (Host const &)=delete
 
Hostoperator= (Host const &)=delete
 
simgrid::xbt::string const & getName () const
 Retrieves the name of that host as a C++ string. More...
 
const char * getCname () const
 Retrieves the name of that host as a C string. More...
 
void actorList (std::vector< ActorPtr > *whereto)
 Return the list of actors attached to an host. More...
 
void turnOn ()
 Turns that host on if it was previously off. More...
 
void turnOff ()
 Turns that host off. More...
 
bool isOn ()
 Returns if that host is currently up and running. More...
 
bool isOff ()
 Returns if that host is currently down and offline. More...
 
double getSpeed ()
 Get the peak processor speed (in flops/s), at the current pstate. More...
 
int getCoreCount ()
 Returns the number of core of the processor. More...
 
std::map< std::string, std::string > * getProperties ()
 Get the properties assigned to a host. More...
 
const char * getProperty (const char *key)
 Retrieve the property value (or nullptr if not set) More...
 
void setProperty (std::string key, std::string value)
 
void getProcesses (std::vector< ActorPtr > *list)
 Get the processes attached to the host. More...
 
double getPstateSpeed (int pstate_index)
 Get the peak processor speed (in flops/s), at the specified pstate. More...
 
int getPstatesCount () const
 
void setPstate (int pstate_index)
 Set the pstate at which the host should run. More...
 
int getPstate ()
 Retrieve the pstate at which the host is currently running. More...
 
void getAttachedStorages (std::vector< const char *> *storages)
 Returns the list of storages attached to an host. More...
 
std::unordered_map< std::string, Storage * > const & getMountedStorages ()
 Get an associative list [mount point]->[Storage] of all local mount points. More...
 
void routeTo (Host *dest, std::vector< Link *> &links, double *latency)
 Find a route toward another host. More...
 
void routeTo (Host *dest, std::vector< surf::LinkImpl *> &links, double *latency)
 Just like Host::routeTo, but filling an array of link implementations. More...
 
void execute (double flops)
 Block the calling actor on an execution located on the called host. More...
 
double getLoad ()
 Returns the current computation load (in flops per second) More...
 
- Public Member Functions inherited from simgrid::xbt::Extendable< Host >
 Extendable ()
 
 ~Extendable ()
 
voidextension (std::size_t rank)
 
U * extension (Extension< Host, U > rank)
 
U * extension ()
 
void extension_set (std::size_t rank, void *value, bool use_dtor=true)
 
void extension_set (Extension< Host, U > rank, U *value, bool use_dtor=true)
 
void extension_set (U *p)
 

Public Attributes

simgrid::vm::VirtualMachineImpl * pimpl_vm_ = nullptr
 
- Public Attributes inherited from simgrid::s4u::Host
surf::HostImplpimpl_ = nullptr
 
surf::Cpupimpl_cpu = nullptr
 DO NOT USE DIRECTLY (. More...
 
kernel::routing::NetPointpimpl_netpoint = nullptr
 DO NOT USE DIRECTLY (. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from simgrid::s4u::Host
static Hostby_name_or_null (const char *name)
 Retrieves an host from its name, or return nullptr. More...
 
static Hostby_name_or_null (std::string name)
 Retrieves an host from its name, or return nullptr. More...
 
static s4u::Hostby_name (const char *name)
 Retrieves an host from its name, or die. More...
 
static s4u::Hostby_name (std::string name)
 Retrieves an host from its name, or die. More...
 
static s4u::Hostcurrent ()
 Retrieves the host on which the current actor is running. More...
 
- Static Public Member Functions inherited from simgrid::xbt::Extendable< Host >
static size_t extension_create (void(*deleter)(void *))
 
static Extension< Host, U > extension_create (void(*deleter)(void *))
 
static Extension< Host, U > extension_create ()
 
- Static Public Attributes inherited from simgrid::s4u::Host
static simgrid::xbt::signal< void(Host &)> onCreation
 
static simgrid::xbt::signal< void(Host &)> onDestruction
 
static simgrid::xbt::signal< void(Host &)> onStateChange
 
static simgrid::xbt::signal< void(Host &)> onSpeedChange
 
- Protected Member Functions inherited from simgrid::s4u::Host
virtual ~Host ()
 Host destruction logic. More...
 

Constructor & Destructor Documentation

◆ VirtualMachine() [1/3]

simgrid::s4u::VirtualMachine::VirtualMachine ( const char *  name,
s4u::Host hostPm,
int  coreAmount 
)
explicit

◆ VirtualMachine() [2/3]

simgrid::s4u::VirtualMachine::VirtualMachine ( const char *  name,
s4u::Host hostPm,
int  coreAmount,
size_t  ramsize 
)
explicit

◆ VirtualMachine() [3/3]

simgrid::s4u::VirtualMachine::VirtualMachine ( VirtualMachine const &  )
delete

Member Function Documentation

◆ operator=()

VirtualMachine& simgrid::s4u::VirtualMachine::operator= ( VirtualMachine const &  )
delete

◆ start()

void simgrid::s4u::VirtualMachine::start ( )

◆ suspend()

void simgrid::s4u::VirtualMachine::suspend ( )

◆ resume()

void simgrid::s4u::VirtualMachine::resume ( )

◆ shutdown()

void simgrid::s4u::VirtualMachine::shutdown ( )

◆ isMigrating()

bool simgrid::s4u::VirtualMachine::isMigrating ( )

◆ getParameters()

void simgrid::s4u::VirtualMachine::getParameters ( vm_params_t  params)

◆ setParameters()

void simgrid::s4u::VirtualMachine::setParameters ( vm_params_t  params)

◆ getPm()

simgrid::s4u::Host* simgrid::s4u::VirtualMachine::getPm ( )

◆ getRamsize()

size_t simgrid::s4u::VirtualMachine::getRamsize ( )

◆ setRamsize()

void simgrid::s4u::VirtualMachine::setRamsize ( size_t  ramsize)

◆ setBound()

void simgrid::s4u::VirtualMachine::setBound ( double  bound)

◆ getState()

e_surf_vm_state_t simgrid::s4u::VirtualMachine::getState ( )

Member Data Documentation

◆ pimpl_vm_

simgrid::vm::VirtualMachineImpl* simgrid::s4u::VirtualMachine::pimpl_vm_ = nullptr

The documentation for this class was generated from the following file: