From 06b7d3e4e520b44ecb753776c98df3204c32bc8f Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Wed, 22 Jul 2015 00:32:24 +0200 Subject: [PATCH] make simix more resilient to PEBKAC --- src/simix/smx_global.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/simix/smx_global.c b/src/simix/smx_global.c index f5ea654e2b..34918944e9 100644 --- a/src/simix/smx_global.c +++ b/src/simix/smx_global.c @@ -242,7 +242,14 @@ void SIMIX_clean(void) #endif if (cleaned) return; // to avoid double cleaning by java and C cleaned = 1; - /* Kill everyone (except maestro) */ + XBT_DEBUG("SIMIX_clean called. Simulation's over."); + if (!xbt_dynar_is_empty(simix_global->process_to_run) && SIMIX_get_clock() == 0.0) { + XBT_CRITICAL(" "); + XBT_CRITICAL("The time is still 0, and you still have processes ready to run."); + XBT_CRITICAL("It seems that you forgot to run the simulation that you setup."); + xbt_die("Bailing out to avoid that stop-before-start madness. Please fix your code."); + } + /* Kill all processes (but maestro) */ SIMIX_process_killall(simix_global->maestro_process, 1); /* Exit the SIMIX network module */ -- 2.20.1