#include <stdlib.h>
#include "simdag/simdag.h"
#include "xbt/ex.h"
+#include "xbt/log.h"
XBT_LOG_NEW_DEFAULT_CATEGORY(sd_test,
"Logging specific to this SimDag example");
/* initialisation of SD */
SD_init(&argc, argv);
+ /* xbt_log_control_set("sd.thres=debug");*/
+
if (argc < 2) {
INFO1("Usage: %s platform_file", argv[0]);
INFO1("example: %s sd_platform.xml", argv[0]);
SD_task_dependency_add(NULL, NULL, taskD, taskC);
/* SD_task_dependency_add(NULL, NULL, taskA, taskD); /\* deadlock */
- /* watch points */
- /* SD_task_watch(taskB, SD_DONE);*/
-
-
/* let's launch the simulation! */
int workstation_number = 2;
SD_task_t *changed_tasks;
int i;
- changed_tasks = SD_simulate(100);
+ changed_tasks = SD_simulate(0.001);
while (changed_tasks[0] != NULL) {
INFO0("Tasks whose state has changed:");
* 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
+ * \param how_long maximum duration of the simulation (a negative value means no time limit)
* \return a NULL-terminated array of \ref SD_task_t whose state has changed.
* \see SD_task_schedule(), SD_task_watch()
*/
/* main loop */
elapsed_time = 0.0;
- while (elapsed_time >= 0.0 && total_time < how_long && !sd_global->watch_point_reached) {
+ while (elapsed_time >= 0.0 &&
+ (how_long < 0.0 || total_time < how_long) &&
+ !sd_global->watch_point_reached) {
+
+ DEBUG1("Total time: %f", total_time);
elapsed_time = surf_solve();
if (elapsed_time > 0.0)