Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
add sg_actor_execute_with_priority
authorFrederic Suter <frederic.suter@cc.in2p3.fr>
Wed, 4 Mar 2020 12:29:57 +0000 (13:29 +0100)
committerFrederic Suter <frederic.suter@cc.in2p3.fr>
Wed, 4 Mar 2020 12:29:57 +0000 (13:29 +0100)
include/simgrid/actor.h
src/s4u/s4u_Actor.cpp

index 7f7d699..6ab028b 100644 (file)
@@ -68,6 +68,7 @@ XBT_PUBLIC void* sg_actor_self_data();
 XBT_PUBLIC void sg_actor_self_data_set(void* data);
 XBT_ATTRIB_DEPRECATED_v330("Please use sg_actor_execute() instead") XBT_PUBLIC void sg_actor_self_execute(double flops);
 XBT_PUBLIC void sg_actor_execute(double flops);
+XBT_PUBLIC void sg_actor_execute_with_priority(double flops, double priority);
 void sg_actor_parallel_execute(int host_nb, sg_host_t* host_list, double* flops_amount, double* bytes_amount);
 XBT_PUBLIC void sg_actor_ref(const_sg_actor_t actor);
 XBT_PUBLIC void sg_actor_unref(const_sg_actor_t actor);
index c39f366..0ca43d2 100644 (file)
@@ -754,6 +754,10 @@ void sg_actor_execute(double flops)
 {
   simgrid::s4u::this_actor::execute(flops);
 }
+void sg_actor_execute_with_priority(double flops, double priority)
+{
+  simgrid::s4u::this_actor::exec_init(flops)->set_priority(priority)->wait();
+}
 
 void sg_actor_parallel_execute(int host_nb, sg_host_t* host_list, double* flops_amount, double* bytes_amount)
 {