Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Have the s4u::Actor::execute() actually wait for the completion of the execution
[simgrid.git] / src / s4u / s4u_actor.cpp
index fb3fb0d..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) {
@@ -91,10 +92,10 @@ void *s4u::Actor::recv(Mailbox &chan) {
 
     return res;
 }
-void s4u::Actor::sendstr(Mailbox &chan, const char*msg) {
+void s4u::Actor::send(Mailbox &chan, void *payload, size_t simulatedSize) {
        Comm c = Comm::send_init(this,chan);
-       c.setRemains(strlen(msg));
-       c.setSrcData(xbt_strdup(msg),sizeof(char*));
+       c.setRemains(simulatedSize);
+       c.setSrcData(payload);
        c.wait();
 }