From 575dd632d13eabe72bb54342bb4ae09049e251b6 Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Mon, 8 Feb 2016 00:28:12 +0100 Subject: [PATCH] cosmetics --- src/simix/smx_global.cpp | 12 +++++------- src/surf/surf_c_bindings.cpp | 5 +---- src/surf/surf_interface.cpp | 2 +- 3 files changed, 7 insertions(+), 12 deletions(-) diff --git a/src/simix/smx_global.cpp b/src/simix/smx_global.cpp index ac17f1b797..acc00af0fa 100644 --- a/src/simix/smx_global.cpp +++ b/src/simix/smx_global.cpp @@ -521,14 +521,12 @@ void SIMIX_run(void) } /* Autorestart all process */ - if(host_that_restart) { - char *hostname = NULL; - xbt_dynar_foreach(host_that_restart,iter,hostname) { - XBT_INFO("Restart processes on host: %s",hostname); - SIMIX_host_autorestart(sg_host_by_name(hostname)); - } - xbt_dynar_reset(host_that_restart); + char *hostname = NULL; + xbt_dynar_foreach(host_that_restart,iter,hostname) { + XBT_INFO("Restart processes on host: %s",hostname); + SIMIX_host_autorestart(sg_host_by_name(hostname)); } + xbt_dynar_reset(host_that_restart); /* Clean processes to destroy */ SIMIX_process_empty_trash(); diff --git a/src/surf/surf_c_bindings.cpp b/src/surf/surf_c_bindings.cpp index b8c4e970c4..a2a5dce66f 100644 --- a/src/surf/surf_c_bindings.cpp +++ b/src/surf/surf_c_bindings.cpp @@ -65,9 +65,6 @@ double surf_solve(double max_date) tmgr_trace_iterator_t event = NULL; unsigned int iter; - if(!host_that_restart) - host_that_restart = xbt_dynar_new(sizeof(char*), NULL); - if (max_date > 0.0) { xbt_assert(max_date > NOW,"You asked to simulate up to %f, but that's in the past already", max_date); @@ -124,7 +121,7 @@ double surf_solve(double max_date) while ((event = future_evt_set->pop_leq(next_event_date, &value, &resource))) { if (resource->isUsed() || xbt_dict_get_or_null(watched_hosts_lib, resource->getName())) { time_delta = next_event_date - NOW; - XBT_DEBUG("This event will modify model state. Next event set to %f", time_delta); + XBT_DEBUG("This event invalidates the next_occuring_event() computation of models. Next event set to %f", time_delta); } // FIXME: I'm too lame to update NOW live, so I change it and restore it so that the real update with surf_min will work double round_start = NOW; diff --git a/src/surf/surf_interface.cpp b/src/surf/surf_interface.cpp index fabd2d8ce2..dccea91c25 100644 --- a/src/surf/surf_interface.cpp +++ b/src/surf/surf_interface.cpp @@ -31,7 +31,7 @@ xbt_dynar_t model_list_invoke = NULL; /* to invoke callbacks */ simgrid::trace_mgr::future_evt_set *future_evt_set = nullptr; xbt_dynar_t surf_path = NULL; -xbt_dynar_t host_that_restart = NULL; +xbt_dynar_t host_that_restart = xbt_dynar_new(sizeof(char*), NULL); xbt_dict_t watched_hosts_lib; namespace simgrid { -- 2.20.1