SimGrid  3.13
Versatile Simulation of Distributed Systems
smx_process_private.h File Reference
#include <xbt/base.h>
#include "simgrid/simix.h"
#include "popping_private.h"

Classes

struct  s_smx_process_exit_fun
 
struct  s_smx_process_arg
 
struct  s_smx_process
 Process datatype. More...
 

Typedefs

typedef struct s_smx_process_exit_fun s_smx_process_exit_fun_t
 
typedef struct s_smx_process_exit_funsmx_process_exit_fun_t
 
typedef struct s_smx_process_arg s_smx_process_arg_t
 
typedef struct s_smx_process_argsmx_process_arg_t
 
typedef struct s_smx_process s_smx_process_t
 Process datatype. More...
 

Functions

XBT_PRIVATE smx_process_t SIMIX_process_create (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)
 Internal function to create a process. More...
 
XBT_PRIVATE void SIMIX_process_runall (void)
 Executes the processes from simix_global->process_to_run. More...
 
XBT_PRIVATE void SIMIX_process_kill (smx_process_t process, smx_process_t issuer)
 Internal function to kill a SIMIX process. More...
 
XBT_PRIVATE void SIMIX_process_killall (smx_process_t issuer, int reset_pid)
 Kills all running processes. More...
 
XBT_PRIVATE smx_process_t SIMIX_process_create_from_wrapper (smx_process_arg_t args)
 Same as SIMIX_process_create() but with only one argument (used by timers). More...
 
XBT_PRIVATE void SIMIX_process_stop (smx_process_t arg)
 Stops a process. More...
 
XBT_PRIVATE void SIMIX_process_cleanup (smx_process_t arg)
 Moves a process to the list of processes to destroy. More...
 
XBT_PRIVATE void SIMIX_process_empty_trash (void)
 Garbage collection. More...
 
XBT_PRIVATE void SIMIX_process_yield (smx_process_t self)
 Calling this function makes the process to yield. More...
 
XBT_PRIVATE xbt_running_ctx_tSIMIX_process_get_running_context (void)
 
XBT_PRIVATE void SIMIX_process_exception_terminate (xbt_ex_t *e)
 
XBT_PRIVATE void SIMIX_process_change_host (smx_process_t process, sg_host_t dest)
 
XBT_PRIVATE smx_synchro_t SIMIX_process_suspend (smx_process_t process, smx_process_t issuer)
 
XBT_PRIVATE void SIMIX_process_resume (smx_process_t process, smx_process_t issuer)
 
XBT_PRIVATE int SIMIX_process_get_PID (smx_process_t self)
 
XBT_PRIVATE int SIMIX_process_get_PPID (smx_process_t self)
 
XBT_PRIVATE voidSIMIX_process_get_data (smx_process_t process)
 
XBT_PRIVATE void SIMIX_process_set_data (smx_process_t process, void *data)
 
XBT_PRIVATE sg_host_t SIMIX_process_get_host (smx_process_t process)
 
XBT_PRIVATE const char * SIMIX_process_get_name (smx_process_t process)
 
XBT_PRIVATE smx_process_t SIMIX_process_get_by_name (const char *name)
 
XBT_PRIVATE int SIMIX_process_is_suspended (smx_process_t process)
 
XBT_PRIVATE xbt_dict_t SIMIX_process_get_properties (smx_process_t process)
 
XBT_PRIVATE smx_synchro_t SIMIX_process_join (smx_process_t issuer, smx_process_t process, double timeout)
 
XBT_PRIVATE smx_synchro_t SIMIX_process_sleep (smx_process_t process, double duration)
 
XBT_PRIVATE void SIMIX_post_process_sleep (smx_synchro_t synchro)
 
XBT_PRIVATE void SIMIX_process_sleep_suspend (smx_synchro_t synchro)
 
XBT_PRIVATE void SIMIX_process_sleep_resume (smx_synchro_t synchro)
 
XBT_PRIVATE void SIMIX_process_sleep_destroy (smx_synchro_t synchro)
 
XBT_PRIVATE void SIMIX_process_auto_restart_set (smx_process_t process, int auto_restart)
 Sets the auto-restart status of the process. More...
 
XBT_PRIVATE smx_process_t SIMIX_process_restart (smx_process_t process, smx_process_t issuer)
 Restart a process, starting it again from the beginning. More...
 
void SIMIX_segment_index_set (smx_process_t, int)
 

Variables

void(* SMPI_switch_data_segment )(int)
 

Typedef Documentation

Process datatype.

Function Documentation

XBT_PRIVATE smx_process_t SIMIX_process_create ( 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 
)

Internal function to create a process.

