SimGrid  3.21
Versatile Simulation of Distributed Systems
simix.hpp File Reference
#include <simgrid/simix.h>
#include <xbt/functional.hpp>
#include <xbt/future.hpp>
#include <xbt/signal.hpp>
#include <string>
#include <unordered_map>

Namespaces

 simgrid
 
 simgrid::simix
 

Typedefs

typedef std::function< void()> simgrid::simix::ActorCode
 
typedef std::function< ActorCode(std::vector< std::string > args)> simgrid::simix::ActorCodeFactory
 
typedef smx_actor_t(* smx_creation_func_t) (std::string, simgrid::simix::ActorCode code, void *, sg_host_t, std::unordered_map< std::string, std::string > *, smx_actor_t)
 

Functions

void simcall_run_kernel (std::function< void()> const &code)
 
void simcall_run_blocking (std::function< void()> const &code)
 Execute some code in the kernel and block. More...
 
template<class F >
void simcall_run_kernel (F &f)
 
template<class F >
void simcall_run_blocking (F &f)
 
template<class F >
std::result_of< F()>::type simgrid::simix::simcall (F &&code)
 Execute some code in the kernel/maestro. More...
 
const std::vector< smx_actor_t > & simgrid::simix::process_get_runnable ()
 
void simgrid::simix::register_function (std::string name, ActorCodeFactory factory)
 
void SIMIX_function_register_process_create (smx_creation_func_t function)
 
smx_actor_t simcall_process_create (std::string name, simgrid::simix::ActorCode code, void *data, sg_host_t host, std::unordered_map< std::string, std::string > *properties)
 
smx_timer_t SIMIX_timer_set (double date, simgrid::xbt::Task< void()> callback)
 
template<class F >
smx_timer_t SIMIX_timer_set (double date, F callback)
 
template<class R , class T >
smx_timer_t SIMIX_timer_set (double date, R(*callback)(T *), T *arg)
 

Typedef Documentation

◆ smx_creation_func_t

typedef smx_actor_t(* smx_creation_func_t) ( std::string, simgrid::simix::ActorCode code, void *, sg_host_t, std::unordered_map< std::string, std::string > *, smx_actor_t)

Function Documentation

◆ simcall_run_kernel() [1/2]

void simcall_run_kernel ( std::function< void()> const &  code)

◆ simcall_run_blocking() [1/2]

void simcall_run_blocking ( std::function< void()> const &  code)

Execute some code in the kernel and block.

run_blocking() is a generic blocking simcall. It is given a callback which is executed immediately in the SimGrid kernel. The callback is responsible for setting the suitable logic for waking up the process when needed.

simix::kernelSync() is a higher level wrapper for this.

◆ simcall_run_kernel() [2/2]

template<class F >
void simcall_run_kernel ( F &  f)
inline

◆ simcall_run_blocking() [2/2]

template<class F >
void simcall_run_blocking ( F &  f)
inline

◆ SIMIX_function_register_process_create()

void SIMIX_function_register_process_create ( smx_creation_func_t  function)

◆ simcall_process_create()

smx_actor_t simcall_process_create ( std::string  name,
simgrid::simix::ActorCode  code,
void *  data,
sg_host_t  host,
std::unordered_map< std::string, std::string > *  properties 
)

◆ SIMIX_timer_set() [1/3]

smx_timer_t SIMIX_timer_set ( double  date,
simgrid::xbt::Task< void()>  callback 
)

◆ SIMIX_timer_set() [2/3]

template<class F >
smx_timer_t SIMIX_timer_set ( double  date,
callback 
)
inline

◆ SIMIX_timer_set() [3/3]

template<class R , class T >
smx_timer_t SIMIX_timer_set ( double  date,
R(*)(T *)  callback,
T *  arg 
)
inline