Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
implement MPI_File_set_size
[simgrid.git] / src / surf / cpu_ti.cpp
index 5c24e9a55c1b527def272a6b70f1343d14a28c01..54756761f501579f1a94eb7cb31e372d3c276065 100644 (file)
@@ -139,12 +139,10 @@ double CpuTiTmgr::solve(double a, double amount) const
   }
 
   /* Sanity checks */
-  if ((a < 0.0) || (amount < 0.0)) {
-    XBT_CRITICAL("Error, invalid parameters [a = %.2f, amount = %.2f]. "
-                 "You probably have a task executing with negative computation amount. Check your code.",
-                 a, amount);
-    xbt_abort();
-  }
+  xbt_assert(a >= 0.0 && amount >= 0.0,
+             "Error, invalid parameters [a = %.2f, amount = %.2f]. "
+             "You probably have a task executing with negative computation amount. Check your code.",
+             a, amount);
 
   /* At this point, a and amount are positive */
   if (amount < EPSILON)
@@ -270,10 +268,10 @@ int CpuTiProfile::binary_search(const std::vector<double>& array, double a)
 
 void CpuTiModel::create_pm_vm_models()
 {
-  auto cpu_model_pm = std::make_unique<CpuTiModel>();
+  auto cpu_model_pm = std::make_shared<CpuTiModel>();
   simgrid::kernel::EngineImpl::get_instance()->add_model(simgrid::kernel::resource::Model::Type::CPU_PM,
                                                          std::move(cpu_model_pm), true);
-  auto cpu_model_vm = std::make_unique<CpuTiModel>();
+  auto cpu_model_vm = std::make_shared<CpuTiModel>();
   simgrid::kernel::EngineImpl::get_instance()->add_model(simgrid::kernel::resource::Model::Type::CPU_VM,
                                                          std::move(cpu_model_vm), true);
 }