From: Martin Quinson Date: Sat, 30 Jan 2016 23:38:33 +0000 (+0100) Subject: [cpu_ti] small code untangling X-Git-Tag: v3_13~1030 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/a61cf9dabf627125ada5e55686ce7f8d57097c71?ds=sidebyside [cpu_ti] small code untangling --- 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 {