SimGrid  3.21
Versatile Simulation of Distributed Systems
simix.h File Reference
#include <simgrid/forward.h>
#include <simgrid/host.h>
#include <xbt/ex.h>
#include <xbt/parmap.h>
#include <functional>
#include <string>
#include <unordered_map>
#include <vector>

Typedefs

typedef struct s_smx_sem_t * smx_sem_t
 
typedef void(* void_pfn_smxprocess_t) (smx_actor_t)
 
typedef struct s_smx_timer_t * smx_timer_t
 

Enumerations

enum  smx_process_exit_status_t { SMX_EXIT_SUCCESS = 0, SMX_EXIT_FAILURE = 1 }
 
enum  e_smx_state_t {
  SIMIX_WAITING, SIMIX_READY, SIMIX_RUNNING, SIMIX_DONE,
  SIMIX_CANCELED, SIMIX_FAILED, SIMIX_SRC_HOST_FAILURE, SIMIX_DST_HOST_FAILURE,
  SIMIX_TIMEOUT, SIMIX_SRC_TIMEOUT, SIMIX_DST_TIMEOUT, SIMIX_LINK_FAILURE
}
 Host datatypeA location (or host) is any possible place where a process may run. More...
 

Functions

smx_actor_t SIMIX_process_from_PID (aid_t PID)
 
int SIMIX_context_is_parallel ()
 
int SIMIX_context_get_nthreads ()
 
void SIMIX_context_set_nthreads (int nb_threads)
 
int SIMIX_context_get_parallel_threshold ()
 
void SIMIX_context_set_parallel_threshold (int threshold)
 
e_xbt_parmap_mode_t SIMIX_context_get_parallel_mode ()
 
void SIMIX_context_set_parallel_mode (e_xbt_parmap_mode_t mode)
 
int SIMIX_is_maestro ()
 
void SIMIX_global_init (int *argc, char **argv)
 
void SIMIX_set_maestro (void(*code)(void *), void *data)
 
void SIMIX_function_register_process_cleanup (void_pfn_smxprocess_t function)
 
void SIMIX_function_register_process_kill (void_pfn_smxprocess_t function)
 
void SIMIX_run ()
 
double SIMIX_get_clock ()
 
smx_timer_t SIMIX_timer_set (double date, void(*function)(void *), void *arg)
 
void SIMIX_timer_remove (smx_timer_t timer)
 
double SIMIX_timer_next ()
 
double SIMIX_timer_get_date (smx_timer_t timer)
 
void SIMIX_display_process_status ()
 
void SIMIX_create_environment (const char *file)
 
void SIMIX_create_environment (std::string file)
 
void SIMIX_function_register (const char *name, xbt_main_func_t code)
 
void SIMIX_launch_application (const char *file)
 
void SIMIX_function_register_default (xbt_main_func_t code)
 
void SIMIX_init_application ()
 
void SIMIX_process_set_function (const char *process_host, const char *process_function, xbt_dynar_t arguments, double process_start_time, double process_kill_time)
 
void SIMIX_function_register (std::string name, void(*code)(std::vector< std::string >))
 
void SIMIX_function_register (std::string name, xbt_main_func_t code)
 
void SIMIX_launch_application (std::string file)
 
void SIMIX_maestro_create (void(*code)(void *), void *data)
 
smx_actor_t SIMIX_process_attach (const char *name, void *data, const char *hostname, std::unordered_map< std::string, std::string > *properties, smx_actor_t parent_process)
 
void SIMIX_process_detach ()
 
int SIMIX_process_count ()
 
smx_actor_t SIMIX_process_self ()
 
const char * SIMIX_process_self_get_name ()
 
void SIMIX_process_self_set_data (void *data)
 
void * SIMIX_process_self_get_data ()
 
int SIMIX_process_has_pending_comms (smx_actor_t process)
 
void SIMIX_process_on_exit_runall (smx_actor_t process)
 
void SIMIX_process_on_exit (smx_actor_t process, int_f_pvoid_pvoid_t fun, void *data)
 
void SIMIX_process_on_exit (smx_actor_t process, std::function< void(int, void *)> fun, void *data)
 
void SIMIX_comm_set_copy_data_callback (void(*callback)(smx_activity_t, void *, size_t))
 
void SIMIX_comm_copy_pointer_callback (smx_activity_t comm, void *buff, size_t buff_size)
 
void SIMIX_comm_copy_buffer_callback (smx_activity_t comm, void *buff, size_t buff_size)
 
