X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/0f5e8daaa6e9f74521068aa75837200bcd182ea6..db76b8c2bb3acf20452613ccac46a9bee673f1b6:/src/simdag/sd_global.c diff --git a/src/simdag/sd_global.c b/src/simdag/sd_global.c index 17286094af..b84b7b1ef6 100644 --- a/src/simdag/sd_global.c +++ b/src/simdag/sd_global.c @@ -84,8 +84,13 @@ void SD_init(int *argc, char **argv) sd_global->task_number = 0; surf_init(argc, argv); + xbt_cfg_setdefault_string(_surf_cfg_set, "workstation/model", "ptask_L07"); + +#ifdef HAVE_TRACING + TRACE_start (); +#endif } /** @@ -196,8 +201,11 @@ void SD_create_environment(const char *platform_file) * \brief Launches the simulation. * * The function will execute the \ref SD_RUNNABLE runnable tasks. - * The simulation will be stopped when its time reaches \a how_long, - * when a watch point is reached, or when no more task can be executed. + * If \a how_long is positive, then the simulation will be stopped either + * when time reaches \a how_long or when a watch point is reached. + * A nonpositive value for \a how_long means no time limit, in which case + * the simulation will be stopped either when a watch point is reached or + * when no more task can be executed. * Then you can call SD_simulate() again. * * \param how_long maximum duration of the simulation (a negative value means no time limit) @@ -217,9 +225,9 @@ xbt_dynar_t SD_simulate(double how_long) SD_CHECK_INIT_DONE(); - VERB0("Starting simulation..."); + if (first_time) { + VERB0("Starting simulation..."); - if (first_time) { surf_presolve(); /* Takes traces into account */ first_time = 0; } @@ -336,7 +344,21 @@ xbt_dynar_t SD_simulate(double how_long) } } - VERB0("Simulation finished"); + if (!sd_global->watch_point_reached && how_long<0){ + if (xbt_swag_size(sd_global->done_task_set) < sd_global->task_number){ + WARN0("Simulation is finished but some tasks are still not done"); + xbt_swag_foreach_safe (task, task_safe,sd_global->not_scheduled_task_set){ + WARN1("%s is in SD_NOT_SCHEDULED state", SD_task_get_name(task)); + } + xbt_swag_foreach_safe (task, task_safe,sd_global->schedulable_task_set){ + WARN1("%s is in SD_SCHEDULABLE state", SD_task_get_name(task)); + } + xbt_swag_foreach_safe (task, task_safe,sd_global->scheduled_task_set){ + WARN1("%s is in SD_SCHEDULED state", SD_task_get_name(task)); + } + } + } + DEBUG3("elapsed_time = %f, total_time = %f, watch_point_reached = %d", elapsed_time, total_time, sd_global->watch_point_reached); DEBUG1("current time = %f", surf_get_clock()); @@ -403,6 +425,9 @@ void SD_exit(void) WARN0("SD_exit() called, but SimDag is not running"); /* we cannot use exceptions here because xbt is not running! */ } +#ifdef HAVE_TRACING + TRACE_end(); +#endif } /**