static void on_host_creation(s4u::Host const& host)
{
+ if (Container::by_name_or_null(host.get_name())) // This host already exists, do nothing
+ return;
+
Container* container = new HostContainer(host, currentContainer.back());
const Container* root = Container::get_root();
->create_cpu(this, speeds)
->set_core_count(core_amount)
->seal();
+
if (physical_host->get_pstate() != 0)
set_pstate(physical_host->get_pstate());
seal(); // seal this host
-
- // Real hosts are (only) created through NetZone::create_host(), and this where the on_creation signal is fired.
- // VMs are created directly, thus firing the signal here. The right solution is probably to separate Host and VM.
- simgrid::s4u::Host::on_creation(*this);
}
VirtualMachine::~VirtualMachine()
void Host::seal()
{
kernel::actor::simcall([this]() { this->pimpl_->seal(); });
+ simgrid::s4u::Host::on_creation(*this); // notify the signal
}
} // namespace s4u
new simgrid::kernel::routing::vivaldi::Coords(host->get_netpoint(), args->coord);
host->seal();
- simgrid::s4u::Host::on_creation(*host); // notify the signal
/* When energy plugin is activated, changing the pstate requires to already have the HostEnergy extension whose
* allocation is triggered by the on_creation signal. Then set_pstate must be called after the signal emition */
if ((cluster->properties != nullptr) && (not cluster->properties->empty()))
host->set_properties(*cluster->properties);
host->seal();
- simgrid::s4u::Host::on_creation(*host); // notify the signal
XBT_DEBUG("</host>");
if (peer->speed_trace)
host->set_speed_profile(peer->speed_trace);
host->seal();
- simgrid::s4u::Host::on_creation(*host); // notify the signal
}
/**