void SIMIX_comm_finish (smx_activity_t synchro)
 
smx_activity_t simcall_execution_start (std::string name, std::string category, double flops_amount, double priority, double bound, sg_host_t host)
 
smx_activity_t simcall_execution_parallel_start (std::string name, int host_nb, sg_host_t *host_list, double *flops_amount, double *bytes_amount, double rate, double timeout)
 
void simcall_execution_cancel (smx_activity_t execution)
 
void simcall_execution_set_priority (smx_activity_t execution, double priority)
 
void simcall_execution_set_bound (smx_activity_t execution, double bound)
 
e_smx_state_t simcall_execution_wait (smx_activity_t execution)
 
e_smx_state_t simcall_execution_test (smx_activity_t execution)
 
smx_actor_t simcall_process_create (std::string name, xbt_main_func_t code, void *data, sg_host_t host, int argc, char **argv, std::unordered_map< std::string, std::string > *properties)
 
void SIMIX_process_throw (smx_actor_t process, xbt_errcat_t cat, int value, const char *mesg)
 
void simcall_process_suspend (smx_actor_t process)
 
void simcall_process_set_data (smx_actor_t process, void *data)
 
void simcall_process_set_kill_time (smx_actor_t process, double kill_time)
 
void simcall_process_join (smx_actor_t process, double timeout)
 
e_smx_state_t simcall_process_sleep (double duration)
 
void simcall_comm_send (smx_actor_t sender, smx_mailbox_t mbox, double task_size, double rate, void *src_buff, size_t src_buff_size, int(*match_fun)(void *, void *, simgrid::kernel::activity::CommImpl *), void(*copy_data_fun)(smx_activity_t, void *, size_t), void *data, double timeout)
 
smx_activity_t simcall_comm_isend (smx_actor_t sender, smx_mailbox_t mbox, double task_size, double rate, void *src_buff, size_t src_buff_size, int(*match_fun)(void *, void *, simgrid::kernel::activity::CommImpl *), void(*clean_fun)(void *), void(*copy_data_fun)(smx_activity_t, void *, size_t), void *data, int detached)
 
void simcall_comm_recv (smx_actor_t receiver, smx_mailbox_t mbox, void *dst_buff, size_t *dst_buff_size, int(*match_fun)(void *, void *, simgrid::kernel::activity::CommImpl *), void(*copy_data_fun)(smx_activity_t, void *, size_t), void *data, double timeout, double rate)
 
smx_activity_t simcall_comm_irecv (smx_actor_t receiver, smx_mailbox_t mbox, void *dst_buff, size_t *dst_buff_size, int(*match_fun)(void *, void *, simgrid::kernel::activity::CommImpl *), void(*copy_data_fun)(smx_activity_t, void *, size_t), void *data, double rate)
 
smx_activity_t simcall_comm_iprobe (smx_mailbox_t mbox, int type, int(*match_fun)(void *, void *, simgrid::kernel::activity::CommImpl *), void *data)
 
void simcall_comm_cancel (smx_activity_t comm)
 
unsigned int simcall_comm_waitany (xbt_dynar_t comms, double timeout)
 
void simcall_comm_wait (smx_activity_t comm, double timeout)
 
int simcall_comm_test (smx_activity_t comm)
 
int simcall_comm_testany (smx_activity_t *comms, size_t count)
 
void simcall_set_category (smx_activity_t synchro, std::string category)
 
smx_mutex_t simcall_mutex_init ()
 
smx_mutex_t SIMIX_mutex_ref (smx_mutex_t mutex)
 
void SIMIX_mutex_unref (smx_mutex_t mutex)
 
void simcall_mutex_lock (smx_mutex_t mutex)
 
int simcall_mutex_trylock (smx_mutex_t mutex)
 
void simcall_mutex_unlock (smx_mutex_t mutex)
 
smx_cond_t simcall_cond_init ()
 
void simcall_cond_wait (smx_cond_t cond, smx_mutex_t mutex)
 
int simcall_cond_wait_timeout (smx_cond_t cond, smx_mutex_t mutex, double max_duration)
 
void SIMIX_sem_destroy (smx_sem_t sem)
 
void simcall_sem_acquire (smx_sem_t sem)
 
int simcall_sem_acquire_timeout (smx_sem_t sem, double max_duration)
 
e_smx_state_t simcall_io_wait (smx_activity_t io)
 
int simcall_mc_random (int min, int max)
 

Variables

unsigned smx_context_stack_size
 
int smx_context_stack_size_was_set
 
