- this->level_ = father_->level_ + 1;
- XBT_DEBUG("new container %s, child of %s", name.c_str(), father->name_.c_str());
- }
-
- // type definition (method depends on kind of this new container)
- if (this->kind_ == simgrid::instr::INSTR_AS) {
- //if this container is of an AS, its type name depends on its level
- char as_typename[INSTR_DEFAULT_STR_SIZE];
- snprintf(as_typename, INSTR_DEFAULT_STR_SIZE, "L%d", this->level_);
- if (this->father_) {
- this->type_ = this->father_->type_->getChildOrNull(as_typename);
- if (this->type_ == nullptr) {
- this->type_ = simgrid::instr::Type::containerNew(as_typename, this->father_->type_);
- }
- }else{
- this->type_ = simgrid::instr::Type::containerNew("0", nullptr);
- }
- } else {
- //otherwise, the name is its kind
- char typeNameBuff[INSTR_DEFAULT_STR_SIZE];
- switch (this->kind_) {
- case simgrid::instr::INSTR_HOST:
- snprintf (typeNameBuff, INSTR_DEFAULT_STR_SIZE, "HOST");
- break;
- case simgrid::instr::INSTR_LINK:
- snprintf (typeNameBuff, INSTR_DEFAULT_STR_SIZE, "LINK");
- break;
- case simgrid::instr::INSTR_ROUTER:
- snprintf (typeNameBuff, INSTR_DEFAULT_STR_SIZE, "ROUTER");
- break;
- case simgrid::instr::INSTR_SMPI:
- snprintf (typeNameBuff, INSTR_DEFAULT_STR_SIZE, "MPI");
- break;
- case simgrid::instr::INSTR_MSG_PROCESS:
- snprintf (typeNameBuff, INSTR_DEFAULT_STR_SIZE, "MSG_PROCESS");
- break;
- case simgrid::instr::INSTR_MSG_VM:
- snprintf (typeNameBuff, INSTR_DEFAULT_STR_SIZE, "MSG_VM");
- break;
- case simgrid::instr::INSTR_MSG_TASK:
- snprintf (typeNameBuff, INSTR_DEFAULT_STR_SIZE, "MSG_TASK");
- break;
- default:
- THROWF (tracing_error, 0, "new container kind is unknown.");
- break;
- }
- simgrid::instr::Type* type = this->father_->type_->getChildOrNull(typeNameBuff);
- if (type == nullptr){
- this->type_ = simgrid::instr::Type::containerNew(typeNameBuff, this->father_->type_);
- }else{
- this->type_ = type;
- }
- }
- if (this->father_) {
- this->father_->children_.insert({this->name_, this});
- LogContainerCreation(this);