A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[SMPI] Move instr_find_color to C++
[simgrid.git]
/
src
/
instr
/
instr_paje_containers.cpp
diff --git
a/src/instr/instr_paje_containers.cpp
b/src/instr/instr_paje_containers.cpp
index
fa9527e
..
52994b4
100644
(file)
--- a/
src/instr/instr_paje_containers.cpp
+++ b/
src/instr/instr_paje_containers.cpp
@@
-27,7
+27,7
@@
long long int instr_new_paje_id ()
namespace simgrid {
namespace instr {
namespace simgrid {
namespace instr {
-container_t Container::get
R
oot()
+container_t Container::get
_r
oot()
{
return rootContainer;
}
{
return rootContainer;
}
@@
-38,9
+38,10
@@
NetZoneContainer::NetZoneContainer(std::string name, unsigned int level, NetZone
netpoint_ = simgrid::s4u::Engine::get_instance()->netpoint_by_name_or_null(name);
xbt_assert(netpoint_, "Element '%s' not found", name.c_str());
if (father_) {
netpoint_ = simgrid::s4u::Engine::get_instance()->netpoint_by_name_or_null(name);
xbt_assert(netpoint_, "Element '%s' not found", name.c_str());
if (father_) {
- type_ = father_->type_->getOrCreateContainerType(std::string("L") + std::to_string(level));
+ std::string type_name = std::string("L") + std::to_string(level);
+ type_ = father_->type_->by_name_or_create<ContainerType>(type_name);
father_->children_.insert({get_name(), this});
father_->children_.insert({get_name(), this});
- log
C
reation();
+ log
_c
reation();
} else {
type_ = new ContainerType("0");
rootContainer = this;
} else {
type_ = new ContainerType("0");
rootContainer = this;
@@
-78,9
+79,9
@@
Container::Container(std::string name, std::string type_name, Container* father)
XBT_DEBUG("new container %s, child of %s", name.c_str(), father->name_.c_str());
if (not type_name.empty()) {
XBT_DEBUG("new container %s, child of %s", name.c_str(), father->name_.c_str());
if (not type_name.empty()) {
- type_ = father_->type_->
getOrCreateContainerType
(type_name);
+ type_ = father_->type_->
by_name_or_create<ContainerType>
(type_name);
father_->children_.insert({name_, this});
father_->children_.insert({name_, this});
- log
C
reation();
+ log
_c
reation();
}
}
}
}
@@
-107,34
+108,34
@@
Container::~Container()
TRACE_paje_dump_buffer(true);
// trace my destruction, but not if user requests so or if the container is root
TRACE_paje_dump_buffer(true);
// trace my destruction, but not if user requests so or if the container is root
- if (not TRACE_disable_destroy() && this != Container::get
R
oot())
- log
D
estruction();
+ if (not TRACE_disable_destroy() && this != Container::get
_r
oot())
+ log
_d
estruction();
// remove me from the allContainers data structure
allContainers.erase(name_);
}
// remove me from the allContainers data structure
allContainers.erase(name_);
}
-void Container::create
C
hild(std::string name, std::string type_name)
+void Container::create
_c
hild(std::string name, std::string type_name)
{
new Container(name, type_name, this);
}
{
new Container(name, type_name, this);
}
-Container* Container::by
NameOrN
ull(std::string name)
+Container* Container::by
_name_or_n
ull(std::string name)
{
auto cont = allContainers.find(name);
return cont == allContainers.end() ? nullptr : cont->second;
}
{
auto cont = allContainers.find(name);
return cont == allContainers.end() ? nullptr : cont->second;
}
-Container* Container::by
N
ame(std::string name)
+Container* Container::by
_n
ame(std::string name)
{
{
- Container* ret = Container::by
NameOrN
ull(name);
+ Container* ret = Container::by
_name_or_n
ull(name);
if (ret == nullptr)
THROWF(tracing_error, 1, "container with name %s not found", name.c_str());
return ret;
}
if (ret == nullptr)
THROWF(tracing_error, 1, "container with name %s not found", name.c_str());
return ret;
}
-void Container::remove
FromP
arent()
+void Container::remove
_from_p
arent()
{
if (father_) {
XBT_DEBUG("removeChildContainer (%s) FromContainer (%s) ", get_cname(), father_->get_cname());
{
if (father_) {
XBT_DEBUG("removeChildContainer (%s) FromContainer (%s) ", get_cname(), father_->get_cname());
@@
-143,7
+144,7
@@
void Container::removeFromParent()
delete this;
}
delete this;
}
-void Container::log
C
reation()
+void Container::log
_c
reation()
{
double timestamp = SIMIX_get_clock();
std::stringstream stream;
{
double timestamp = SIMIX_get_clock();
std::stringstream stream;
@@
-182,7
+183,7
@@
void Container::logCreation()
}
}
}
}
-void Container::log
D
estruction()
+void Container::log
_d
estruction()
{
std::stringstream stream;
double timestamp = SIMIX_get_clock();
{
std::stringstream stream;
double timestamp = SIMIX_get_clock();
@@
-205,24
+206,24
@@
void Container::logDestruction()
}
}
}
}
-StateType* Container::get
S
tate(std::string name)
+StateType* Container::get
_s
tate(std::string name)
{
{
- StateType* ret = dynamic_cast<StateType*>(type_->by
N
ame(name));
- ret->set
CallingC
ontainer(this);
+ StateType* ret = dynamic_cast<StateType*>(type_->by
_n
ame(name));
+ ret->set
_calling_c
ontainer(this);
return ret;
}
return ret;
}
-LinkType* Container::get
L
ink(std::string name)
+LinkType* Container::get
_l
ink(std::string name)
{
{
- LinkType* ret = dynamic_cast<LinkType*>(type_->by
N
ame(name));
- ret->set
CallingC
ontainer(this);
+ LinkType* ret = dynamic_cast<LinkType*>(type_->by
_n
ame(name));
+ ret->set
_calling_c
ontainer(this);
return ret;
}
return ret;
}
-VariableType* Container::get
V
ariable(std::string name)
+VariableType* Container::get
_v
ariable(std::string name)
{
{
- VariableType* ret = dynamic_cast<VariableType*>(type_->by
N
ame(name));
- ret->set
CallingC
ontainer(this);
+ VariableType* ret = dynamic_cast<VariableType*>(type_->by
_n
ame(name));
+ ret->set
_calling_c
ontainer(this);
return ret;
}
}
return ret;
}
}