SimGrid
3.13
Versatile Simulation of Distributed Systems
|
SURF Host interface class. More...
#include <HostImpl.hpp>
Public Member Functions | |
HostImpl (HostModel *model, const char *name, xbt_dynar_t storage, Cpu *cpu) | |
Host constructor. More... | |
HostImpl (HostModel *model, const char *name, lmm_constraint_t constraint, xbt_dynar_t storage, Cpu *cpu) | |
Host constructor. More... | |
~HostImpl () | |
use destroy() instead of this destructor More... | |
HostModel * | getModel () |
void | attach (simgrid::s4u::Host *host) |
bool | isOn () const override |
Check if the current Resource is active. More... | |
bool | isOff () const override |
Check if the current Resource is shut down. More... | |
void | turnOn () override |
Turn on the current Resource. More... | |
void | turnOff () override |
Turn off the current Resource. More... | |
virtual simgrid::surf::Storage * | findStorageOnMountList (const char *storage) |
Return the storage of corresponding mount point. More... | |
virtual xbt_dict_t | getMountedStorageList () |
Get the xbt_dict_t of mount_point: Storage. More... | |
virtual xbt_dynar_t | getAttachedStorageList () |
Get the xbt_dynar_t of storages attached to the Host. More... | |
virtual Action * | open (const char *fullpath) |
Open a file. More... | |
virtual Action * | close (surf_file_t fd) |
Close a file. More... | |
virtual int | unlink (surf_file_t fd) |
Unlink a file. More... | |
virtual sg_size_t | getSize (surf_file_t fd) |
Get the size in bytes of the file. More... | |
virtual Action * | read (surf_file_t fd, sg_size_t size) |
Read a file. More... | |
virtual Action * | write (surf_file_t fd, sg_size_t size) |
Write a file. More... | |
virtual xbt_dynar_t | getInfo (surf_file_t fd) |
Get the informations of a file descriptor. More... | |
virtual sg_size_t | fileTell (surf_file_t fd) |
Get the current position of the file descriptor. More... | |
virtual int | fileSeek (surf_file_t fd, sg_offset_t offset, int origin) |
Set the position indicator associated with the file descriptor to a new position. More... | |
virtual int | fileMove (surf_file_t fd, const char *fullpath) |
Move a file to another location on the same mount point. More... | |
bool | isUsed () override |
Check if the current Resource is used (if it currently serves an action) More... | |
void | apply_event (tmgr_trace_iterator_t event, double value) override |
Apply an event of external load event to that resource. More... | |
xbt_dynar_t | getVms () |
Get the list of virtual machines on the current Host. More... | |
void | getParams (vm_params_t params) |
Retrieve a copy of the parameters of that VM/PM. More... | |
void | setParams (vm_params_t params) |
Sets the params of that VM/PM. More... | |
simgrid::s4u::Host * | getHost () |
![]() | |
Resource (Model *model, const char *name) | |
Constructor of non-LMM Resources. More... | |
Resource (Model *model, const char *name, lmm_constraint_t constraint) | |
Constructor of LMM Resources. More... | |
virtual | ~Resource () |
Model * | getModel () const |
Get the Model of the current Resource. More... | |
const char * | getName () const |
Get the name of the current Resource. More... | |
bool | operator== (const Resource &other) const |
lmm_constraint_t | getConstraint () const |
Get the lmm constraint associated to this Resource if it is part of a LMM component (or null if none) More... | |
![]() | |
PropertyHolder (xbt_dict_t props) | |
~PropertyHolder () | |
const char * | getProperty (const char *id) |
Return the property associated to the provided key (or NULL if not existing) More... | |
void | setProperty (const char *id, const char *value) |
Change the value of a given key in the property set. More... | |
xbt_dict_t | getProperties () |
Return the whole set of properties. More... | |
Static Public Member Functions | |
static void | classInit () |
Public Attributes | |
xbt_dynar_t | p_storage |
Cpu * | p_cpu |
simgrid::s4u::Host * | p_host = nullptr |
Static Public Attributes | |
static simgrid::xbt::Extension< simgrid::s4u::Host, HostImpl > | EXTENSION_ID |
Additional Inherited Members | |
![]() | |
lmm_constraint_t | constraint_ = nullptr |
SURF Host interface class.
An host represents a machine with a aggregation of a Cpu, a RoutingEdge and a Storage
simgrid::surf::HostImpl::HostImpl | ( | HostModel * | model, |
const char * | name, | ||
xbt_dynar_t | storage, | ||
Cpu * | cpu | ||
) |
simgrid::surf::HostImpl::HostImpl | ( | HostModel * | model, |
const char * | name, | ||
lmm_constraint_t | constraint, | ||
xbt_dynar_t | storage, | ||
Cpu * | cpu | ||
) |
Host constructor.
simgrid::surf::HostImpl::~HostImpl | ( | ) |
use destroy() instead of this destructor
|
static |
|
inline |
void simgrid::surf::HostImpl::attach | ( | simgrid::s4u::Host * | host | ) |
|
overridevirtual |
Check if the current Resource is active.
Reimplemented from simgrid::surf::Resource.
|
overridevirtual |
Check if the current Resource is shut down.
Reimplemented from simgrid::surf::Resource.
|
overridevirtual |
Turn on the current Resource.
Reimplemented from simgrid::surf::Resource.
Reimplemented in simgrid::surf::VirtualMachine.
|
overridevirtual |
Turn off the current Resource.
Reimplemented from simgrid::surf::Resource.
Reimplemented in simgrid::surf::VirtualMachine.
|
virtual |
Return the storage of corresponding mount point.
|
virtual |
Get the xbt_dict_t of mount_point: Storage.
|
virtual |
Get the xbt_dynar_t of storages attached to the Host.
|
virtual |
Open a file.
fullpath | The full path to the file |
|
virtual |
Close a file.
fd | The file descriptor to close |
|
virtual |
Unlink a file.
[long description]
fd | [description] |
|
virtual |
Get the size in bytes of the file.
fd | The file descriptor to read |
|
virtual |
Read a file.
fd | The file descriptor to read |
size | The size in bytes to read |
|
virtual |
Write a file.
fd | The file descriptor to write |
size | The size in bytes to write |
|
virtual |
Get the informations of a file descriptor.
The returned xbt_dynar_t contains:
fd | The file descriptor |
|
virtual |
Get the current position of the file descriptor.
fd | The file descriptor |
|
virtual |
Set the position indicator associated with the file descriptor to a new position.
[long description]
fd | The file descriptor |
offset | The offset from the origin |
origin | Position used as a reference for the offset
|
|
virtual |
Move a file to another location on the same mount point.
[long description]
fd | The file descriptor |
fullpath | The new full path |
|
inlineoverridevirtual |
Check if the current Resource is used (if it currently serves an action)
Implements simgrid::surf::Resource.
|
inlineoverridevirtual |
Apply an event of external load event to that resource.
event | What happened |
value | [TODO] |
Implements simgrid::surf::Resource.
xbt_dynar_t simgrid::surf::HostImpl::getVms | ( | ) |
Get the list of virtual machines on the current Host.
void simgrid::surf::HostImpl::getParams | ( | vm_params_t | params | ) |
Retrieve a copy of the parameters of that VM/PM.
The ramsize and overcommit fields are used on the PM too
void simgrid::surf::HostImpl::setParams | ( | vm_params_t | params | ) |
Sets the params of that VM/PM.
|
inline |
|
static |
xbt_dynar_t simgrid::surf::HostImpl::p_storage |
Cpu* simgrid::surf::HostImpl::p_cpu |
simgrid::s4u::Host* simgrid::surf::HostImpl::p_host = nullptr |