- simgrid::instr::Type* speed = container->type_->getChildOrNull("power");
- if (speed == nullptr){
- speed = simgrid::instr::Type::variableNew("power", nullptr, container->type_);
- }
-
- double current_speed_state = host.getSpeed();
- new simgrid::instr::SetVariableEvent(0, container, speed, current_speed_state);
- }
- if (TRACE_uncategorized()){
- simgrid::instr::Type* speed_used = container->type_->getChildOrNull("power_used");
- if (speed_used == nullptr){
- simgrid::instr::Type::variableNew("power_used", "0.5 0.5 0.5", container->type_);
- }
- }
-
- if (TRACE_smpi_is_enabled() && TRACE_smpi_is_grouped()){
- simgrid::instr::Type* mpi = container->type_->getChildOrNull("MPI");
- if (mpi == nullptr){
- mpi = simgrid::instr::Type::containerNew("MPI", container->type_);
- simgrid::instr::Type::stateNew("MPI_STATE", mpi);
- }
- }
-
- if (TRACE_msg_process_is_enabled()) {
- simgrid::instr::Type* msg_process = container->type_->getChildOrNull("MSG_PROCESS");
- if (msg_process == nullptr){
- msg_process = simgrid::instr::Type::containerNew("MSG_PROCESS", container->type_);
- simgrid::instr::Type* state = simgrid::instr::Type::stateNew("MSG_PROCESS_STATE", msg_process);
- new simgrid::instr::Value("suspend", "1 0 1", state);
- simgrid::instr::Value::get_or_new("sleep", "1 1 0", state);
- simgrid::instr::Value::get_or_new("receive", "1 0 0", state);
- simgrid::instr::Value::get_or_new("send", "0 0 1", state);
- simgrid::instr::Value::get_or_new("task_execute", "0 1 1", state);
- simgrid::instr::Type::linkNew("MSG_PROCESS_LINK", PJ_type_get_root(), msg_process, msg_process);
- simgrid::instr::Type::linkNew("MSG_PROCESS_TASK_LINK", PJ_type_get_root(), msg_process, msg_process);
- }
- }
-
- if (TRACE_msg_vm_is_enabled()) {
- simgrid::instr::Type* msg_vm = container->type_->getChildOrNull("MSG_VM");
- if (msg_vm == nullptr){
- msg_vm = simgrid::instr::Type::containerNew("MSG_VM", container->type_);
- simgrid::instr::Type* state = simgrid::instr::Type::stateNew("MSG_VM_STATE", msg_vm);
- new simgrid::instr::Value("suspend", "1 0 1", state);
- simgrid::instr::Value::get_or_new("sleep", "1 1 0", state);
- simgrid::instr::Value::get_or_new("receive", "1 0 0", state);
- simgrid::instr::Value::get_or_new("send", "0 0 1", state);
- simgrid::instr::Value::get_or_new("task_execute", "0 1 1", state);
- simgrid::instr::Type::linkNew("MSG_VM_LINK", PJ_type_get_root(), msg_vm, msg_vm);
- simgrid::instr::Type::linkNew("MSG_VM_PROCESS_LINK", PJ_type_get_root(), msg_vm, msg_vm);
- }
+ simgrid::instr::VariableType* power = container->type_->getOrCreateVariableType("power", "");
+ power->setCallingContainer(container);
+ power->setEvent(0, host.getSpeed());
+ }
+
+ if (TRACE_uncategorized())
+ container->type_->getOrCreateVariableType("power_used", "0.5 0.5 0.5");
+
+ if (TRACE_smpi_is_enabled() && TRACE_smpi_is_grouped())
+ container->type_->getOrCreateContainerType("MPI")->getOrCreateStateType("MPI_STATE");
+
+ if (TRACE_actor_is_enabled()) {
+ simgrid::instr::ContainerType* actor = container->type_->getOrCreateContainerType("ACTOR");
+ simgrid::instr::StateType* state = actor->getOrCreateStateType("ACTOR_STATE");
+ state->addEntityValue("suspend", "1 0 1");
+ state->addEntityValue("sleep", "1 1 0");
+ state->addEntityValue("receive", "1 0 0");
+ state->addEntityValue("send", "0 0 1");
+ state->addEntityValue("task_execute", "0 1 1");
+ root->type_->getOrCreateLinkType("ACTOR_LINK", actor, actor);
+ root->type_->getOrCreateLinkType("ACTOR_TASK_LINK", actor, actor);
+ }
+
+ if (TRACE_vm_is_enabled()) {
+ simgrid::instr::ContainerType* msg_vm = container->type_->getOrCreateContainerType("MSG_VM");
+ simgrid::instr::StateType* state = msg_vm->getOrCreateStateType("MSG_VM_STATE");
+ state->addEntityValue("suspend", "1 0 1");
+ state->addEntityValue("sleep", "1 1 0");
+ state->addEntityValue("receive", "1 0 0");
+ state->addEntityValue("send", "0 0 1");
+ state->addEntityValue("task_execute", "0 1 1");
+ root->type_->getOrCreateLinkType("MSG_VM_LINK", msg_vm, msg_vm);
+ root->type_->getOrCreateLinkType("MSG_VM_ACTOR_LINK", msg_vm, msg_vm);