unsigned smx_context_guard_size
 
int smx_context_guard_size_was_set
 

Typedef Documentation

◆ smx_sem_t

typedef struct s_smx_sem_t* smx_sem_t

◆ void_pfn_smxprocess_t

typedef void(* void_pfn_smxprocess_t) (smx_actor_t)

◆ smx_timer_t

typedef struct s_smx_timer_t* smx_timer_t

Enumeration Type Documentation

◆ e_smx_state_t

Host datatypeA location (or host) is any possible place where a process may run.

Thus it is represented as a physical resource with computing capabilities, some mailboxes to enable running process to communicate with remote ones, and some private data that can be only accessed by local process.

See also
m_host_management
Enumerator
SIMIX_WAITING 
SIMIX_READY 
SIMIX_RUNNING 
SIMIX_DONE 
SIMIX_CANCELED 
SIMIX_FAILED 
SIMIX_SRC_HOST_FAILURE 
SIMIX_DST_HOST_FAILURE 
SIMIX_TIMEOUT 
SIMIX_SRC_TIMEOUT 
SIMIX_DST_TIMEOUT 
SIMIX_LINK_FAILURE 

◆ smx_process_exit_status_t

Enumerator
SMX_EXIT_SUCCESS 
SMX_EXIT_FAILURE 

Function Documentation

◆ SIMIX_process_from_PID()

smx_actor_t SIMIX_process_from_PID ( aid_t  PID)

◆ SIMIX_context_is_parallel()

int SIMIX_context_is_parallel ( )

◆ SIMIX_context_get_nthreads()

int SIMIX_context_get_nthreads ( )

◆ SIMIX_context_set_nthreads()

void SIMIX_context_set_nthreads ( int  nb_threads)

◆ SIMIX_context_get_parallel_threshold()

int SIMIX_context_get_parallel_threshold ( )

◆ SIMIX_context_set_parallel_threshold()

void SIMIX_context_set_parallel_threshold ( int  threshold)

◆ SIMIX_context_get_parallel_mode()

e_xbt_parmap_mode_t SIMIX_context_get_parallel_mode ( )

◆ SIMIX_context_set_parallel_mode()

void SIMIX_context_set_parallel_mode ( e_xbt_parmap_mode_t  mode)

◆ SIMIX_is_maestro()

int SIMIX_is_maestro ( )

◆ SIMIX_global_init()

void SIMIX_global_init ( int *  argc,
char **  argv 
)

◆ SIMIX_set_maestro()

void SIMIX_set_maestro ( void(*)(void *)  code,
void *  data 
)

◆ SIMIX_function_register_process_cleanup()

void SIMIX_function_register_process_cleanup ( void_pfn_smxprocess_t  function)

◆ SIMIX_function_register_process_kill()

void SIMIX_function_register_process_kill ( void_pfn_smxprocess_t  function)

◆ SIMIX_run()

void SIMIX_run ( )

◆ SIMIX_get_clock()

double SIMIX_get_clock ( )

◆ SIMIX_timer_set()

smx_timer_t SIMIX_timer_set ( double  date,
void(*)(void *)  function,
void *  arg 
)

◆ SIMIX_timer_remove()

void SIMIX_timer_remove ( smx_timer_t  timer)

◆ SIMIX_timer_next()

double SIMIX_timer_next ( )

◆ SIMIX_timer_get_date()

double SIMIX_timer_get_date ( smx_timer_t  timer)

◆ SIMIX_display_process_status()

void SIMIX_display_process_status ( )

◆ SIMIX_create_environment() [1/2]

void SIMIX_create_environment ( const char *  file)

◆ SIMIX_create_environment() [2/2]

void SIMIX_create_environment ( std::string  file)

◆ SIMIX_function_register() [1/3]

void SIMIX_function_register ( const char *  name,
xbt_main_func_t  code 
)

◆ SIMIX_launch_application() [1/2]

void SIMIX_launch_application ( const char *  file)

◆ SIMIX_function_register_default()

void SIMIX_function_register_default ( xbt_main_func_t  code)

◆ SIMIX_init_application()

void SIMIX_init_application ( )

◆ SIMIX_process_set_function()

void SIMIX_process_set_function ( const char *  process_host,
const char *  process_function,
xbt_dynar_t  arguments,
double  process_start_time,
double  process_kill_time 
)

◆ SIMIX_function_register() [2/3]

void SIMIX_function_register ( std::string  name,
void(*)(std::vector< std::string >)  code 
)

