From: Frederic Suter Date: Thu, 11 Jul 2019 09:39:38 +0000 (+0200) Subject: add a sg_actor_self_execute function X-Git-Tag: v3.24~318 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/b25f2f8d84b6b239f9f32a77a91423648c5448a5 add a sg_actor_self_execute function can replace MSG_task_create/MSG_task_execute/MSG_task_destroy for simple computations. --- diff --git a/include/simgrid/actor.h b/include/simgrid/actor.h index 47d6622677..e13893e40a 100644 --- a/include/simgrid/actor.h +++ b/include/simgrid/actor.h @@ -46,6 +46,7 @@ XBT_PUBLIC sg_actor_t sg_actor_self(); XBT_PUBLIC aid_t sg_actor_self_get_pid(); XBT_PUBLIC aid_t sg_actor_self_get_ppid(); XBT_PUBLIC const char* sg_actor_self_get_name(); +XBT_PUBLIC void sg_actor_self_execute(double flops); XBT_PUBLIC void sg_actor_ref(sg_actor_t actor); XBT_PUBLIC void sg_actor_unref(sg_actor_t actor); diff --git a/src/s4u/s4u_Actor.cpp b/src/s4u/s4u_Actor.cpp index aa175c6a4d..438c476fe4 100644 --- a/src/s4u/s4u_Actor.cpp +++ b/src/s4u/s4u_Actor.cpp @@ -689,6 +689,11 @@ sg_actor_t sg_actor_self() return simgrid::s4u::Actor::self(); } +void sg_actor_self_execute(double flops) +{ + simgrid::s4u::this_actor::execute(flops); +} + /** @brief Take an extra reference on that actor to prevent it to be garbage-collected */ void sg_actor_ref(sg_actor_t actor) {