Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Answer to Mt comments
authorFabien Chaix <chaix@ics.forth.gr>
Mon, 27 Jun 2022 06:35:01 +0000 (09:35 +0300)
committerFabien Chaix <chaix@ics.forth.gr>
Mon, 27 Jun 2022 06:35:01 +0000 (09:35 +0300)
ChangeLog
src/kernel/routing/NetZoneImpl.cpp
src/s4u/s4u_Host.cpp

index 5f1cbdf..8c942b8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -24,6 +24,12 @@ Platform description & visualization:
     demonstrates how we can generate a nice graphical representation of the
        platform.
 
+General: 
+  - Modified the host_by_name functions:
+    - Now, they return only hosts, not VMs, and in a much more efficient way.
+       - If one wants to find a VM by name, he now needs to know the host on
+       which it runs and call vm_by_name (or manually iterate over the list of hosts)
+
 Tools:
   - Enhancements to the graphicator tool:
        - Allow to dump the platform topology as a CSV file representing the edges
index ad56002..78a8584 100644 (file)
@@ -342,21 +342,9 @@ resource::SplitDuplexLinkImpl* NetZoneImpl::get_split_duplex_link_by_name_or_nul
 
 resource::HostImpl* NetZoneImpl::get_host_by_name_or_null(const std::string& name) const
 {
-
   auto host_it = hosts_.find(name);
   if(host_it != hosts_.end())
         return host_it->second;
-/*
-  for (auto const& [_, host] : hosts_) {
-    if (host->get_name() == name)
-       return host;
-    / * keep old behavior where host and VMs were saved together on EngineImpl::hosts_
-     * get hosts returns VMs too * /
-    auto* vm = host->get_vm_by_name_or_null(name);
-    if (vm)
-      return vm;
-  }
-*/
 
   for (const auto* child : children_) {
     auto* host = child->get_host_by_name_or_null(name);
index 420fb5d..237a129 100644 (file)
@@ -447,6 +447,7 @@ sg_host_t sg_host_by_name(const char* name)
   return simgrid::s4u::Host::by_name_or_null(name);
 }
 
+/** @brief Retrieve a VM running on a given host from its name, or return NULL if no VM matches*/
 sg_vm_t sg_vm_by_name(sg_host_t host, const char* name)
 {
   return host->vm_by_name_or_null(name);