◆ SIMIX_function_register() [3/3]

void SIMIX_function_register ( std::string  name,
xbt_main_func_t  code 
)

◆ SIMIX_launch_application() [2/2]

void SIMIX_launch_application ( std::string  file)

◆ SIMIX_maestro_create()

void SIMIX_maestro_create ( void(*)(void *)  code,
void *  data 
)

◆ SIMIX_process_attach()

smx_actor_t SIMIX_process_attach ( const char *  name,
void *  data,
const char *  hostname,
std::unordered_map< std::string, std::string > *  properties,
smx_actor_t  parent_process 
)

◆ SIMIX_process_detach()

void SIMIX_process_detach ( )

◆ SIMIX_process_count()

int SIMIX_process_count ( )

◆ SIMIX_process_self()

smx_actor_t SIMIX_process_self ( )

◆ SIMIX_process_self_get_name()

const char* SIMIX_process_self_get_name ( )

◆ SIMIX_process_self_set_data()

void SIMIX_process_self_set_data ( void *  data)

◆ SIMIX_process_self_get_data()

void* SIMIX_process_self_get_data ( )

◆ SIMIX_process_has_pending_comms()

int SIMIX_process_has_pending_comms ( smx_actor_t  process)

◆ SIMIX_process_on_exit_runall()

void SIMIX_process_on_exit_runall ( smx_actor_t  process)

◆ SIMIX_process_on_exit() [1/2]

void SIMIX_process_on_exit ( smx_actor_t  process,
int_f_pvoid_pvoid_t  fun,
void *  data 
)

◆ SIMIX_process_on_exit() [2/2]

void SIMIX_process_on_exit ( smx_actor_t  process,
std::function< void(int, void *)>  fun,
void *  data 
)

◆ SIMIX_comm_set_copy_data_callback()

void SIMIX_comm_set_copy_data_callback ( void(*)(smx_activity_t, void *, size_t)  callback)

◆ SIMIX_comm_copy_pointer_callback()

void SIMIX_comm_copy_pointer_callback ( smx_activity_t  comm,
void *  buff,
size_t  buff_size 
)

◆ SIMIX_comm_copy_buffer_callback()

void SIMIX_comm_copy_buffer_callback ( smx_activity_t  comm,
void *  buff,
size_t  buff_size 
)

◆ SIMIX_comm_finish()

void SIMIX_comm_finish ( smx_activity_t  synchro)

◆ simcall_execution_start()

smx_activity_t simcall_execution_start ( std::string  name,
std::string  category,
double  flops_amount,
double  priority,
double  bound,
sg_host_t  host 
)

◆ simcall_execution_parallel_start()

smx_activity_t simcall_execution_parallel_start ( std::string  name,
int  host_nb,
sg_host_t *  host_list,
double *  flops_amount,
double *  bytes_amount,
double  rate,
double  timeout 
)

◆ simcall_execution_cancel()

void simcall_execution_cancel ( smx_activity_t  execution)

◆ simcall_execution_set_priority()

void simcall_execution_set_priority ( smx_activity_t  execution,
double  priority 
)

◆ simcall_execution_set_bound()

void simcall_execution_set_bound ( smx_activity_t  execution,
double  bound 
)

◆ simcall_execution_wait()

e_smx_state_t simcall_execution_wait ( smx_activity_t  execution)

◆ simcall_execution_test()

e_smx_state_t simcall_execution_test ( smx_activity_t  execution)

◆ simcall_process_create()

smx_actor_t simcall_process_create ( std::string  name,
xbt_main_func_t  code,
void *  data,
sg_host_t  host,
int  argc,
char **  argv,
std::unordered_map< std::string, std::string > *  properties 
)

◆ SIMIX_process_throw()

void SIMIX_process_throw ( smx_actor_t  process,
xbt_errcat_t  cat,
int  value,
const char *  mesg 
)

◆ simcall_process_suspend()

void simcall_process_suspend ( smx_actor_t  process)

◆ simcall_process_set_data()

void simcall_process_set_data ( smx_actor_t  process,
void *  data 
)

◆ simcall_process_set_kill_time()

void simcall_process_set_kill_time ( smx_actor_t  process,
double  kill_time 
)

◆ simcall_process_join()

void simcall_process_join ( smx_actor_t  process,
double  timeout 
)

◆ simcall_process_sleep()

e_smx_state_t simcall_process_sleep ( double  duration)

◆ simcall_comm_send()

