-/* Copyright (c) 2006, 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2006-2015. The SimGrid Team.
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
#include <stdio.h>
#include <stdlib.h>
-#include "simdag/simdag.h"
+#include "simgrid/simdag.h"
#include "xbt/ex.h"
#include "xbt/log.h"
double rate = -1.0;
SD_workstation_t w1, w2;
- /* initialisation of SD */
+ /* SD initialization */
SD_init(&argc, argv);
/* xbt_log_control_set("sd.thres=debug"); */
&(computation_amount[1]), SD_SCHED_NO_COST, rate);
/* let's launch the simulation! */
- while (xbt_dynar_length(changed_tasks = SD_simulate(-1.0)) > 0) {
+ while (!xbt_dynar_is_empty(changed_tasks = SD_simulate(-1.0))) {
for (i = 0; i < 2; i++) {
task = SD_workstation_get_current_task(workstations[i]);
if (task)
}
xbt_dynar_free_container(&changed_tasks);
}
+ xbt_dynar_free_container(&changed_tasks);
XBT_DEBUG("Destroying tasks...");