timestamp);
stream << std::fixed << std::setprecision(trace_precision) << PajeEventType::CreateContainer << " ";
- stream << timestamp << " " << c.get_id() << " " << c.type_->get_id() << " " << c.father_->get_id() << " \"";
+ stream << timestamp << " " << c.get_id() << " " << c.type_->get_id() << " " << c.parent_->get_id() << " \"";
if (c.get_name().find("rank-") != 0)
stream << c.get_name() << "\"";
else
std::stringstream stream;
XBT_DEBUG("%s: event_type=%u", __func__, static_cast<unsigned>(PajeEventType::DefineEntityValue));
stream << std::fixed << std::setprecision(trace_precision) << PajeEventType::DefineEntityValue;
- stream << " " << value.get_id() << " " << value.get_father()->get_id() << " " << value.get_name();
+ stream << " " << value.get_id() << " " << value.get_parent()->get_id() << " " << value.get_name();
if (not value.get_color().empty())
stream << " \"" << value.get_color() << "\"";
XBT_DEBUG("Dump %s", stream.str().c_str());
std::stringstream stream;
stream << std::fixed << std::setprecision(trace_precision);
XBT_DEBUG("%s: event_type=%u, timestamp=%.*f", __func__, static_cast<unsigned>(event_type), trace_precision, 0.);
- stream << event_type << " " << type.get_id() << " " << type.get_father()->get_id() << " " << type.get_name();
+ stream << event_type << " " << type.get_id() << " " << type.get_parent()->get_id() << " " << type.get_name();
if (type.is_colored())
stream << " \"" << type.get_color() << "\"";
XBT_DEBUG("Dump %s", stream.str().c_str());
std::stringstream stream;
XBT_DEBUG("%s: event_type=%u, timestamp=%.*f", __func__, static_cast<unsigned>(PajeEventType::DefineLinkType),
trace_precision, 0.);
- stream << PajeEventType::DefineLinkType << " " << type.get_id() << " " << type.get_father()->get_id();
+ stream << PajeEventType::DefineLinkType << " " << type.get_id() << " " << type.get_parent()->get_id();
stream << " " << source.get_id() << " " << dest.get_id() << " " << type.get_name();
XBT_DEBUG("Dump %s", stream.str().c_str());
tracing_file << stream.str() << std::endl;
return instr_set_to_dynar(declared_marks);
}
-static void instr_user_variable(double time, const char* resource, const char* variable_name, const char* father_type,
+static void instr_user_variable(double time, const char* resource, const char* variable_name, const char* parent_type,
double value, InstrUserVariable what, const char* color,
std::set<std::string, std::less<>>* filter)
{
if (what == InstrUserVariable::DECLARE) {
if (created == filter->end()) { // not declared yet
filter->insert(variable_name);
- instr_new_user_variable_type(father_type, variable_name, color == nullptr ? "" : color);
+ instr_new_user_variable_type(parent_type, variable_name, color == nullptr ? "" : color);
}
}else{
if (created != filter->end()) { // declared, let's work
}
}
-static void instr_user_srcdst_variable(double time, const char *src, const char *dst, const char *variable,
- const char *father_type, double value, InstrUserVariable what)
+static void instr_user_srcdst_variable(double time, const char* src, const char* dst, const char* variable,
+ const char* parent_type, double value, InstrUserVariable what)
{
const simgrid::kernel::routing::NetPoint* src_elm = sg_netpoint_by_name_or_null(src);
xbt_assert(src_elm, "Element '%s' not found!", src);
std::vector<simgrid::kernel::resource::LinkImpl*> route;
simgrid::kernel::routing::NetZoneImpl::get_global_route(src_elm, dst_elm, route, nullptr);
for (auto const& link : route)
- instr_user_variable(time, link->get_cname(), variable, father_type, value, what, nullptr, &user_link_variables);
+ instr_user_variable(time, link->get_cname(), variable, parent_type, value, what, nullptr, &user_link_variables);
}
/** @ingroup TRACE_API
Container* Container::root_container_ = nullptr; /* the root container */
std::map<std::string, Container*, std::less<>> Container::all_containers_; /* all created containers indexed by name */
-NetZoneContainer::NetZoneContainer(const std::string& name, unsigned int level, NetZoneContainer* father)
- : Container::Container(name, "", father)
+NetZoneContainer::NetZoneContainer(const std::string& name, unsigned int level, NetZoneContainer* parent)
+ : Container::Container(name, "", parent)
{
xbt_assert(s4u::Engine::get_instance()->netpoint_by_name_or_null(get_name()), "Element '%s' not found", get_cname());
- if (father_) {
+ if (parent_) {
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});
+ type_ = parent_->type_->by_name_or_create<ContainerType>(type_name);
+ parent_->children_.insert({get_name(), this});
on_creation(*this);
} else {
type_ = new ContainerType("0");
}
}
-RouterContainer::RouterContainer(const std::string& name, Container* father)
- : Container::Container(name, "ROUTER", father)
+RouterContainer::RouterContainer(const std::string& name, Container* parent)
+ : Container::Container(name, "ROUTER", parent)
{
- xbt_assert(father, "Only the Root container has no father");
+ xbt_assert(parent, "Only the Root container has no parent");
xbt_assert(s4u::Engine::get_instance()->netpoint_by_name_or_null(get_name()), "Element '%s' not found", get_cname());
}
-HostContainer::HostContainer(s4u::Host const& host, NetZoneContainer* father)
- : Container::Container(host.get_name(), "HOST", father)
+HostContainer::HostContainer(s4u::Host const& host, NetZoneContainer* parent)
+ : Container::Container(host.get_name(), "HOST", parent)
{
- xbt_assert(father, "Only the Root container has no father");
+ xbt_assert(parent, "Only the Root container has no parent");
xbt_assert(host.get_netpoint(), "Element '%s' not found", host.get_cname());
}
-Container::Container(const std::string& name, const std::string& type_name, Container* father)
- : name_(name), father_(father)
+Container::Container(const std::string& name, const std::string& type_name, Container* parent)
+ : name_(name), parent_(parent)
{
static long long int container_id = 0;
id_ = container_id; // id (or alias) of the container
container_id++;
- if (father_) {
- XBT_DEBUG("new container %s, child of %s", get_cname(), father->get_cname());
+ if (parent_) {
+ XBT_DEBUG("new container %s, child of %s", get_cname(), parent->get_cname());
if (not type_name.empty()) {
- type_ = father_->type_->by_name_or_create<ContainerType>(type_name);
- father_->children_.insert({name_, this});
+ type_ = parent_->type_->by_name_or_create<ContainerType>(type_name);
+ parent_->children_.insert({name_, this});
on_creation(*this);
}
}
void Container::remove_from_parent()
{
- if (father_) {
- XBT_DEBUG("removeChildContainer (%s) FromContainer (%s) ", get_cname(), father_->get_cname());
- father_->children_.erase(name_);
+ if (parent_) {
+ XBT_DEBUG("removeChildContainer (%s) FromContainer (%s) ", get_cname(), parent_->get_cname());
+ parent_->children_.erase(name_);
}
delete this;
}
return static_cast<VariableType*>(type_->by_name(name)->set_calling_container(this));
}
-EntityValue::EntityValue(const std::string& name, const std::string& color, Type* father)
- : name_(name), color_(color), father_(father)
+EntityValue::EntityValue(const std::string& name, const std::string& color, Type* parent)
+ : name_(name), color_(color), parent_(parent)
{
on_creation(*this);
}
static xbt::signal<void(Container const&)> on_creation;
static xbt::signal<void(Container const&)> on_destruction;
- explicit Container(const std::string& name, const std::string& type_name, Container* father);
+ explicit Container(const std::string& name, const std::string& type_name, Container* parent);
Container(const Container&) = delete;
Container& operator=(const Container&) = delete;
virtual ~Container();
Type* type_; /* Type of this container */
- Container* father_;
+ Container* parent_;
std::map<std::string, Container*, std::less<>> children_;
static Container* by_name_or_null(const std::string& name);
class NetZoneContainer : public Container {
public:
- NetZoneContainer(const std::string& name, unsigned int level, NetZoneContainer* father);
+ NetZoneContainer(const std::string& name, unsigned int level, NetZoneContainer* parent);
};
class RouterContainer : public Container {
public:
- RouterContainer(const std::string& name, Container* father);
+ RouterContainer(const std::string& name, Container* parent);
};
class HostContainer : public Container {
public:
- HostContainer(s4u::Host const& host, NetZoneContainer* father);
+ HostContainer(s4u::Host const& host, NetZoneContainer* parent);
};
} // namespace instr
} // namespace simgrid
}
Type::Type(PajeEventType event_type, const std::string& name, const std::string& alias, const std::string& color,
- Type* father)
- : name_(name), color_(color), father_(father)
+ Type* parent)
+ : name_(name), color_(color), parent_(parent)
{
if (name_.empty() || alias.empty())
throw TracingError(XBT_THROW_POINT, "can't create a new type with no name or alias");
- if (father != nullptr){
- father->children_[alias].reset(this);
- XBT_DEBUG("new type %s, child of %s", get_cname(), father->get_cname());
+ if (parent != nullptr) {
+ parent->children_[alias].reset(this);
+ XBT_DEBUG("new type %s, child of %s", get_cname(), parent->get_cname());
on_creation(*this, event_type);
}
}
}
}
if (ret == nullptr)
- throw TracingError(XBT_THROW_POINT, xbt::string_printf("type with name (%s) not found in father type (%s)",
+ throw TracingError(XBT_THROW_POINT, xbt::string_printf("type with name (%s) not found in parent type (%s)",
name.c_str(), get_cname()));
return ret;
}
{
auto ret = values_.find(name);
if (ret == values_.end()) {
- throw TracingError(XBT_THROW_POINT, xbt::string_printf("value with name (%s) not found in father type (%s)",
+ throw TracingError(XBT_THROW_POINT, xbt::string_printf("value with name (%s) not found in parent type (%s)",
name.c_str(), get_cname()));
}
return &ret->second;
long long int id_ = new_paje_id();
std::string name_;
std::string color_;
- Type* father_;
+ Type* parent_;
std::map<std::string, std::unique_ptr<Type>, std::less<>> children_;
Container* issuer_ = nullptr;
static xbt::signal<void(Type const&, PajeEventType event_type)> on_creation;
Type(PajeEventType event_type, const std::string& name, const std::string& alias, const std::string& color,
- Type* father);
+ Type* parent);
virtual ~Type() = default;
long long int get_id() const { return id_; }
const std::string& get_name() const { return name_; }
const char* get_cname() const { return name_.c_str(); }
const std::string& get_color() const { return color_; }
- Type* get_father() const { return father_; }
+ Type* get_parent() const { return parent_; }
const std::map<std::string, std::unique_ptr<Type>, std::less<>>& get_children() const { return children_; }
bool is_colored() const { return not color_.empty(); }
class ContainerType : public Type {
public:
explicit ContainerType(const std::string& name) : Type(PajeEventType::DefineContainerType, name, name, "", nullptr){};
- ContainerType(const std::string& name, Type* father)
- : Type(PajeEventType::DefineContainerType, name, name, "", father){};
+ ContainerType(const std::string& name, Type* parent)
+ : Type(PajeEventType::DefineContainerType, name, name, "", parent){};
};
class VariableType : public Type {
std::vector<VariableEvent*> events_;
public:
- VariableType(const std::string& name, const std::string& color, Type* father)
- : Type(PajeEventType::DefineVariableType, name, name, color, father)
+ VariableType(const std::string& name, const std::string& color, Type* parent)
+ : Type(PajeEventType::DefineVariableType, name, name, color, parent)
{
}
void instr_event(double now, double delta, const char* resource, double value);
class ValueType : public Type {
public:
std::map<std::string, EntityValue, std::less<>> values_;
- ValueType(PajeEventType event_type, const std::string& name, const std::string& alias, Type* father)
- : Type(event_type, name, alias, "", father){};
- ValueType(PajeEventType event_type, const std::string& name, Type* father)
- : Type(event_type, name, name, "", father){};
+ ValueType(PajeEventType event_type, const std::string& name, const std::string& alias, Type* parent)
+ : Type(event_type, name, alias, "", parent){};
+ ValueType(PajeEventType event_type, const std::string& name, Type* parent)
+ : Type(event_type, name, name, "", parent){};
void add_entity_value(const std::string& name, const std::string& color);
void add_entity_value(const std::string& name);
EntityValue* get_entity_value(const std::string& name);
class LinkType : public ValueType {
public:
static xbt::signal<void(LinkType const&, Type const&, Type const&)> on_creation;
- LinkType(const std::string& name, const Type* source, const Type* dest, const std::string& alias, Type* father)
- : ValueType(PajeEventType::DefineLinkType, name, alias, father)
+ LinkType(const std::string& name, const Type* source, const Type* dest, const std::string& alias, Type* parent)
+ : ValueType(PajeEventType::DefineLinkType, name, alias, parent)
{
on_creation(*this, *source, *dest);
}
class EventType : public ValueType {
public:
- EventType(const std::string& name, Type* father) : ValueType(PajeEventType::DefineEventType, name, father) {}
+ EventType(const std::string& name, Type* parent) : ValueType(PajeEventType::DefineEventType, name, parent) {}
};
class StateType : public ValueType {
std::vector<StateEvent*> events_;
public:
- StateType(const std::string& name, Type* father) : ValueType(PajeEventType::DefineStateType, name, father) {}
+ StateType(const std::string& name, Type* parent) : ValueType(PajeEventType::DefineStateType, name, parent) {}
void set_event(const std::string& value_name);
void push_event(const std::string& value_name);
void push_event(const std::string& value_name, TIData* extra);
long long int id_ = new_paje_id();
std::string name_;
std::string color_;
- Type* father_;
+ Type* parent_;
public:
static xbt::signal<void(const EntityValue&)> on_creation;
- explicit EntityValue(const std::string& name, const std::string& color, Type* father);
+ explicit EntityValue(const std::string& name, const std::string& color, Type* parent);
long long int get_id() const { return id_; }
std::string get_name() const { return name_; }
const char* get_cname() const { return name_.c_str(); }
std::string get_color() const { return color_; }
- Type* get_father() const { return father_; }
+ Type* get_parent() const { return parent_; }
};
} // namespace instr
} // namespace simgrid
const simgrid::instr::Container* a2)
{
// this is only an optimization (since most of a1 and a2 share the same parent)
- if (a1->father_ == a2->father_)
- return a1->father_;
+ if (a1->parent_ == a2->parent_)
+ return a1->parent_;
// create an array with all ancestors of a1
std::vector<simgrid::instr::Container*> ancestors_a1;
- for (auto* p = a1->father_; p != nullptr; p = p->father_)
+ for (auto* p = a1->parent_; p != nullptr; p = p->parent_)
ancestors_a1.push_back(p);
// create an array with all ancestors of a2
std::vector<simgrid::instr::Container*> ancestors_a2;
- for (auto* p = a2->father_; p != nullptr; p = p->father_)
+ for (auto* p = a2->parent_; p != nullptr; p = p->parent_)
ancestors_a2.push_back(p);
// find the lowest ancestor
return;
}
- // find common father
- simgrid::instr::Container* father = lowestCommonAncestor(src, dst);
- xbt_assert(father, "common father unknown, this is a tracing problem");
+ // find common parent
+ simgrid::instr::Container* parent = lowestCommonAncestor(src, dst);
+ xbt_assert(parent, "common parent unknown, this is a tracing problem");
// check if we already register this pair (we only need one direction)
std::string aux1 = src->get_name() + dst->get_name();
filter->insert(aux2);
// declare type
- std::string link_typename = father->type_->get_name() + "-" + src->type_->get_name() +
+ std::string link_typename = parent->type_->get_name() + "-" + src->type_->get_name() +
std::to_string(src->type_->get_id()) + "-" + dst->type_->get_name() +
std::to_string(dst->type_->get_id());
- simgrid::instr::LinkType* link = father->type_->by_name_or_create(link_typename, src->type_, dst->type_);
- link->set_calling_container(father);
+ simgrid::instr::LinkType* link = parent->type_->by_name_or_create(link_typename, src->type_, dst->type_);
+ link->set_calling_container(parent);
// create the link
static long long counter = 0;
recursiveNewVariableType(new_typename, color, simgrid::instr::Container::get_root()->type_);
}
-static void recursiveNewUserVariableType(const std::string& father_type, const std::string& new_typename,
+static void recursiveNewUserVariableType(const std::string& parent_type, const std::string& new_typename,
const std::string& color, simgrid::instr::Type* root)
{
- if (root->get_name() == father_type) {
+ if (root->get_name() == parent_type) {
root->by_name_or_create(new_typename, color);
}
for (auto const& elm : root->get_children())
- recursiveNewUserVariableType(father_type, new_typename, color, elm.second.get());
+ recursiveNewUserVariableType(parent_type, new_typename, color, elm.second.get());
}
-void instr_new_user_variable_type(const std::string& father_type, const std::string& new_typename,
+void instr_new_user_variable_type(const std::string& parent_type, const std::string& new_typename,
const std::string& color)
{
- recursiveNewUserVariableType(father_type, new_typename, color, simgrid::instr::Container::get_root()->type_);
+ recursiveNewUserVariableType(parent_type, new_typename, color, simgrid::instr::Container::get_root()->type_);
}
-static void recursiveNewUserStateType(const std::string& father_type, const std::string& new_typename,
+static void recursiveNewUserStateType(const std::string& parent_type, const std::string& new_typename,
simgrid::instr::Type* root)
{
- if (root->get_name() == father_type)
+ if (root->get_name() == parent_type)
root->by_name_or_create<simgrid::instr::StateType>(new_typename);
for (auto const& elm : root->get_children())
- recursiveNewUserStateType(father_type, new_typename, elm.second.get());
+ recursiveNewUserStateType(parent_type, new_typename, elm.second.get());
}
-void instr_new_user_state_type(const std::string& father_type, const std::string& new_typename)
+void instr_new_user_state_type(const std::string& parent_type, const std::string& new_typename)
{
- recursiveNewUserStateType(father_type, new_typename, simgrid::instr::Container::get_root()->type_);
+ recursiveNewUserStateType(parent_type, new_typename, simgrid::instr::Container::get_root()->type_);
}
static void recursiveNewValueForUserStateType(const std::string& type_name, const char* val, const std::string& color,
/* instr_paje.c */
void instr_new_variable_type(const std::string& new_typename, const std::string& color);
-void instr_new_user_variable_type(const std::string& father_type, const std::string& new_typename,
+void instr_new_user_variable_type(const std::string& parent_type, const std::string& new_typename,
const std::string& color);
-void instr_new_user_state_type(const std::string& father_type, const std::string& new_typename);
+void instr_new_user_state_type(const std::string& parent_type, const std::string& new_typename);
void instr_new_value_for_user_state_type(const std::string& new_typename, const char* value, const std::string& color);
XBT_PRIVATE void TRACE_help();
void TRACE_smpi_setup_container(aid_t pid, const_sg_host_t host)
{
- auto* father = simgrid::instr::Container::get_root();
+ auto* parent = simgrid::instr::Container::get_root();
if (TRACE_smpi_is_grouped()) {
- father = simgrid::instr::Container::by_name_or_null(host->get_name());
- xbt_assert(father != nullptr, "Could not find a parent for mpi rank 'rank-%ld' at function %s", pid, __func__);
+ parent = simgrid::instr::Container::by_name_or_null(host->get_name());
+ xbt_assert(parent != nullptr, "Could not find a parent for mpi rank 'rank-%ld' at function %s", pid, __func__);
}
- father->create_child(std::string("rank-") + std::to_string(pid), "MPI"); // This container is of type MPI
+ parent->create_child(std::string("rank-") + std::to_string(pid), "MPI"); // This container is of type MPI
}
void TRACE_smpi_init(aid_t pid, const std::string& calling_func)