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
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);
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);