SimGrid  3.13
Versatile Simulation of Distributed Systems
msg_process.cpp File Reference
#include "msg_private.h"
#include "xbt/sysdep.h"
#include "xbt/log.h"
#include "src/simix/smx_process_private.h"
#include "src/simix/smx_private.h"

Functions

 XBT_LOG_NEW_DEFAULT_SUBCATEGORY (msg_process, msg,"Logging specific to MSG (process)")
 
void MSG_process_cleanup_from_SIMIX (smx_process_t smx_proc)
 Cleans the MSG data of a process. More...
 
smx_process_t MSG_process_create_from_SIMIX (const char *name, xbt_main_func_t code, void *data, const char *hostname, double kill_time, int argc, char **argv, xbt_dict_t properties, int auto_restart, smx_process_t parent_process)
 
msg_process_t MSG_process_create (const char *name, xbt_main_func_t code, void *data, msg_host_t host)
 Creates and runs a new msg_process_t. More...
 
msg_process_t MSG_process_create_with_arguments (const char *name, xbt_main_func_t code, void *data, msg_host_t host, int argc, char **argv)
 Creates and runs a new msg_process_t. More...
 
msg_process_t MSG_process_create_with_environment (const char *name, xbt_main_func_t code, void *data, msg_host_t host, int argc, char **argv, xbt_dict_t properties)
 Creates and runs a new msg_process_t. More...
 
static int MSG_maestro (int argc, char **argv)
 
msg_process_t MSG_process_attach (const char *name, void *data, msg_host_t host, xbt_dict_t properties)
 
void MSG_process_detach (void)
 Detach a process attached with MSG_process_attach() More...
 
void MSG_process_kill (msg_process_t process)
 
msg_error_t MSG_process_join (msg_process_t process, double timeout)
 Wait for the completion of a msg_process_t. More...
 
msg_error_t MSG_process_migrate (msg_process_t process, msg_host_t host)
 Migrates a process to another location. More...
 
voidMSG_process_get_data (msg_process_t process)
 Returns the user data of a process. More...
 
msg_error_t MSG_process_set_data (msg_process_t process, void *data)
 Sets the user data of a process. More...
 
void MSG_process_set_data_cleanup (void_f_pvoid_t data_cleanup)
 Sets a cleanup function to be called to free the userdata of a process when a process is destroyed. More...
 
msg_host_t MSG_process_get_host (msg_process_t process)
 Return the location on which a process is running. More...
 
msg_process_t MSG_process_from_PID (int PID)
 Return a msg_process_t given its PID. More...
 
xbt_dynar_t MSG_processes_as_dynar (void)
 returns a list of all currently existing processes More...
 
int MSG_process_get_number (void)
 Return the current number MSG processes. More...
 
msg_error_t MSG_process_set_kill_time (msg_process_t process, double kill_time)
 Set the kill time of a process. More...
 
int MSG_process_get_PID (msg_process_t process)
 Returns the process ID of process. More...
 
int MSG_process_get_PPID (msg_process_t process)
 Returns the process ID of the parent of process. More...
 
const char * MSG_process_get_name (msg_process_t process)
 Return the name of a process. More...
 
const char * MSG_process_get_property_value (msg_process_t process, const char *name)
 Returns the value of a given process property. More...
 
xbt_dict_t MSG_process_get_properties (msg_process_t process)
 Return the list of properties. More...
 
int MSG_process_self_PID (void)
 Return the PID of the current process. More...
 
int MSG_process_self_PPID (void)
 Return the PPID of the current process. More...
 
msg_process_t MSG_process_self (void)
 Return the current process. More...
 
msg_error_t MSG_process_suspend (msg_process_t process)
 Suspend the process. More...
 
msg_error_t MSG_process_resume (msg_process_t process)
 Resume a suspended process. More...
 
int MSG_process_is_suspended (msg_process_t process)
 Returns true if the process is suspended . More...
 
smx_context_t MSG_process_get_smx_ctx (msg_process_t process)
 
void MSG_process_on_exit (int_f_pvoid_pvoid_t fun, void *data)
 Add a function to the list of "on_exit" functions for the current process. More...
 
void MSG_process_auto_restart_set (msg_process_t process, int auto_restart)
 Sets the "auto-restart" flag of the process. More...
 
msg_process_t MSG_process_restart (msg_process_t process)
 

Function Documentation

XBT_LOG_NEW_DEFAULT_SUBCATEGORY ( msg_process  ,
msg  ,
"Logging specific to MSG (process)"   
)
void MSG_process_cleanup_from_SIMIX ( smx_process_t  smx_proc)

Cleans the MSG data of a process.

Parameters
smx_proca SIMIX process
smx_process_t MSG_process_create_from_SIMIX ( const char *  name,
xbt_main_func_t  code,
void data,
const char *  hostname,
double  kill_time,
int  argc,
char **  argv,
xbt_dict_t  properties,
int  auto_restart,
smx_process_t  parent_process 
)
static int MSG_maestro ( int  argc,
char **  argv 
)
static
msg_process_t MSG_process_attach ( const char *  name,
void data,
msg_host_t  host,
xbt_dict_t  properties 
)
void MSG_process_detach ( void  )

Detach a process attached with MSG_process_attach()

This is called when the current process has finished its job. Used in the main thread, it waits for the simulation to finish before returning. When it returns, the other simulated processes and the maestro are destroyed.

msg_error_t MSG_process_join ( msg_process_t  process,
double  timeout 
)

Wait for the completion of a msg_process_t.

Parameters
processthe process to wait for
timeoutwait until the process is over, or the timeout occurs
xbt_dynar_t MSG_processes_as_dynar ( void  )

returns a list of all currently existing processes

int MSG_process_get_number ( void  )

Return the current number MSG processes.

smx_context_t MSG_process_get_smx_ctx ( msg_process_t  process)
msg_process_t MSG_process_restart ( msg_process_t  process)