X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/421c3ca52031a1c231fb91ec35dafa0e88050242..a61cf9dabf627125ada5e55686ce7f8d57097c71:/src/surf/cpu_ti.cpp diff --git a/src/surf/cpu_ti.cpp b/src/surf/cpu_ti.cpp index d30954206e..c50f2f87bd 100644 --- a/src/surf/cpu_ti.cpp +++ b/src/surf/cpu_ti.cpp @@ -385,17 +385,6 @@ int CpuTiTrace::binarySearch(double *array, double a, int low, int high) } } -/************* - * CallBacks * - *************/ - -static void cpu_ti_define_callbacks() -{ - simgrid::surf::on_postparse.connect([]() { - surf_cpu_model_pm->addTraces(); - }); -} - /********* * Model * *********/ @@ -406,13 +395,14 @@ void surf_cpu_model_init_ti() xbt_assert(!surf_cpu_model_vm,"CPU model already initialized. This should not happen."); surf_cpu_model_pm = new simgrid::surf::CpuTiModel(); + xbt_dynar_push(all_existing_models, &surf_cpu_model_pm); + surf_cpu_model_vm = new simgrid::surf::CpuTiModel(); + xbt_dynar_push(all_existing_models, &surf_cpu_model_vm); - cpu_ti_define_callbacks(); - simgrid::surf::Model *model_pm = static_cast(surf_cpu_model_pm); - simgrid::surf::Model *model_vm = static_cast(surf_cpu_model_vm); - xbt_dynar_push(all_existing_models, &model_pm); - xbt_dynar_push(all_existing_models, &model_vm); + simgrid::surf::on_postparse.connect([]() { + surf_cpu_model_pm->addTraces(); + }); } namespace simgrid {