Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Use get_cname() instead of name_.c_str().
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Wed, 13 Feb 2019 10:39:19 +0000 (11:39 +0100)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Wed, 13 Feb 2019 16:51:16 +0000 (17:51 +0100)
src/instr/instr_paje_containers.cpp
src/instr/instr_paje_types.cpp
src/kernel/activity/ExecImpl.cpp
src/kernel/activity/IoImpl.cpp
src/kernel/routing/NetZoneImpl.cpp
src/s4u/s4u_Host.cpp
src/simix/ActorImpl.cpp
src/simix/smx_global.cpp

index 17bff97..244c9d5 100644 (file)
@@ -78,7 +78,7 @@ Container::Container(std::string name, const std::string& type_name, Container*
   container_id++;
 
   if (father_) {
-    XBT_DEBUG("new container %s, child of %s", name.c_str(), father->name_.c_str());
+    XBT_DEBUG("new container %s, child of %s", get_cname(), father->get_cname());
 
     if (not type_name.empty()) {
       type_ = father_->type_->by_name_or_create<ContainerType>(type_name);
@@ -89,9 +89,9 @@ Container::Container(std::string name, const std::string& type_name, Container*
 
   //register all kinds by name
   if (not allContainers.emplace(name_, this).second)
-    THROWF(tracing_error, 1, "container %s already present in allContainers data structure", name_.c_str());
+    THROWF(tracing_error, 1, "container %s already present in allContainers data structure", get_cname());
 
-  XBT_DEBUG("Add container name '%s'", name_.c_str());
+  XBT_DEBUG("Add container name '%s'", get_cname());
 
   //register NODE types for triva configuration
   if (type_name == "LINK")
@@ -100,7 +100,7 @@ Container::Container(std::string name, const std::string& type_name, Container*
 
 Container::~Container()
 {
-  XBT_DEBUG("destroy container %s", name_.c_str());
+  XBT_DEBUG("destroy container %s", get_cname());
   // Begin with destroying my own children
   for (auto child : children_)
     delete child.second;
index 9fb43d7..c08aea0 100644 (file)
@@ -23,7 +23,7 @@ Type::Type(std::string name, std::string alias, std::string color, Type* father)
 
   if (father != nullptr){
     father->children_.insert({std::move(alias), this});
-    XBT_DEBUG("new type %s, child of %s", name_.c_str(), father->get_cname());
+    XBT_DEBUG("new type %s, child of %s", get_cname(), father->get_cname());
   }
   if (trace_format == simgrid::instr::TraceFormat::Paje) {
     stream_ << std::fixed << std::setprecision(TRACE_precision());
index fbfe28c..83e7e88 100644 (file)
@@ -49,7 +49,7 @@ ExecImpl* ExecImpl::start(double flops_amount, double priority, double bound)
       surf_action_->set_bound(bound);
   }
 
-  XBT_DEBUG("Create execute synchro %p: %s", this, name_.c_str());
+  XBT_DEBUG("Create execute synchro %p: %s", this, get_cname());
   ExecImpl::on_creation(this);
   return this;
 }
index 7f8d60b..0f8a3ed 100644 (file)
@@ -32,7 +32,7 @@ IoImpl* IoImpl::start(sg_size_t size, simgrid::s4u::Io::OpType type)
   surf_action_ = storage_->io_start(size, type);
   surf_action_->set_data(this);
 
-  XBT_DEBUG("Create IO synchro %p %s", this, name_.c_str());
+  XBT_DEBUG("Create IO synchro %p %s", this, get_cname());
   simgrid::kernel::activity::IoImpl::on_start(this);
 
   return this;
index f61f9df..fc33fd2 100644 (file)
@@ -29,11 +29,11 @@ public:
 NetZoneImpl::NetZoneImpl(NetZoneImpl* father, std::string name, resource::NetworkModel* network_model)
     : network_model_(network_model), piface_(this), father_(father), name_(std::move(name))
 {
-  xbt_assert(nullptr == simgrid::s4u::Engine::get_instance()->netpoint_by_name_or_null(name_.c_str()),
-             "Refusing to create a second NetZone called '%s'.", name_.c_str());
+  xbt_assert(nullptr == simgrid::s4u::Engine::get_instance()->netpoint_by_name_or_null(get_name()),
+             "Refusing to create a second NetZone called '%s'.", get_cname());
 
   netpoint_ = new NetPoint(name_, NetPoint::Type::NetZone, father);
-  XBT_DEBUG("NetZone '%s' created with the id '%u'", name_.c_str(), netpoint_->id());
+  XBT_DEBUG("NetZone '%s' created with the id '%u'", get_cname(), netpoint_->id());
 }
 
 NetZoneImpl::~NetZoneImpl()
@@ -122,7 +122,7 @@ void NetZoneImpl::add_route(kernel::routing::NetPoint* /*src*/, kernel::routing:
                             kernel::routing::NetPoint* /*gw_src*/, kernel::routing::NetPoint* /*gw_dst*/,
                             std::vector<kernel::resource::LinkImpl*>& /*link_list*/, bool /*symmetrical*/)
 {
-  xbt_die("NetZone '%s' does not accept new routes (wrong class).", name_.c_str());
+  xbt_die("NetZone '%s' does not accept new routes (wrong class).", get_cname());
 }
 
 void NetZoneImpl::add_bypass_route(NetPoint* src, NetPoint* dst, NetPoint* gw_src, NetPoint* gw_dst,
index 5e6879c..95002ed 100644 (file)
@@ -31,7 +31,7 @@ simgrid::xbt::signal<void(Host&)> Host::on_speed_change;
 
 Host::Host(std::string name) : name_(std::move(name))
 {
-  xbt_assert(Host::by_name_or_null(name_) == nullptr, "Refusing to create a second host named '%s'.", name_.c_str());
+  xbt_assert(Host::by_name_or_null(name_) == nullptr, "Refusing to create a second host named '%s'.", get_cname());
   Engine::get_instance()->host_register(std::string(name_), this);
   new simgrid::surf::HostImpl(this);
 }
index 2a5262f..6d0d347 100644 (file)
@@ -148,7 +148,7 @@ void ActorImpl::exit()
       io->cancel();
     } else {
       simgrid::kernel::activity::ActivityImplPtr activity = waiting_synchro;
-      xbt_die("Activity %s is of unknown type %s", activity->name_.c_str(),
+      xbt_die("Activity %s is of unknown type %s", activity->get_cname(),
               simgrid::xbt::demangle(typeid(activity).name()).get());
     }
 
index c696cab..2056a85 100644 (file)
@@ -582,7 +582,7 @@ void SIMIX_display_process_status()
 
       XBT_INFO("Process %ld (%s@%s): waiting for %s synchro %p (%s) in state %d to finish", process->pid_,
                process->get_cname(), process->host_->get_cname(), synchro_description, process->waiting_synchro.get(),
-               process->waiting_synchro->name_.c_str(), (int)process->waiting_synchro->state_);
+               process->waiting_synchro->get_cname(), (int)process->waiting_synchro->state_);
     }
     else {
       XBT_INFO("Process %ld (%s@%s)", process->pid_, process->get_cname(), process->host_->get_cname());