SimGrid  3.15
Versatile Simulation of Distributed Systems
msg_process.cpp File Reference

Functions

 XBT_LOG_NEW_DEFAULT_SUBCATEGORY (msg_process, msg, "Logging specific to MSG (process)")
 
void MSG_process_cleanup_from_SIMIX (smx_actor_t smx_actor)
 Cleans the MSG data of a process. More...
 
smx_actor_t MSG_process_create_from_SIMIX (const char *name, std::function< void()> code, void *data, sg_host_t host, xbt_dict_t properties, smx_actor_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...
 
msg_process_t MSG_process_create_from_stdfunc (const char *name, std::function< void()> code, void *data, msg_host_t host, xbt_dict_t properties)
 
msg_process_t MSG_process_attach (const char *name, void *data, msg_host_t host, xbt_dict_t properties)
 
void MSG_process_detach ()
 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...
 
void MSG_process_yield ()
 Yield the current actor; let the other actors execute first. 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 ()
 returns a list of all currently existing processes More...
 
int MSG_process_get_number ()
 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 ()
 Return the PID of the current process. More...
 
int MSG_process_self_PPID ()
 Return the PPID of the current process. More...
 
msg_process_t MSG_process_self ()
 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)
 Restarts a process from the beginning. More...
 
void MSG_process_daemonize (msg_process_t process)
 This process will be terminated automatically when the last non-daemon process finishes. More...
 
void MSG_process_ref (msg_process_t process)
 Take an extra reference on that process to prevent it to be garbage-collected. More...
 
void MSG_process_unref (msg_process_t process)
 Release a reference on that process so that it can get be garbage-collected. More...
 

Function Documentation

◆ XBT_LOG_NEW_DEFAULT_SUBCATEGORY()

XBT_LOG_NEW_DEFAULT_SUBCATEGORY ( msg_process  ,
msg  ,
"Logging specific to MSG (process)"   
)

◆ MSG_process_cleanup_from_SIMIX()

void MSG_process_cleanup_from_SIMIX ( smx_actor_t  smx_actor)

Cleans the MSG data of a process.

Parameters
smx_proca SIMIX process

◆ MSG_process_create_from_SIMIX()

smx_actor_t MSG_process_create_from_SIMIX ( const char *  name,
std::function< void()>  code,
void data,
sg_host_t  host,
xbt_dict_t  properties,
smx_actor_t  parent_process 
)

◆ MSG_process_create_from_stdfunc()

msg_process_t MSG_process_create_from_stdfunc ( const char *  name,
std::function< void()>  code,
void data,
msg_host_t  host,
xbt_dict_t  properties 
)

◆ MSG_process_attach()

msg_process_t MSG_process_attach ( const char *  name,
void data,
msg_host_t  host,
xbt_dict_t  properties 
)

◆ MSG_process_detach()

void MSG_process_detach ( )

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_process_join()

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

◆ MSG_process_yield()

void MSG_process_yield ( )

Yield the current actor; let the other actors execute first.

◆ MSG_processes_as_dynar()

xbt_dynar_t MSG_processes_as_dynar ( )

returns a list of all currently existing processes

◆ MSG_process_get_number()

int MSG_process_get_number ( )

Return the current number MSG processes.

◆ MSG_process_get_smx_ctx()

smx_context_t MSG_process_get_smx_ctx ( msg_process_t  process)