Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
add boolean state to resources and protect set_core_count
[simgrid.git] / src / surf / cpu_interface.cpp
index 823c219..a15bc1f 100644 (file)
@@ -96,6 +96,7 @@ void Cpu::on_speed_change()
 
 Cpu* Cpu::set_core_count(int core_count)
 {
+  xbt_assert(not is_sealed(), "Core count cannot be changed once CPU has been sealed");
   xbt_assert(core_count > 0, "Host %s must have at least one core, not 0.", piface_->get_cname());
   core_count_ = core_count;
   return this;
@@ -113,6 +114,11 @@ void Cpu::set_speed_profile(kernel::profile::Profile* profile)
   speed_.event = profile->schedule(&profile::future_evt_set, this);
 }
 
+void Cpu::seal()
+{
+  Resource::seal();
+}
+
 /**********
  * Action *
  **********/