- Type* speed = Type::getOrNull ("power", container->type);
- if (speed == nullptr){
- speed = Type::variableNew ("power", nullptr, container->type);
- }
-
- double current_speed_state = host.getSpeed();
- new SetVariableEvent (0, container, speed, current_speed_state);
- }
- if (TRACE_uncategorized()){
- Type* speed_used = Type::getOrNull ("power_used", container->type);
- if (speed_used == nullptr){
- Type::variableNew ("power_used", "0.5 0.5 0.5", container->type);
- }
- }
-
- if (TRACE_smpi_is_enabled() && TRACE_smpi_is_grouped()){
- Type* mpi = Type::getOrNull ("MPI", container->type);
- if (mpi == nullptr){
- mpi = Type::containerNew("MPI", container->type);
- Type::stateNew ("MPI_STATE", mpi);
- }
- }
-
- if (TRACE_msg_process_is_enabled()) {
- Type* msg_process = Type::getOrNull ("MSG_PROCESS", container->type);
- if (msg_process == nullptr){
- msg_process = Type::containerNew("MSG_PROCESS", container->type);
- Type* state = Type::stateNew ("MSG_PROCESS_STATE", msg_process);
- value PJ_value("suspend", "1 0 1", state);
- value::get_or_new("sleep", "1 1 0", state);
- value::get_or_new("receive", "1 0 0", state);
- value::get_or_new("send", "0 0 1", state);
- value::get_or_new("task_execute", "0 1 1", state);
- Type::linkNew ("MSG_PROCESS_LINK", PJ_type_get_root(), msg_process, msg_process);
- Type::linkNew ("MSG_PROCESS_TASK_LINK", PJ_type_get_root(), msg_process, msg_process);
- }
- }
-
- if (TRACE_msg_vm_is_enabled()) {
- Type* msg_vm = Type::getOrNull ("MSG_VM", container->type);
- if (msg_vm == nullptr){
- msg_vm = Type::containerNew("MSG_VM", container->type);
- Type* state = Type::stateNew ("MSG_VM_STATE", msg_vm);
- value PJ_value("suspend", "1 0 1", state);
- value::get_or_new("sleep", "1 1 0", state);
- value::get_or_new("receive", "1 0 0", state);
- value::get_or_new("send", "0 0 1", state);
- value::get_or_new("task_execute", "0 1 1", state);
- Type::linkNew ("MSG_VM_LINK", PJ_type_get_root(), msg_vm, msg_vm);
- 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()) {
+ simgrid::instr::ContainerType* mpi = container->type_->getOrCreateContainerType("MPI");
+ mpi->getOrCreateStateType("MPI_STATE");
+ // TODO See if we can move this to the LoadBalancer plugin
+ root->type_->getOrCreateLinkType("MIGRATE_LINK", mpi, mpi);
+ mpi->getOrCreateStateType("MIGRATE_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);