SimGrid  3.13
Versatile Simulation of Distributed Systems
smx_global.cpp File Reference
#include <stdlib.h>
#include "src/internal_config.h"
#include "src/surf/surf_interface.hpp"
#include "src/surf/storage_interface.hpp"
#include "src/surf/xml/platf.hpp"
#include "smx_private.h"
#include "smx_private.hpp"
#include "xbt/str.h"
#include "xbt/ex.h"
#include "mc/mc.h"
#include "src/mc/mc_replay.h"
#include "simgrid/sg_config.h"
#include "src/mc/mc_record.h"
#include <signal.h>

Classes

struct  s_smx_timer
 Timer datatype. More...
 

Namespaces

 simgrid
 
 simgrid::simix
 

Typedefs

typedef struct s_smx_timer s_smx_timer_t
 Timer datatype. More...
 

Functions

 XBT_LOG_NEW_CATEGORY (simix,"All SIMIX categories")
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY (simix_kernel, simix,"Logging specific to SIMIX (kernel)")
 
static voidSIMIX_synchro_mallocator_new_f (void)
 
static void SIMIX_synchro_mallocator_free_f (void *synchro)
 
static void SIMIX_synchro_mallocator_reset_f (void *synchro)
 
static void inthandler (int ignored)
 
static void segvhandler (int signum, siginfo_t *siginfo, void *context)
 
static void install_segvhandler (void)
 Install signal handler for SIGSEGV. More...
 
double SIMIX_timer_next (void)
 
static void kill_process (smx_process_t process)
 
static void SIMIX_storage_create_ (smx_storage_t storage)
 
void simgrid::simix::set_maestro (std::function< void()> code)
 
void SIMIX_set_maestro (void(*code)(void *), void *data)
 
void SIMIX_global_init (int *argc, char **argv)
 Initialize SIMIX internal data. More...
 
void SIMIX_clean (void)
 Clean the SIMIX simulation. More...
 
double SIMIX_get_clock (void)
 A clock (in second). More...
 
static int process_syscall_color (void *p)
 
void SIMIX_run (void)
 Run the main simulation loop. More...
 
smx_timer_t SIMIX_timer_set (double date, void(*function)(void *), void *arg)
 Set the date to execute a function. More...
 
void SIMIX_timer_remove (smx_timer_t timer)
 cancels a timer that was added earlier More...
 
double SIMIX_timer_get_date (smx_timer_t timer)
 Returns the date at which the timer will trigger (or 0 if NULL timer) More...
 
void SIMIX_function_register_process_create (smx_creation_func_t function)
 Registers a function to create a process. More...
 
void SIMIX_function_register_process_kill (void_pfn_smxprocess_t function)
 Registers a function to kill a process. More...
 
void SIMIX_function_register_process_cleanup (void_pfn_smxprocess_t function)
 Registers a function to cleanup a process. More...
 
void SIMIX_display_process_status (void)
 
xbt_dict_t simcall_HANDLER_asr_get_properties (smx_simcall_t simcall, const char *name)
 
xbt_dict_t SIMIX_asr_get_properties (const char *name)
 
int SIMIX_is_maestro ()
 

Variables

smx_global_t simix_global = NULL
 
static xbt_heap_t simix_timers = NULL
 
void(* SMPI_switch_data_segment )(int) = NULL
 
int _sg_do_verbose_exit = 1
 
char sigsegv_stack [SIGSTKSZ]
 
static std::function< void()> maestro_code
 
int smx_cleaned = 0
 

Typedef Documentation

typedef struct s_smx_timer s_smx_timer_t

Timer datatype.

Function Documentation

XBT_LOG_NEW_CATEGORY ( simix  ,
"All SIMIX categories"   
)
XBT_LOG_NEW_DEFAULT_SUBCATEGORY ( simix_kernel  ,
simix  ,
"Logging specific to SIMIX (kernel)"   
)
static void * SIMIX_synchro_mallocator_new_f ( void  )
static
static void SIMIX_synchro_mallocator_free_f ( void synchro)
static
static void SIMIX_synchro_mallocator_reset_f ( void synchro)
static
static void inthandler ( int  ignored)
static
static void segvhandler ( int  signum,
siginfo_t *  siginfo,
void context 
)
static
static void install_segvhandler ( void  )
static

Install signal handler for SIGSEGV.

Check that nobody has already installed its own handler. For example, the Java VM does this.

double SIMIX_timer_next ( void  )
static void kill_process ( smx_process_t  process)
static
static void SIMIX_storage_create_ ( smx_storage_t  storage)
static
void SIMIX_set_maestro ( void(*)(void *)  code,
void data 
)
static int process_syscall_color ( void p)
static
smx_timer_t SIMIX_timer_set ( double  date,
void(*)(void *)  function,
void arg 
)

Set the date to execute a function.

Set the date to execute the function on the surf.

Parameters
dateDate to execute function
functionFunction to be executed
argParameters of the function
void SIMIX_timer_remove ( smx_timer_t  timer)

cancels a timer that was added earlier

double SIMIX_timer_get_date ( smx_timer_t  timer)

Returns the date at which the timer will trigger (or 0 if NULL timer)

void SIMIX_function_register_process_create ( smx_creation_func_t  function)

Registers a function to create a process.

This function registers a function to be called when a new process is created. The function has to call SIMIX_process_create().

Parameters
functioncreate process function
void SIMIX_function_register_process_kill ( void_pfn_smxprocess_t  function)

Registers a function to kill a process.

This function registers a function to be called when a process is killed. The function has to call the SIMIX_process_kill().

Parameters
functionKill process function
void SIMIX_function_register_process_cleanup ( void_pfn_smxprocess_t  function)

Registers a function to cleanup a process.

This function registers a user function to be called when a process ends properly.

Parameters
functioncleanup process function
void SIMIX_display_process_status ( void  )
xbt_dict_t simcall_HANDLER_asr_get_properties ( smx_simcall_t  simcall,
const char *  name 
)
xbt_dict_t SIMIX_asr_get_properties ( const char *  name)
int SIMIX_is_maestro ( )

Variable Documentation

smx_global_t simix_global = NULL
xbt_heap_t simix_timers = NULL
static
void(* SMPI_switch_data_segment) (int) = NULL
int _sg_do_verbose_exit = 1
char sigsegv_stack[SIGSTKSZ]
std::function<void()> maestro_code
static
int smx_cleaned = 0