X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/e15ca5d1e67d57089929ff45a6d066d9440e38dd..a46dc2e1f51658a842b4df3e689bd7f6c49986fe:/src/surf/cpu_ti.cpp?ds=inline diff --git a/src/surf/cpu_ti.cpp b/src/surf/cpu_ti.cpp index 519bf989b2..08960f094c 100644 --- a/src/surf/cpu_ti.cpp +++ b/src/surf/cpu_ti.cpp @@ -8,8 +8,7 @@ #include "src/surf/trace_mgr.hpp" #include "surf/surf.hpp" -#ifndef SURF_MODEL_CPUTI_H_ -#define SURF_MODEL_CPUTI_H_ +#define EPSILON 0.000000001 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_cpu_ti, surf_cpu, "Logging specific to the SURF CPU TRACE INTEGRATION module"); @@ -292,21 +291,22 @@ int CpuTiTrace::binary_search(double* array, double a, int low, int high) /********* * Model * *********/ +namespace simgrid { +namespace surf { -void surf_cpu_model_init_ti() +void CpuTiModel::create_pm_vm_models() { - xbt_assert(not surf_cpu_model_pm, "CPU model already initialized. This should not happen."); - xbt_assert(not surf_cpu_model_vm, "CPU model already initialized. This should not happen."); + xbt_assert(surf_cpu_model_pm == nullptr, "CPU model already initialized. This should not happen."); + xbt_assert(surf_cpu_model_vm == nullptr, "CPU model already initialized. This should not happen."); surf_cpu_model_pm = new simgrid::surf::CpuTiModel(); - all_existing_models->push_back(surf_cpu_model_pm); - surf_cpu_model_vm = new simgrid::surf::CpuTiModel(); - all_existing_models->push_back(surf_cpu_model_vm); } -namespace simgrid { -namespace surf { +CpuTiModel::CpuTiModel() : CpuModel(Model::UpdateAlgo::FULL) +{ + all_existing_models->push_back(this); +} CpuTiModel::~CpuTiModel() { @@ -673,5 +673,3 @@ double CpuTiAction::get_remains() } } - -#endif /* SURF_MODEL_CPUTI_H_ */