Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
getting sg_instr_AS_end through a signal structure
[simgrid.git] / src / s4u / s4u_actor.cpp
index 4841225..37d935f 100644 (file)
@@ -29,7 +29,7 @@ ActorPtr Actor::self()
 
 ActorPtr Actor::createActor(const char* name, s4u::Host* host, std::function<void()> code)
 {
-  smx_actor_t actor = simcall_process_create(name, std::move(code), nullptr, host, nullptr);
+  simgrid::simix::ActorImpl* actor = simcall_process_create(name, std::move(code), nullptr, host, nullptr);
   return actor->iface();
 }
 
@@ -37,7 +37,7 @@ ActorPtr Actor::createActor(const char* name, s4u::Host* host, const char* funct
 {
   simgrid::simix::ActorCodeFactory& factory = SIMIX_get_actor_code_factory(function);
   simgrid::simix::ActorCode code = factory(std::move(args));
-  smx_actor_t actor                         = simcall_process_create(name, std::move(code), nullptr, host, nullptr);
+  simgrid::simix::ActorImpl* actor          = simcall_process_create(name, std::move(code), nullptr, host, nullptr);
   return actor->iface();
 }
 
@@ -187,36 +187,41 @@ e_smx_state_t execute(double flops) {
 
 void* recv(MailboxPtr chan) {
   void *res = nullptr;
-  Comm& c = Comm::recv_init(chan);
-  c.setDstData(&res,sizeof(res));
-  c.wait();
+  CommPtr c = Comm::recv_init(chan);
+  c->setDstData(&res, sizeof(res));
+  c->wait();
   return res;
 }
 
 void send(MailboxPtr chan, void* payload, double simulatedSize)
 {
-  Comm& c = Comm::send_init(chan);
-  c.setRemains(simulatedSize);
-  c.setSrcData(payload);
-  // c.start() is optional.
-  c.wait();
+  CommPtr c = Comm::send_init(chan);
+  c->setRemains(simulatedSize);
+  c->setSrcData(payload);
+  // c->start() is optional.
+  c->wait();
 }
 
 void send(MailboxPtr chan, void* payload, double simulatedSize, double timeout)
 {
-  Comm& c = Comm::send_init(chan);
-  c.setRemains(simulatedSize);
-  c.setSrcData(payload);
-  // c.start() is optional.
-  c.wait(timeout);
+  CommPtr c = Comm::send_init(chan);
+  c->setRemains(simulatedSize);
+  c->setSrcData(payload);
+  // c->start() is optional.
+  c->wait(timeout);
 }
 
-Comm& isend(MailboxPtr chan, void* payload, double simulatedSize)
+CommPtr isend(MailboxPtr chan, void* payload, double simulatedSize)
 {
   return Comm::send_async(chan, payload, simulatedSize);
 }
 
-Comm& irecv(MailboxPtr chan, void** data)
+void dsend(MailboxPtr chan, void* payload, double simulatedSize)
+{
+  Comm::send_detached(chan, payload, simulatedSize);
+}
+
+CommPtr irecv(MailboxPtr chan, void** data)
 {
   return Comm::recv_async(chan, data);
 }