SimGrid  3.16
Versatile Simulation of Distributed Systems
msg_io.cpp File Reference
#include "simgrid/s4u/File.hpp"
#include "simgrid/s4u/Host.hpp"
#include "simgrid/s4u/Storage.hpp"
#include "src/msg/msg_private.h"
#include <numeric>

Functions

 XBT_LOG_NEW_DEFAULT_SUBCATEGORY (msg_io, msg, "Logging specific to MSG (io)")
 
static int MSG_host_get_file_descriptor_id (msg_host_t host)
 
static void MSG_host_release_file_descriptor_id (msg_host_t host, int id)
 
msg_error_t MSG_file_set_data (msg_file_t fd, void *data)
 Set the user data of a msg_file_t. More...
 
voidMSG_file_get_data (msg_file_t fd)
 Return the user data of a msg_file_t. More...
 
void MSG_file_dump (msg_file_t fd)
 Display information related to a file descriptor. More...
 
sg_size_t MSG_file_read (msg_file_t fd, sg_size_t size)
 Read a file (local or remote) More...
 
sg_size_t MSG_file_write (msg_file_t fd, sg_size_t size)
 Write into a file (local or remote) More...
 
msg_file_t MSG_file_open (const char *fullpath, void *data)
 Opens the file whose name is the string pointed to by path. More...
 
int MSG_file_close (msg_file_t fd)
 Close the file. More...
 
msg_error_t MSG_file_unlink (msg_file_t fd)
 Unlink the file pointed by fd. More...
 
sg_size_t MSG_file_get_size (msg_file_t fd)
 Return the size of a file. More...
 
msg_error_t MSG_file_seek (msg_file_t fd, sg_offset_t offset, int origin)
 Set the file position indicator in the msg_file_t by adding offset bytes to the position specified by origin (either SEEK_SET, SEEK_CUR, or SEEK_END). More...
 
sg_size_t MSG_file_tell (msg_file_t fd)
 Returns the current value of the position indicator of the file. More...
 
const char * MSG_file_get_name (msg_file_t fd)
 
msg_error_t MSG_file_move (msg_file_t fd, const char *fullpath)
 Move a file to another location on the same mount point. More...
 
msg_error_t MSG_file_rcopy (msg_file_t file, msg_host_t host, const char *fullpath)
 Copy a file to another location on a remote host. More...
 
msg_error_t MSG_file_rmove (msg_file_t file, msg_host_t host, const char *fullpath)
 Move a file to another location on a remote host. More...
 
const char * MSG_storage_get_name (msg_storage_t storage)
 Returns the name of the msg_storage_t. More...
 
sg_size_t MSG_storage_get_free_size (msg_storage_t storage)
 Returns the free space size of a storage element. More...
 
sg_size_t MSG_storage_get_used_size (msg_storage_t storage)
 Returns the used space size of a storage element. More...
 
xbt_dict_t MSG_storage_get_properties (msg_storage_t storage)
 Returns a xbt_dict_t consisting of the list of properties assigned to this storage. More...
 
void MSG_storage_set_property_value (msg_storage_t storage, const char *name, char *value)
 Change the value of a given storage property. More...
 
const char * MSG_storage_get_property_value (msg_storage_t storage, const char *name)
 Returns the value of a given storage property. More...
 
msg_storage_t MSG_storage_get_by_name (const char *name)
 Finds a msg_storage_t using its name. More...
 
xbt_dynar_t MSG_storages_as_dynar ()
 Returns a dynar containing all the storage elements declared at a given point of time. More...
 
msg_error_t MSG_storage_set_data (msg_storage_t storage, void *data)
 Set the user data of a msg_storage_t. More...
 
voidMSG_storage_get_data (msg_storage_t storage)
 Returns the user data of a msg_storage_t. More...
 
xbt_dict_t MSG_storage_get_content (msg_storage_t storage)
 Returns the content (file list) of a msg_storage_t. More...
 
sg_size_t MSG_storage_get_size (msg_storage_t storage)
 Returns the size of a msg_storage_t. More...
 
const char * MSG_storage_get_host (msg_storage_t storage)
 Returns the host name the storage is attached to. More...
 

Function Documentation

◆ XBT_LOG_NEW_DEFAULT_SUBCATEGORY()

XBT_LOG_NEW_DEFAULT_SUBCATEGORY ( msg_io  ,
msg  ,
"Logging specific to MSG (io)"   
)

◆ MSG_host_get_file_descriptor_id()

static int MSG_host_get_file_descriptor_id ( msg_host_t  host)
static

◆ MSG_host_release_file_descriptor_id()

static void MSG_host_release_file_descriptor_id ( msg_host_t  host,
int  id 
)
static

◆ MSG_file_get_name()

const char* MSG_file_get_name ( msg_file_t  fd)

◆ MSG_storage_get_property_value()

const char* MSG_storage_get_property_value ( msg_storage_t  storage,
const char *  name 
)

Returns the value of a given storage property.

Parameters
storagea storage
namea property name
Returns
value of a property (or nullptr if property not set)