SimGrid  3.8.1
Scalable Simulation of Distributed Systems - Reference Manual
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
Syscalls

System call abstraction layer. More...

Macros

#define gras_os_time()   xbt_time()
 Get the current time.
#define gras_os_sleep(sec)   xbt_sleep(sec)
 sleeps for the given amount of time.

Functions

const char * gras_os_myname (void)
 get the fully-qualified name of the current host
int gras_os_myport (void)
 returns the number on which this process is listening for incoming messages
const char * gras_os_hostport (void)
 get the uri of the current process
int gras_os_getpid (void)
 get process identification
xbt_dict_t gras_process_properties (void)
 retrieve the process properties dictionnary
const char * gras_process_property_value (const char *name)
 retrieve the value of a given process property (or NULL if not defined)
xbt_dict_t gras_os_host_properties (void)
 retrieve the host properties dictionary
const char * gras_os_host_property_value (const char *name)
 retrieve the value of a given host property (or NULL if not defined)

Detailed Description

System call abstraction layer.

Macro Definition Documentation

#define gras_os_time ( )    xbt_time()

Get the current time.

Returns
number of second since the Epoch. (00:00:00 UTC, January 1, 1970 in Real Life, and begining of simulation in SG)
#define gras_os_sleep (   sec)    xbt_sleep(sec)

sleeps for the given amount of time.

Parameters
sec,:number of seconds to sleep

Function Documentation

const char* gras_os_myname ( void  )

get the fully-qualified name of the current host

Returns the fully-qualified name of the host machine, or "localhost" if the name cannot be determined. Always returns the same value, so multiple calls cause no problems.

const char* gras_os_hostport ( void  )

get the uri of the current process

Returns the concatenation of gras_os_myname():gras_os_myport(). Please do not free the result.

int gras_os_getpid ( void  )

get process identification

Returns the process ID of the current process. (This is often used by routines that generate unique temporary file names.)

xbt_dict_t gras_process_properties ( void  )

retrieve the process properties dictionnary

Warning
it's the original one, not a copy. Don't mess with it
xbt_dict_t gras_os_host_properties ( void  )

retrieve the host properties dictionary

Warning
it's the original one, not a copy. Don't mess with it