Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
migrate actors_to_run and actors_that_ran to EngineImpl
[simgrid.git] / src / s4u / s4u_Host.cpp
index 72dcc0f..7005ea0 100644 (file)
@@ -134,7 +134,7 @@ std::vector<ActorPtr> Host::get_all_actors() const
 }
 
 /** @brief Returns how many actors (daemonized or not) have been launched on this host */
-int Host::get_actor_count() const
+size_t Host::get_actor_count() const
 {
   return pimpl_->get_actor_count();
 }
@@ -305,6 +305,12 @@ int Host::get_pstate() const
   return this->pimpl_cpu->get_pstate();
 }
 
+Host* Host::set_coordinates(const std::string& coords)
+{
+  if (not coords.empty())
+    kernel::actor::simcall([this, coords] { this->pimpl_netpoint_->set_coordinates(coords); });
+  return this;
+}
 std::vector<Disk*> Host::get_disks() const
 {
   return this->pimpl_->get_disks();
@@ -313,7 +319,9 @@ std::vector<Disk*> Host::get_disks() const
 Disk* Host::create_disk(const std::string& name, double read_bandwidth, double write_bandwidth)
 {
   return kernel::actor::simcall([this, &name, read_bandwidth, write_bandwidth] {
-    return this->pimpl_->create_disk(name, read_bandwidth, write_bandwidth);
+    auto* disk = pimpl_->create_disk(name, read_bandwidth, write_bandwidth);
+    pimpl_->add_disk(disk);
+    return disk;
   });
 }