X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/cdac506670725ae4fe40b3b1a31ceeb9488ce53a..66e4277badef8f22852720b79a78e1f091c3b679:/src/s4u/s4u_Actor.cpp diff --git a/src/s4u/s4u_Actor.cpp b/src/s4u/s4u_Actor.cpp index b22b2b0531..5e2988b6e8 100644 --- a/src/s4u/s4u_Actor.cpp +++ b/src/s4u/s4u_Actor.cpp @@ -35,7 +35,7 @@ ActorPtr Actor::self() if (self_context == nullptr) return simgrid::s4u::ActorPtr(); - return self_context->process()->iface(); + return self_context->get_actor()->iface(); } ActorPtr Actor::create(std::string name, s4u::Host* host, std::function code) @@ -338,11 +338,7 @@ void parallel_execute(int host_nb, sg_host_t* host_list, double* flops_amount, d ExecPtr exec_init(double flops_amount) { - ExecPtr res = ExecPtr(new Exec()); - res->host_ = get_host(); - res->flops_amount_ = flops_amount; - res->set_remaining(flops_amount); - return res; + return ExecPtr(new Exec(get_host(), flops_amount)); } ExecPtr exec_async(double flops) @@ -460,7 +456,7 @@ void kill() /* deprecated */ * * This function checks whether @a actor is a valid pointer and return its PID (or 0 in case of problem). */ -int sg_actor_get_PID(sg_actor_t actor) +aid_t sg_actor_get_PID(sg_actor_t actor) { /* Do not raise an exception here: this function is called by the logs * and the exceptions, so it would be called back again and again */ @@ -475,7 +471,7 @@ int sg_actor_get_PID(sg_actor_t actor) * This function checks whether @a actor is a valid pointer and return its parent's PID. * Returns -1 if the actor has not been created by any other actor. */ -int sg_actor_get_PPID(sg_actor_t actor) +aid_t sg_actor_get_PPID(sg_actor_t actor) { return actor->get_ppid(); }