XBT_PUBLIC(void) SIMIX_context_set_parallel_threshold(int threshold);
XBT_PUBLIC(e_xbt_parmap_mode_t) SIMIX_context_get_parallel_mode(void);
XBT_PUBLIC(void) SIMIX_context_set_parallel_mode(e_xbt_parmap_mode_t mode);
-
+XBT_PUBLIC(int) SIMIX_is_maestro();
/********************************** Global ************************************/
typedef typename std::result_of<F()>::type R;
std::promise<R> promise;
simcall_run_kernel([&]{
+ xbt_assert(SIMIX_is_maestro(), "Not in maestro");
fulfill_promise(promise, code);
});
return promise.get_future().get();
{
return (xbt_dict_t) xbt_lib_get_or_null(as_router_lib, name, ROUTING_PROP_ASR_LEVEL);
}
+
+int SIMIX_is_maestro()
+{
+ return SIMIX_process_self() == simix_global->maestro_process;
+}
\ No newline at end of file