#include "simgrid/kernel/routing/NetZoneImpl.hpp"
#include "simgrid/s4u/Actor.hpp"
#include "simgrid/s4u/Engine.hpp"
+#include "simgrid/s4u/Exec.hpp"
#include "simgrid/s4u/Host.hpp"
#include "simgrid/s4u/VirtualMachine.hpp"
#include "src/surf/cpu_interface.hpp"
state->add_entity_value("sleep", "1 1 0");
state->add_entity_value("receive", "1 0 0");
state->add_entity_value("send", "0 0 1");
- state->add_entity_value("task_execute", "0 1 1");
+ state->add_entity_value("execute", "0 1 1");
root->type_->by_name_or_create("ACTOR_LINK", actor_type, actor_type);
root->type_->by_name_or_create("ACTOR_TASK_LINK", actor_type, actor_type);
state->add_entity_value("sleep", "1 1 0");
state->add_entity_value("receive", "1 0 0");
state->add_entity_value("send", "0 0 1");
- state->add_entity_value("task_execute", "0 1 1");
+ state->add_entity_value("execute", "0 1 1");
root->type_->by_name_or_create("VM_LINK", vm, vm);
root->type_->by_name_or_create("VM_ACTOR_LINK", vm, vm);
}
simgrid::s4u::Actor::on_wake_up.connect([](simgrid::s4u::ActorPtr actor) {
simgrid::instr::Container::by_name(instr_pid(actor.get()))->get_state("ACTOR_STATE")->pop_event();
});
+ simgrid::s4u::Exec::on_start.connect([](simgrid::s4u::ActorPtr actor) {
+ simgrid::instr::Container::by_name(instr_pid(actor.get()))->get_state("ACTOR_STATE")->push_event("execute");
+ });
+ simgrid::s4u::Exec::on_completion.connect([](simgrid::s4u::ActorPtr actor) {
+ simgrid::instr::Container::by_name(instr_pid(actor.get()))->get_state("ACTOR_STATE")->pop_event();
+ });
simgrid::s4u::Actor::on_migration_start.connect(instr_actor_on_migration_start);
simgrid::s4u::Actor::on_migration_end.connect(instr_actor_on_migration_end);
}
XBT_DEBUG("EXEC,in %p, %lld, %s", task, task->counter, task->category);
if (TRACE_actor_is_enabled())
- simgrid::instr::Container::by_name(instr_pid(MSG_process_self()))
- ->get_state("ACTOR_STATE")
- ->push_event("task_execute");
+ simgrid::instr::Container::by_name(instr_pid(MSG_process_self()))->get_state("ACTOR_STATE")->push_event("execute");
}
void TRACE_msg_task_execute_end(msg_task_t task)
namespace simgrid {
namespace s4u {
+simgrid::xbt::signal<void(simgrid::s4u::ActorPtr)> s4u::Exec::on_start;
+simgrid::xbt::signal<void(simgrid::s4u::ActorPtr)> s4u::Exec::on_completion;
Activity* Exec::start()
{
pimpl_ = simcall_execution_start(name_, tracing_category_, flops_amount_, 1. / priority_, bound_, host_);
state_ = State::STARTED;
+ on_start(Actor::self());
return this;
}
{
simcall_execution_wait(pimpl_);
state_ = State::FINISHED;
+ on_completion(Actor::self());
return this;
}