SimGrid  3.16
Versatile Simulation of Distributed Systems
simgrid::simix Namespace Reference

Classes

class  ActorImpl
 
class  Future
 A blocking (wait()-based) future for SIMIX processes. More...
 
class  Global
 
class  Host
 
class  MutexImpl
 
class  ProcessArg
 

Typedefs

typedef std::function< void()> ActorCode
 
typedef std::function< ActorCode(std::vector< std::string > args)> ActorCodeFactory
 

Functions

void unblock (smx_actor_t process)
 
template<class F >
auto kernelSync (F code) -> decltype(code().get())
 Execute some code in kernel mode and wakes up the actor when the result is available. More...
 
template<class F >
auto kernelAsync (F code) -> Future< decltype(code().get())>
 Start some asynchronous work. More...
 
template<class F >
std::result_of< F()>::type kernelImmediate (F &&code)
 Execute some code in the kernel/maestro. More...
 
void set_maestro (std::function< void()> code)
 
void create_maestro (std::function< void()> code)
 
void registerFunction (const char *name, ActorCodeFactory factory)
 
static int dying_daemon (void *exit_status, void *data)
 

Variables

simgrid::xbt::signal< void()> onDeadlock
 These functions will be called when we detect a deadlock: any remaining process is locked on an action. More...
 

Typedef Documentation

◆ ActorCode

◆ ActorCodeFactory

Function Documentation

◆ unblock()

void simgrid::simix::unblock ( smx_actor_t  process)

◆ kernelSync()

template<class F >
auto simgrid::simix::kernelSync ( code) -> decltype(code().get())

Execute some code in kernel mode and wakes up the actor when the result is available.

It is given a callback which is executed in the SimGrid kernel and returns a simgrid::kernel::Future<T>. The kernel blocks the actor until the Future is ready and:

  • either returns the value wrapped in the future to the actor;
  • or raises the exception stored in the future in the actor.

This can be used to implement blocking calls without adding new simcalls. One downside of this approach is that we don't have any semantic on what the actor is waiting. This might be a problem for the model-checker and we'll have to devise a way to make it work.

Parameters
codeKernel code returning a simgrid::kernel::Future<T>
Returns
Value of the kernel future
Exceptions
Exceptionfrom the kernel future

◆ kernelAsync()

template<class F >
auto simgrid::simix::kernelAsync ( code) -> Future<decltype(code().get())>

Start some asynchronous work.

Parameters
codeSimGrid kernel code which returns a simgrid::kernel::Future
Returns
Actor future

◆ kernelImmediate()

template<class F >
std::result_of<F()>::type simgrid::simix::kernelImmediate ( F &&  code)

Execute some code in the kernel/maestro.

This can be used to enforce mutual exclusion with other simcall. More importantly, this enforces a deterministic/reproducible ordering of the operation with respect to other simcalls.

◆ set_maestro()

void simgrid::simix::set_maestro ( std::function< void()>  code)

◆ create_maestro()

void simgrid::simix::create_maestro ( std::function< void()>  code)

◆ registerFunction()

void simgrid::simix::registerFunction ( const char *  name,
ActorCodeFactory  factory 
)

◆ dying_daemon()

static int simgrid::simix::dying_daemon ( void exit_status,
void data 
)
static

Variable Documentation

◆ onDeadlock

simgrid::xbt::signal< void()> simgrid::simix::onDeadlock

These functions will be called when we detect a deadlock: any remaining process is locked on an action.

If these functions manage to unlock some of the processes, then the deadlock will be avoided.