- 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 = msg_process->addStateType("MSG_PROCESS_STATE");
- simgrid::instr::Value::byNameOrCreate("suspend", "1 0 1", state);
- simgrid::instr::Value::byNameOrCreate("sleep", "1 1 0", state);
- simgrid::instr::Value::byNameOrCreate("receive", "1 0 0", state);
- simgrid::instr::Value::byNameOrCreate("send", "0 0 1", state);
- simgrid::instr::Value::byNameOrCreate("task_execute", "0 1 1", state);
- PJ_type_get_root()->addLinkType("MSG_PROCESS_LINK", msg_process, msg_process);
- PJ_type_get_root()->addLinkType("MSG_PROCESS_TASK_LINK", msg_process, msg_process);
- }
+ simgrid::instr::Type* msg_process = container->type_->getOrCreateContainerType("MSG_PROCESS");
+ simgrid::instr::Type* state = msg_process->getOrCreateStateType("MSG_PROCESS_STATE");
+ simgrid::instr::Value::byNameOrCreate("suspend", "1 0 1", state);
+ simgrid::instr::Value::byNameOrCreate("sleep", "1 1 0", state);
+ simgrid::instr::Value::byNameOrCreate("receive", "1 0 0", state);
+ simgrid::instr::Value::byNameOrCreate("send", "0 0 1", state);
+ simgrid::instr::Value::byNameOrCreate("task_execute", "0 1 1", state);
+ simgrid::instr::Type::getRootType()->getOrCreateLinkType("MSG_PROCESS_LINK", msg_process, msg_process);
+ simgrid::instr::Type::getRootType()->getOrCreateLinkType("MSG_PROCESS_TASK_LINK", msg_process, msg_process);