#include "simgrid/kernel/routing/NetPoint.hpp"
#include "simgrid/kernel/routing/NetZoneImpl.hpp"
#include "simgrid/s4u/Actor.hpp"
+#include "simgrid/s4u/Comm.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"
container_t root = simgrid::instr::Container::get_root();
if ((TRACE_categorized() || TRACE_uncategorized() || TRACE_platform()) && (not TRACE_disable_speed())) {
- simgrid::instr::VariableType* power = container->type_->by_name_or_create("power", "");
- power->set_calling_container(container);
- power->set_event(0, host.get_speed());
+ simgrid::instr::VariableType* speed = container->type_->by_name_or_create("speed", "");
+ speed->set_calling_container(container);
+ speed->set_event(0, host.get_speed());
+
+ simgrid::instr::VariableType* cores = container->type_->by_name_or_create("core_count", "");
+ cores->set_calling_container(container);
+ cores->set_event(0, host.get_core_count());
}
if (TRACE_uncategorized())
- container->type_->by_name_or_create("power_used", "0.5 0.5 0.5");
+ container->type_->by_name_or_create("speed_used", "0.5 0.5 0.5");
if (TRACE_smpi_is_enabled() && TRACE_smpi_is_grouped()) {
simgrid::instr::ContainerType* mpi = container->type_->by_name_or_create<simgrid::instr::ContainerType>("MPI");
static void instr_host_on_speed_change(simgrid::s4u::Host& host)
{
simgrid::instr::Container::by_name(host.get_cname())
- ->get_variable("power")
+ ->get_variable("speed")
->set_event(surf_get_clock(), host.get_core_count() * host.get_available_speed());
}
simgrid::surf::Cpu* cpu = dynamic_cast<simgrid::surf::Cpu*>(resource);
if (cpu != nullptr)
- TRACE_surf_resource_set_utilization("HOST", "power_used", cpu->get_cname(), action->get_category(), value,
+ TRACE_surf_resource_set_utilization("HOST", "speed_used", cpu->get_cname(), action->get_category(), value,
action->get_last_update(), SIMIX_get_clock() - action->get_last_update());
simgrid::kernel::resource::LinkImpl* link = dynamic_cast<simgrid::kernel::resource::LinkImpl*>(resource);
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);
}
if (TRACE_actor_is_enabled()) {
simgrid::s4u::Actor::on_creation.connect(instr_actor_on_creation);
+ simgrid::s4u::Actor::on_destruction.connect([](simgrid::s4u::ActorPtr actor) {
+ auto container = simgrid::instr::Container::by_name_or_null(instr_pid(actor.get()));
+ if (container != nullptr)
+ container->remove_from_parent();
+ });
simgrid::s4u::Actor::on_suspend.connect([](simgrid::s4u::ActorPtr actor) {
simgrid::instr::Container::by_name(instr_pid(actor.get()))->get_state("ACTOR_STATE")->push_event("suspend");
});
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::Comm::on_sender_start.connect([](simgrid::s4u::ActorPtr actor) {
+ simgrid::instr::Container::by_name(instr_pid(actor.get()))->get_state("ACTOR_STATE")->push_event("send");
+ });
+ simgrid::s4u::Comm::on_receiver_start.connect([](simgrid::s4u::ActorPtr actor) {
+ simgrid::instr::Container::by_name(instr_pid(actor.get()))->get_state("ACTOR_STATE")->push_event("receive");
+ });
+ simgrid::s4u::Comm::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);
}