SimGrid  3.13
Versatile Simulation of Distributed Systems
smx_private.h File Reference
#include "src/internal_config.h"
#include "simgrid/simix.h"
#include "surf/surf.h"
#include "xbt/base.h"
#include "xbt/fifo.h"
#include "xbt/swag.h"
#include "xbt/dict.h"
#include "xbt/mallocator.h"
#include "xbt/config.h"
#include "xbt/xbt_os_time.h"
#include "xbt/function_types.h"
#include "src/xbt/ex_interface.h"
#include "src/instr/instr_private.h"
#include "smx_process_private.h"
#include "smx_host_private.h"
#include "smx_io_private.h"
#include "smx_network_private.h"
#include "popping_private.h"
#include "smx_synchro_private.h"
#include <signal.h>

Classes

struct  s_smx_global
 
struct  s_smx_file
 
struct  s_smx_synchro
 synchro datatype More...
 

Macros

#define SMX_EXCEPTION(issuer, cat, val, msg)
 Ask to the provided simix process to raise the provided exception. More...
 
#define SMX_THROW()   RETHROW
 
#define smx_context_usable_stack_size   smx_context_stack_size
 

Typedefs

typedef struct s_smx_context_factory * smx_context_factory_t
 
typedef struct s_smx_global s_smx_global_t
 
typedef struct s_smx_globalsmx_global_t
 
typedef struct s_smx_file s_smx_file_t
 
typedef struct s_smx_synchro s_smx_synchro_t
 synchro datatype More...
 

Enumerations

enum  e_smx_synchro_type_t {
  SIMIX_SYNC_EXECUTE, SIMIX_SYNC_PARALLEL_EXECUTE, SIMIX_SYNC_COMMUNICATE, SIMIX_SYNC_JOIN,
  SIMIX_SYNC_SLEEP, SIMIX_SYNC_SYNCHRO, SIMIX_SYNC_IO
}
 
enum  e_smx_comm_type_t { SIMIX_COMM_SEND, SIMIX_COMM_RECEIVE, SIMIX_COMM_READY, SIMIX_COMM_DONE }
 
enum  e_smx_io_type_t { SIMIX_IO_OPEN, SIMIX_IO_WRITE, SIMIX_IO_READ, SIMIX_IO_STAT }
 

Functions

void SIMIX_clean (void)
 Clean the SIMIX simulation. More...
 
XBT_PRIVATE void SIMIX_context_mod_init (void)
 This function is called by SIMIX_global_init() to initialize the context module. More...
 
XBT_PRIVATE void SIMIX_context_mod_exit (void)
 This function is called by SIMIX_clean() to finalize the context module. More...
 
XBT_PRIVATE smx_context_t SIMIX_context_new (xbt_main_func_t code, int argc, char **argv, void_pfn_smxprocess_t cleanup_func, smx_process_t simix_process)
 creates a new context for a user level process More...
 
XBT_PRIVATE voidSIMIX_context_stack_new (void)
 
XBT_PRIVATE void SIMIX_context_stack_delete (void *stack)
 
XBT_PRIVATE void SIMIX_context_set_current (smx_context_t context)
 Sets the current context of this thread. More...
 
XBT_PRIVATE smx_context_t SIMIX_context_get_current (void)
 Returns the current context of this thread. More...
 
int SIMIX_process_get_maxpid (void)
 
XBT_PRIVATE void SIMIX_post_create_environment (void)
 
XBT_PRIVATE void SIMIX_process_set_cleanup_function (smx_process_t process, void_pfn_smxprocess_t cleanup)
 

Variables

smx_global_t simix_global
 
XBT_PRIVATE unsigned long simix_process_maxpid
 
char sigsegv_stack [SIGSTKSZ]
 

Macro Definition Documentation

#define SMX_EXCEPTION (   issuer,
  cat,
  val,
  msg 
)
Value:
if (1) { \
smx_process_t _smx_throw_issuer = (issuer); /* evaluate only once */\
THROW_PREPARE(_smx_throw_issuer->running_ctx, (cat), (val), xbt_strdup(msg)); \
_smx_throw_issuer->doexception = 1; \
} else ((void)0)
struct s_smx_process * smx_process_t
Process datatypeA process may be defined as a code, with some private data, executing in a location...
Definition: simix.h:105
#define THROW_PREPARE(_throw_ctx, c, v, m)
Helper macro for THROW and THROWF.
Definition: ex.h:429
static XBT_ALWAYS_INLINE char * xbt_strdup(const char *s)
Like strdup, but xbt_die() on error.
Definition: sysdep.h:64

Ask to the provided simix process to raise the provided exception.

#define SMX_THROW ( )    RETHROW
#define smx_context_usable_stack_size   smx_context_stack_size

Typedef Documentation

typedef struct s_smx_context_factory* smx_context_factory_t
typedef struct s_smx_global s_smx_global_t
typedef struct s_smx_global * smx_global_t
typedef struct s_smx_file s_smx_file_t

synchro datatype

Enumeration Type Documentation

Enumerator
SIMIX_SYNC_EXECUTE 
SIMIX_SYNC_PARALLEL_EXECUTE 
SIMIX_SYNC_COMMUNICATE 
SIMIX_SYNC_JOIN 
SIMIX_SYNC_SLEEP 
SIMIX_SYNC_SYNCHRO 
SIMIX_SYNC_IO 
Enumerator
SIMIX_COMM_SEND 
SIMIX_COMM_RECEIVE 
SIMIX_COMM_READY 
SIMIX_COMM_DONE 
Enumerator
SIMIX_IO_OPEN 
SIMIX_IO_WRITE 
SIMIX_IO_READ 
SIMIX_IO_STAT 

Function Documentation

XBT_PRIVATE void SIMIX_context_mod_init ( void  )

This function is called by SIMIX_global_init() to initialize the context module.

XBT_PRIVATE void SIMIX_context_mod_exit ( void  )

This function is called by SIMIX_clean() to finalize the context module.

XBT_PRIVATE smx_context_t SIMIX_context_new ( xbt_main_func_t  code,
int  argc,
char **  argv,
void_pfn_smxprocess_t  cleanup_func,
smx_process_t  simix_process 
)

creates a new context for a user level process

Parameters
codea main function
argcthe number of arguments of the main function
argvthe vector of arguments of the main function
cleanup_functhe function to call when the context stops
cleanup_argthe argument of the cleanup_func function
XBT_PRIVATE void* SIMIX_context_stack_new ( void  )
XBT_PRIVATE void SIMIX_context_stack_delete ( void stack)
XBT_PRIVATE void SIMIX_context_set_current ( smx_context_t  context)

Sets the current context of this thread.

Parameters
contextthe context to set
XBT_PRIVATE smx_context_t SIMIX_context_get_current ( void  )

Returns the current context of this thread.

Returns
the current context of this thread
int SIMIX_process_get_maxpid ( void  )
XBT_PRIVATE void SIMIX_post_create_environment ( void  )
XBT_PRIVATE void SIMIX_process_set_cleanup_function ( smx_process_t  process,
void_pfn_smxprocess_t  cleanup 
)

Variable Documentation

smx_global_t simix_global
XBT_PRIVATE unsigned long simix_process_maxpid
char sigsegv_stack[SIGSTKSZ]