SimGrid  3.14.159
Versatile Simulation of Distributed Systems
simgrid::surf::HostImpl Class Reference

Detailed Description

SURF Host interface class.

An host represents a machine with a aggregation of a Cpu, a RoutingEdge and a Storage

#include <HostImpl.hpp>

Inheritance diagram for simgrid::surf::HostImpl:
simgrid::surf::PropertyHolder

Public Member Functions

 HostImpl (s4u::Host *host, xbt_dynar_t storage)
 
virtual ~HostImpl ()
 use destroy() instead of this destructor More...
 
virtual simgrid::surf::StoragefindStorageOnMountList (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 Actionopen (const char *fullpath)
 Open a file. More...
 
virtual Actionclose (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 Actionread (surf_file_t fd, sg_size_t size)
 Read a file. More...
 
virtual Actionwrite (surf_file_t fd, sg_size_t size)
 Write a file. More...
 
virtual xbt_dynar_t getInfo (surf_file_t fd)
 Get the information 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...
 
simgrid::s4u::HostgetHost ()
 
- Public Member Functions inherited from simgrid::surf::PropertyHolder
 PropertyHolder ()
 
 ~PropertyHolder ()
 
const char * getProperty (const char *id)
 Return the property associated to the provided key (or nullptr 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...
 

Public Attributes

xbt_dynar_t storage_ = nullptr
 
simgrid::s4u::Hostpiface_ = nullptr
 

Constructor & Destructor Documentation

◆ HostImpl()

simgrid::surf::HostImpl::HostImpl ( s4u::Host host,
xbt_dynar_t  storage 
)

◆ ~HostImpl()

simgrid::surf::HostImpl::~HostImpl ( )
virtualdefault

use destroy() instead of this destructor

Member Function Documentation

◆ findStorageOnMountList()

simgrid::surf::Storage * simgrid::surf::HostImpl::findStorageOnMountList ( const char *  storage)
virtual

Return the storage of corresponding mount point.

◆ getMountedStorageList()

xbt_dict_t simgrid::surf::HostImpl::getMountedStorageList ( )
virtual

Get the xbt_dict_t of mount_point: Storage.

◆ getAttachedStorageList()

xbt_dynar_t simgrid::surf::HostImpl::getAttachedStorageList ( )
virtual

Get the xbt_dynar_t of storages attached to the Host.

◆ open()

Action * simgrid::surf::HostImpl::open ( const char *  fullpath)
virtual

Open a file.

Parameters
fullpathThe full path to the file
Returns
The StorageAction corresponding to the opening

◆ close()

Action * simgrid::surf::HostImpl::close ( surf_file_t  fd)
virtual

Close a file.

Parameters
fdThe file descriptor to close
Returns
The StorageAction corresponding to the closing

◆ unlink()

int simgrid::surf::HostImpl::unlink ( surf_file_t  fd)
virtual

Unlink a file.

[long description]

Parameters
fd[description]
Returns
[description]

◆ getSize()

sg_size_t simgrid::surf::HostImpl::getSize ( surf_file_t  fd)
virtual

Get the size in bytes of the file.

Parameters
fdThe file descriptor to read
Returns
The size in bytes of the file

◆ read()

Action * simgrid::surf::HostImpl::read ( surf_file_t  fd,
sg_size_t  size 
)
virtual

Read a file.

Parameters
fdThe file descriptor to read
sizeThe size in bytes to read
Returns
The StorageAction corresponding to the reading

◆ write()

Action * simgrid::surf::HostImpl::write ( surf_file_t  fd,
sg_size_t  size 
)
virtual

Write a file.

Parameters
fdThe file descriptor to write
sizeThe size in bytes to write
Returns
The StorageAction corresponding to the writing

◆ getInfo()

xbt_dynar_t simgrid::surf::HostImpl::getInfo ( surf_file_t  fd)
virtual

Get the information of a file descriptor.

The returned xbt_dynar_t contains:

  • the size of the file,
  • the mount point,
  • the storage name,
  • the storage typeId,
  • the storage content type
Parameters
fdThe file descriptor
Returns
An xbt_dynar_t with the file information

◆ fileTell()

sg_size_t simgrid::surf::HostImpl::fileTell ( surf_file_t  fd)
virtual

Get the current position of the file descriptor.

Parameters
fdThe file descriptor
Returns
The current position of the file descriptor

◆ fileSeek()

int simgrid::surf::HostImpl::fileSeek ( surf_file_t  fd,
sg_offset_t  offset,
int  origin 
)
virtual

Set the position indicator associated with the file descriptor to a new position.

[long description]

Parameters
fdThe file descriptor
offsetThe offset from the origin
originPosition used as a reference for the offset
  • SEEK_SET: beginning of the file
  • SEEK_CUR: current position indicator
  • SEEK_END: end of the file
Returns
MSG_OK if successful, otherwise MSG_TASK_CANCELED

◆ fileMove()

int simgrid::surf::HostImpl::fileMove ( surf_file_t  fd,
const char *  fullpath 
)
virtual

Move a file to another location on the same mount point.

[long description]

Parameters
fdThe file descriptor
fullpathThe new full path
Returns
MSG_OK if successful, MSG_TASK_CANCELED and a warning if the new full path is not on the same mount point

◆ getHost()

simgrid::s4u::Host* simgrid::surf::HostImpl::getHost ( )
inline

Member Data Documentation

◆ storage_

xbt_dynar_t simgrid::surf::HostImpl::storage_ = nullptr

◆ piface_

simgrid::s4u::Host* simgrid::surf::HostImpl::piface_ = nullptr

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