Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
get rid of kind field in instr Type
[simgrid.git] / src / msg / msg_vm.cpp
index 2a569bd..bbbfb1a 100644 (file)
@@ -186,7 +186,8 @@ void MSG_vm_start(msg_vm_t vm)
   vm->start();
   if (TRACE_msg_vm_is_enabled()) {
     container_t vm_container    = simgrid::instr::Container::byName(vm->getName());
-    simgrid::instr::Type* state = vm_container->type_->byName("MSG_VM_STATE");
+    simgrid::instr::StateType* state =
+        static_cast<simgrid::instr::StateType*>(vm_container->type_->byName("MSG_VM_STATE"));
     state->addEntityValue("start", "0 0 1"); // start is blue
     new simgrid::instr::PushStateEvent(MSG_get_clock(), vm_container, state, state->getEntityValue("start"));
   }
@@ -295,7 +296,8 @@ static int migration_rx_fun(int argc, char *argv[])
     // start link
     container_t msg            = simgrid::instr::Container::byName(vm->getName());
     simgrid::instr::Type* type = simgrid::instr::Type::getRootType()->byName("MSG_VM_LINK");
-    new simgrid::instr::StartLinkEvent(MSG_get_clock(), PJ_container_get_root(), type, msg, "M", key);
+    new simgrid::instr::StartLinkEvent(MSG_get_clock(), simgrid::instr::Container::getRootContainer(), type, msg, "M",
+                                       key);
 
     // destroy existing container of this vm
     container_t existing_container = simgrid::instr::Container::byName(vm->getName());
@@ -303,13 +305,13 @@ static int migration_rx_fun(int argc, char *argv[])
     delete existing_container;
 
     // create new container on the new_host location
-    new simgrid::instr::Container(vm->getCname(), simgrid::instr::INSTR_MSG_VM,
-                                  simgrid::instr::Container::byName(ms->dst_pm->getName()));
+    new simgrid::instr::Container(vm->getCname(), "MSG_VM", simgrid::instr::Container::byName(ms->dst_pm->getName()));
 
     // end link
     msg  = simgrid::instr::Container::byName(vm->getName());
     type = simgrid::instr::Type::getRootType()->byName("MSG_VM_LINK");
-    new simgrid::instr::EndLinkEvent(MSG_get_clock(), PJ_container_get_root(), type, msg, "M", key);
+    new simgrid::instr::EndLinkEvent(MSG_get_clock(), simgrid::instr::Container::getRootContainer(), type, msg, "M",
+                                     key);
   }
 
   // Inform the SRC that the migration has been correctly performed
@@ -768,7 +770,8 @@ void MSG_vm_suspend(msg_vm_t vm)
 
   if (TRACE_msg_vm_is_enabled()) {
     container_t vm_container    = simgrid::instr::Container::byName(vm->getName());
-    simgrid::instr::Type* state = vm_container->type_->byName("MSG_VM_STATE");
+    simgrid::instr::StateType* state =
+        static_cast<simgrid::instr::StateType*>(vm_container->type_->byName("MSG_VM_STATE"));
     state->addEntityValue("suspend", "1 0 0"); // suspend is red
     new simgrid::instr::PushStateEvent(MSG_get_clock(), vm_container, state, state->getEntityValue("suspend"));
   }