Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
don't know why this was still a struct
authorFrederic Suter <frederic.suter@cc.in2p3.fr>
Wed, 27 Nov 2019 12:16:59 +0000 (13:16 +0100)
committerFrederic Suter <frederic.suter@cc.in2p3.fr>
Wed, 27 Nov 2019 12:16:59 +0000 (13:16 +0100)
MANIFEST.in
include/simgrid/kernel/routing/NetZoneImpl.hpp
src/kernel/routing/NetZoneImpl.cpp
src/surf/sg_platf.cpp
src/surf/xml/platf_private.hpp

index af8fabf..fc4b1d2 100644 (file)
@@ -799,6 +799,8 @@ include teshsuite/simix/generic-simcalls/generic-simcalls.cpp
 include teshsuite/simix/generic-simcalls/generic-simcalls.tesh
 include teshsuite/simix/stack-overflow/stack-overflow.cpp
 include teshsuite/simix/stack-overflow/stack-overflow.tesh
+include teshsuite/smpi/auto-shared/auto-shared.c
+include teshsuite/smpi/auto-shared/auto-shared.tesh
 include teshsuite/smpi/bug-17132/bug-17132.c
 include teshsuite/smpi/bug-17132/bug-17132.tesh
 include teshsuite/smpi/coll-allgather/coll-allgather.c
index 8da6d42..4b07544 100644 (file)
@@ -60,7 +60,7 @@ public:
   s4u::NetZone* get_iface() { return &piface_; }
 
   /** @brief Make a host within that NetZone */
-  simgrid::s4u::Host* create_host(const char* name, const std::vector<double>& speed_per_pstate, int core_count,
+  simgrid::s4u::Host* create_host(const std::string& name, const std::vector<double>& speed_per_pstate, int core_count,
                                   const std::map<std::string, std::string>* props);
   /** @brief Creates a new route in this NetZone */
   virtual void add_bypass_route(NetPoint* src, NetPoint* dst, NetPoint* gw_src, NetPoint* gw_dst,
index ff8fe36..1fa9475 100644 (file)
@@ -92,7 +92,7 @@ int NetZoneImpl::get_host_count()
   return count;
 }
 
-simgrid::s4u::Host* NetZoneImpl::create_host(const char* name, const std::vector<double>& speed_per_pstate,
+simgrid::s4u::Host* NetZoneImpl::create_host(const std::string& name, const std::vector<double>& speed_per_pstate,
                                              int coreAmount, const std::map<std::string, std::string>* props)
 {
   simgrid::s4u::Host* res = new simgrid::s4u::Host(name);
index c86fbbb..318a719 100644 (file)
@@ -193,7 +193,7 @@ void sg_platf_new_cluster(simgrid::kernel::routing::ClusterCreationArgs* cluster
     XBT_DEBUG("<host\tid=\"%s\"\tpower=\"%f\">", host_id.c_str(), cluster->speeds.front());
 
     simgrid::kernel::routing::HostCreationArgs host;
-    host.id = host_id.c_str();
+    host.id = host_id;
     if ((cluster->properties != nullptr) && (not cluster->properties->empty())) {
       host.properties = new std::unordered_map<std::string, std::string>;
 
@@ -316,7 +316,7 @@ void sg_platf_new_cabinet(simgrid::kernel::routing::CabinetCreationArgs* cabinet
     simgrid::kernel::routing::HostCreationArgs host;
     host.pstate           = 0;
     host.core_amount      = 1;
-    host.id               = hostname.c_str();
+    host.id               = hostname;
     host.speed_per_pstate.push_back(cabinet->speed);
     sg_platf_new_host(&host);
 
@@ -501,7 +501,7 @@ void sg_platf_new_peer(simgrid::kernel::routing::PeerCreationArgs* peer)
 
   std::vector<double> speed_per_pstate;
   speed_per_pstate.push_back(peer->speed);
-  simgrid::s4u::Host* host = as->create_host(peer->id.c_str(), speed_per_pstate, 1, nullptr);
+  simgrid::s4u::Host* host = as->create_host(peer->id, speed_per_pstate, 1, nullptr);
 
   as->set_peer_link(host->get_netpoint(), peer->bw_in, peer->bw_out, peer->coord);
 
index 23ce827..af6afba 100644 (file)
@@ -32,8 +32,9 @@ namespace routing {
  * used, instead of malloced structures.
  */
 
-struct HostCreationArgs {
-  const char* id = nullptr;
+class HostCreationArgs {
+public:
+  std::string id;
   std::vector<double> speed_per_pstate;
   int pstate               = 0;
   int core_amount          = 0;