void simcall_comm_send ( smx_actor_t  sender,
smx_mailbox_t  mbox,
double  task_size,
double  rate,
void *  src_buff,
size_t  src_buff_size,
int(*)(void *, void *, simgrid::kernel::activity::CommImpl *)  match_fun,
void(*)(smx_activity_t, void *, size_t)  copy_data_fun,
void *  data,
double  timeout 
)

◆ simcall_comm_isend()

smx_activity_t simcall_comm_isend ( smx_actor_t  sender,
smx_mailbox_t  mbox,
double  task_size,
double  rate,
void *  src_buff,
size_t  src_buff_size,
int(*)(void *, void *, simgrid::kernel::activity::CommImpl *)  match_fun,
void(*)(void *)  clean_fun,
void(*)(smx_activity_t, void *, size_t)  copy_data_fun,
void *  data,
int  detached 
)

◆ simcall_comm_recv()

void simcall_comm_recv ( smx_actor_t  receiver,
smx_mailbox_t  mbox,
void *  dst_buff,
size_t *  dst_buff_size,
int(*)(void *, void *, simgrid::kernel::activity::CommImpl *)  match_fun,
void(*)(smx_activity_t, void *, size_t)  copy_data_fun,
void *  data,
double  timeout,
double  rate 
)

◆ simcall_comm_irecv()

smx_activity_t simcall_comm_irecv ( smx_actor_t  receiver,
smx_mailbox_t  mbox,
void *  dst_buff,
size_t *  dst_buff_size,
int(*)(void *, void *, simgrid::kernel::activity::CommImpl *)  match_fun,
void(*)(smx_activity_t, void *, size_t)  copy_data_fun,
void *  data,
double  rate 
)

◆ simcall_comm_iprobe()

smx_activity_t simcall_comm_iprobe ( smx_mailbox_t  mbox,
int  type,
int(*)(void *, void *, simgrid::kernel::activity::CommImpl *)  match_fun,
void *  data 
)

◆ simcall_comm_cancel()

void simcall_comm_cancel ( smx_activity_t  comm)

◆ simcall_comm_waitany()

unsigned int simcall_comm_waitany ( xbt_dynar_t  comms,
double  timeout 
)

◆ simcall_comm_wait()

void simcall_comm_wait ( smx_activity_t  comm,
double  timeout 
)

◆ simcall_comm_test()

int simcall_comm_test ( smx_activity_t  comm)

◆ simcall_comm_testany()

int simcall_comm_testany ( smx_activity_t *  comms,
size_t  count 
)

◆ simcall_set_category()

void simcall_set_category ( smx_activity_t  synchro,
std::string  category 
)

◆ simcall_mutex_init()

smx_mutex_t simcall_mutex_init ( )

◆ SIMIX_mutex_ref()

smx_mutex_t SIMIX_mutex_ref ( smx_mutex_t  mutex)

◆ SIMIX_mutex_unref()

void SIMIX_mutex_unref ( smx_mutex_t  mutex)

◆ simcall_mutex_lock()

void simcall_mutex_lock ( smx_mutex_t  mutex)

◆ simcall_mutex_trylock()

int simcall_mutex_trylock ( smx_mutex_t  mutex)

◆ simcall_mutex_unlock()

void simcall_mutex_unlock ( smx_mutex_t  mutex)

◆ simcall_cond_init()

smx_cond_t simcall_cond_init ( )

◆ simcall_cond_wait()

void simcall_cond_wait ( smx_cond_t  cond,
smx_mutex_t  mutex 
)

◆ simcall_cond_wait_timeout()

int simcall_cond_wait_timeout ( smx_cond_t  cond,
smx_mutex_t  mutex,
double  max_duration 
)

◆ SIMIX_sem_destroy()

void SIMIX_sem_destroy ( smx_sem_t  sem)

◆ simcall_sem_acquire()

void simcall_sem_acquire ( smx_sem_t  sem)

◆ simcall_sem_acquire_timeout()

int simcall_sem_acquire_timeout ( smx_sem_t  sem,
double  max_duration 
)

◆ simcall_io_wait()

e_smx_state_t simcall_io_wait ( smx_activity_t  io)

◆ simcall_mc_random()

int simcall_mc_random ( int  min,
int  max 
)

Variable Documentation

◆ smx_context_stack_size

unsigned smx_context_stack_size

◆ smx_context_stack_size_was_set

int smx_context_stack_size_was_set

◆ smx_context_guard_size

unsigned smx_context_guard_size

◆ smx_context_guard_size_was_set

int smx_context_guard_size_was_set