void route_to(const Host* dest, std::vector<Link*>& links, double* latency) const;
void route_to(const Host* dest, std::vector<kernel::resource::LinkImpl*>& links, double* latency) const;
+ /**
+ * @brief Seal this host
+ * No more configuration is allowed after the seal
+ */
+ void seal();
+
#ifndef DOXYGEN
XBT_ATTRIB_DEPRECATED_v331("Please use Comm::sendto()") void sendto(Host* dest, double byte_amount);
auto* res = (new surf::HostImpl(name))->get_iface();
res->set_netpoint((new NetPoint(name, NetPoint::Type::Host))->set_englobing_zone(this));
- cpu_model_pm_->create_cpu(res, speed_per_pstate)->set_core_count(core_amount)->seal();
+ cpu_model_pm_->create_cpu(res, speed_per_pstate)->set_core_count(core_amount);
return res;
}
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);
this_actor::exec_init(flops)->set_priority(1 / priority)->vetoable_start()->wait();
}
+void Host::seal()
+{
+ kernel::actor::simcall([this]() { this->pimpl_cpu->seal(); });
+ kernel::actor::simcall([this]() { this->pimpl_->seal(); });
+}
+
} // namespace s4u
} // namespace simgrid
position++;
}
}
+
+void HostImpl::seal()
+{
+ sealed_ = true;
+}
} // namespace surf
} // namespace simgrid
s4u::Host piface_;
std::vector<kernel::resource::DiskImpl*> disks_;
xbt::string name_{"noname"};
+ bool sealed_ = false;
protected:
virtual ~HostImpl(); // Use destroy() instead of this destructor.
void remove_actor(kernel::actor::ActorImpl* actor) { xbt::intrusive_erase(actor_list_, *actor); }
void add_actor_at_boot(kernel::actor::ProcessArg* arg) { actors_at_boot_.emplace_back(arg); }
+ void seal();
+
template <class F> void foreach_actor(F function)
{
for (auto& actor : actor_list_)
if (not args->coord.empty())
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
host->set_state_profile(peer->state_trace);
if (peer->speed_trace)
host->set_speed_profile(peer->speed_trace);
+ host->seal();
simgrid::s4u::Host::on_creation(*host); // notify the signal
}