From f771b7dfd7a18c6673fb803715ce052461c20574 Mon Sep 17 00:00:00 2001 From: donassbr Date: Tue, 1 Sep 2009 08:51:34 +0000 Subject: [PATCH] Move test of finish execution to after handling events. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@6644 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- src/surf/surf.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/surf/surf.c b/src/surf/surf.c index 7dba882dcf..20f24c4d10 100644 --- a/src/surf/surf.c +++ b/src/surf/surf.c @@ -384,13 +384,10 @@ double surf_solve(void) } DEBUG1("Next action end : %f", min); - if (min < 0.0) - return -1.0; - DEBUG0("Looking for next event"); while ((next_event_date = tmgr_history_next_date(history)) != -1.0) { DEBUG1("Next TRACE event : %f", next_event_date); - if (next_event_date > NOW + min) + if ((min != -1.0) && (next_event_date > NOW + min)) break; DEBUG0("Updating models"); while ((event = @@ -410,6 +407,12 @@ double surf_solve(void) } } + /* FIXME: Moved this test to here to avoid stoping simulation if there are actions running on cpus and all cpus are with availability = 0. + * This may cause an infinite loop if one cpu has a trace with periodicity = 0 and the other a trace with periodicity > 0. + * The options are: all traces with same periodicity(0 or >0) or we need to change the way how the events are managed */ + if (min < 0.0) + return -1.0; + DEBUG1("Duration set to %f", min); NOW = NOW + min; -- 2.20.1