Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Have the s4u::Actor::execute() actually wait for the completion of the execution
authorMartin Quinson <martin.quinson@loria.fr>
Sun, 16 Aug 2015 20:00:52 +0000 (22:00 +0200)
committerMartin Quinson <martin.quinson@loria.fr>
Sun, 16 Aug 2015 20:00:52 +0000 (22:00 +0200)
include/simgrid/s4u/actor.hpp
src/s4u/s4u_actor.cpp

index 4476f5e..6b9c524 100644 (file)
@@ -81,7 +81,7 @@ public:
        void sleep(double duration);
 
        /** Block the actor, computing the given amount of flops */
-       void execute(double flop);
+       e_smx_state_t execute(double flop);
 
        /** Block the actor until it gets a message from the given mailbox */
        void *recv(Mailbox &chan);
index 04544a0..64d429e 100644 (file)
@@ -78,8 +78,9 @@ void s4u::Actor::sleep(double duration) {
        simcall_process_sleep(duration);
 }
 
-void s4u::Actor::execute(double flops) {
-       simcall_process_execute(NULL,flops,1.0/*priority*/,0./*bound*/, 0L/*affinity*/);
+e_smx_state_t s4u::Actor::execute(double flops) {
+       smx_synchro_t s = simcall_process_execute(NULL,flops,1.0/*priority*/,0./*bound*/, 0L/*affinity*/);
+    return simcall_process_execution_wait(s);
 }
 
 void *s4u::Actor::recv(Mailbox &chan) {