This function actually creates the process. It may be called when a SIMCALL_PROCESS_CREATE simcall occurs, or directly for SIMIX internal purposes. The sure thing is that it's called from maestro context.

Returns
the process created
XBT_PRIVATE void SIMIX_process_runall ( void  )

Executes the processes from simix_global->process_to_run.

The processes of simix_global->process_to_run are run (in parallel if possible). On exit, simix_global->process_to_run is empty, and simix_global->process_that_ran contains the list of processes that just ran. The two lists are swapped so, be careful when using them before and after a call to this function.

XBT_PRIVATE void SIMIX_process_kill ( smx_process_t  process,
smx_process_t  issuer 
)

Internal function to kill a SIMIX process.

This function may be called when a SIMCALL_PROCESS_KILL simcall occurs, or directly for SIMIX internal purposes.

Parameters
processpoor victim
issuerthe process which has sent the PROCESS_KILL. Important to not schedule twice the same process.
XBT_PRIVATE void SIMIX_process_killall ( smx_process_t  issuer,
int  reset_pid 
)

Kills all running processes.

Parameters
issuerthis one will not be killed
XBT_PRIVATE smx_process_t SIMIX_process_create_from_wrapper ( smx_process_arg_t  args)

Same as SIMIX_process_create() but with only one argument (used by timers).

This function frees the argument.

Returns
the process created
XBT_PRIVATE void SIMIX_process_stop ( smx_process_t  arg)

Stops a process.

Stops the process, execute all the registered on_exit functions, register it to the list of the process to restart if needed and stops its context.

XBT_PRIVATE void SIMIX_process_cleanup ( smx_process_t  arg)

Moves a process to the list of processes to destroy.

XBT_PRIVATE void SIMIX_process_empty_trash ( void  )

Garbage collection.

Should be called some time to time to free the memory allocated for processes that have finished (or killed).

XBT_PRIVATE void SIMIX_process_yield ( smx_process_t  self)

Calling this function makes the process to yield.

Only the current process can call this function, giving back the control to maestro.

Parameters
selfthe current process
XBT_PRIVATE xbt_running_ctx_t* SIMIX_process_get_running_context ( void  )
XBT_PRIVATE void SIMIX_process_exception_terminate ( xbt_ex_t e)
XBT_PRIVATE void SIMIX_process_change_host ( smx_process_t  process,
sg_host_t  dest 
)
XBT_PRIVATE smx_synchro_t SIMIX_process_suspend ( smx_process_t  process,
smx_process_t  issuer 
)
XBT_PRIVATE void SIMIX_process_resume ( smx_process_t  process,
smx_process_t  issuer 
)
XBT_PRIVATE int SIMIX_process_get_PID ( smx_process_t  self)
XBT_PRIVATE int SIMIX_process_get_PPID ( smx_process_t  self)
XBT_PRIVATE void* SIMIX_process_get_data ( smx_process_t  process)
XBT_PRIVATE void SIMIX_process_set_data ( smx_process_t  process,
void data 
)
XBT_PRIVATE sg_host_t SIMIX_process_get_host ( smx_process_t  process)
XBT_PRIVATE const char* SIMIX_process_get_name ( smx_process_t  process)
XBT_PRIVATE smx_process_t SIMIX_process_get_by_name ( const char *  name)
XBT_PRIVATE int SIMIX_process_is_suspended ( smx_process_t  process)
XBT_PRIVATE xbt_dict_t SIMIX_process_get_properties ( smx_process_t  process)
XBT_PRIVATE smx_synchro_t SIMIX_process_join ( smx_process_t  issuer,
smx_process_t  process,
double  timeout 
)
XBT_PRIVATE smx_synchro_t SIMIX_process_sleep ( smx_process_t  process,
double  duration 
)
XBT_PRIVATE void SIMIX_post_process_sleep ( smx_synchro_t  synchro)
XBT_PRIVATE void SIMIX_process_sleep_suspend ( smx_synchro_t  synchro)
XBT_PRIVATE void SIMIX_process_sleep_resume ( smx_synchro_t  synchro)
XBT_PRIVATE void SIMIX_process_sleep_destroy ( smx_synchro_t  synchro)
XBT_PRIVATE void SIMIX_process_auto_restart_set ( smx_process_t  process,
int  auto_restart 
)

Sets the auto-restart status of the process.

If set to 1, the process will be automatically restarted when its host comes back.

XBT_PRIVATE smx_process_t SIMIX_process_restart ( smx_process_t  process,
smx_process_t  issuer 
)

Restart a process, starting it again from the beginning.

void SIMIX_segment_index_set ( smx_process_t  ,
int   
)

Variable Documentation

void(* SMPI_switch_data_segment) (int)