}
/* 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)
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);
}