SimGrid
3.21
Versatile Simulation of Distributed Systems
|
Classes | |
class | Future |
A blocking (wait() -based) future for SIMIX processes. More... | |
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 | kernel_sync (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 | kernelSync (F code) -> decltype(code().get()) |
template<class F > | |
auto | kernel_async (F code) -> Future< decltype(code().get())> |
Start some asynchronous work. More... | |
template<class F > | |
auto | kernelAsync (F code) -> Future< decltype(code().get())> |
template<class F > | |
std::result_of< F()>::type | simcall (F &&code) |
Execute some code in the kernel/maestro. More... | |
const std::vector< smx_actor_t > & | process_get_runnable () |
void | register_function (std::string name, ActorCodeFactory factory) |
typedef std::function<void()> simgrid::simix::ActorCode |
typedef std::function<ActorCode(std::vector<std::string> args)> simgrid::simix::ActorCodeFactory |
void simgrid::simix::unblock | ( | smx_actor_t | process | ) |
auto simgrid::simix::kernel_sync | ( | F | 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:
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.
code | Kernel code returning a simgrid::kernel::Future<T> |
Exception | from the kernel future |
auto simgrid::simix::kernelSync | ( | F | code | ) | -> decltype(code().get()) |
auto simgrid::simix::kernel_async | ( | F | code | ) | -> Future<decltype(code().get())> |
Start some asynchronous work.
code | SimGrid kernel code which returns a simgrid::kernel::Future |
auto simgrid::simix::kernelAsync | ( | F | code | ) | -> Future<decltype(code().get())> |
std::result_of<F()>::type simgrid::simix::simcall | ( | 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.
const std::vector<smx_actor_t>& simgrid::simix::process_get_runnable | ( | ) |
void simgrid::simix::register_function | ( | std::string | name, |
ActorCodeFactory | factory | ||
) |