From: Martin Quinson Date: Sun, 27 Aug 2017 22:23:23 +0000 (+0200) Subject: Merge branch 'master' of scm.gforge.inria.fr:/gitroot/simgrid/simgrid X-Git-Tag: v3_17~204 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/1847d1441271d076b3de449c8853031ea208ce8f?hp=-c Merge branch 'master' of scm.gforge.inria.fr:/gitroot/simgrid/simgrid --- 1847d1441271d076b3de449c8853031ea208ce8f diff --combined src/simix/smx_global.cpp index 2f8eac9704,1babc159c4..dd8daa8d6f --- a/src/simix/smx_global.cpp +++ b/src/simix/smx_global.cpp @@@ -54,13 -54,11 +54,13 @@@ std::unique_ptr callback; + s_smx_timer() = default; - s_smx_timer()=default; +public: + simgrid::xbt::Task callback; + double getDate() { return date; } s_smx_timer(double date, simgrid::xbt::Task callback) : date(date), callback(std::move(callback)) {} } s_smx_timer_t; @@@ -340,7 -338,7 +340,7 @@@ static void SIMIX_wake_processes( { surf_action_t action; - for(auto model : *all_existing_models) { + for (auto const& model : *all_existing_models) { XBT_DEBUG("Handling the processes whose action failed (if any)"); while ((action = surf_model_extract_failed_action_set(model))) { XBT_DEBUG(" Handling Action %p",action); @@@ -482,7 -480,7 +482,7 @@@ void SIMIX_run( * That would thus be a pure waste of time. */ - for (smx_actor_t process : simix_global->process_that_ran) { + for (smx_actor_t const& process : simix_global->process_that_ran) { if (process->simcall.call != SIMCALL_NONE) { SIMIX_simcall_handle(&process->simcall, 0); } @@@ -495,7 -493,7 +495,7 @@@ /* If only daemon processes remain, cancel their actions, mark them to die and reschedule them */ if (simix_global->process_list.size() == simix_global->daemons.size()) - for (const auto& dmon : simix_global->daemons) { + for (auto const& dmon : simix_global->daemons) { XBT_DEBUG("Kill %s", dmon->cname()); SIMIX_process_kill(dmon, simix_global->maestro_process); } @@@ -522,7 -520,7 +522,7 @@@ } while (again); /* Autorestart all process */ - for (auto host: host_that_restart) { + for (auto const& host : host_that_restart) { XBT_INFO("Restart processes on host %s", host->getCname()); SIMIX_host_autorestart(host); } @@@ -575,12 -573,12 +575,12 @@@ smx_timer_t SIMIX_timer_set(double date /** @brief cancels a timer that was added earlier */ void SIMIX_timer_remove(smx_timer_t timer) { - xbt_heap_rm_elm(simix_timers, timer, timer->date); + xbt_heap_rm_elm(simix_timers, timer, timer->getDate()); } /** @brief Returns the date at which the timer will trigger (or 0 if nullptr timer) */ double SIMIX_timer_get_date(smx_timer_t timer) { - return timer?timer->date:0; + return timer ? timer->getDate() : 0; } /** @@@ -629,7 -627,7 +629,7 @@@ void SIMIX_display_process_status( XBT_INFO("%d processes are still running, waiting for something.", nbprocess); /* List the process and their state */ XBT_INFO("Legend of the following listing: \"Process (@): \""); - for (auto kv : simix_global->process_list) { + for (auto const& kv : simix_global->process_list) { smx_actor_t process = kv.second; if (process->waiting_synchro) {