X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/9b73466ada27682d1729f394549479da83ef4a99..c054968af1d1cee9e7fc296d6b7f84cbb99b10ac:/examples/simdag/sd_comm_throttling.c diff --git a/examples/simdag/sd_comm_throttling.c b/examples/simdag/sd_comm_throttling.c index 1364f6e73a..260ef34874 100644 --- a/examples/simdag/sd_comm_throttling.c +++ b/examples/simdag/sd_comm_throttling.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2006-2010, 2012-2013. The SimGrid Team. +/* Copyright (c) 2006-2010, 2012-2015. The SimGrid Team. * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it @@ -6,7 +6,7 @@ #include #include -#include "simdag/simdag.h" +#include "simgrid/simdag.h" #include "xbt/ex.h" #include "xbt/log.h" @@ -26,11 +26,8 @@ int main(int argc, char **argv) /* xbt_log_control_set("sd.thres=debug"); */ - if (argc < 2) { - XBT_INFO("Usage: %s platform_file", argv[0]); - XBT_INFO("example: %s sd_platform.xml", argv[0]); - exit(1); - } + xbt_assert(argc > 1, "Usage: %s platform_file\n" + "\nExample: %s two_clusters.xml", argv[0], argv[0]); /* creation of the environment */ platform_file = argv[1]; @@ -74,12 +71,12 @@ int main(int argc, char **argv) /* let throttle the communication for taskD if its parent is SD_DONE */ /* the bandwidth is 1.25e8, the data size is 1e7, and we want to throttle * the bandwidth by a factor 2. the rate is then 1.25e8/(2*1e7)=6.25 + * Changing the rate is possible before the task execution starts (in SD_RUNNING + * state). */ - if (SD_task_get_state(taskC) == SD_DONE) + if (SD_task_get_state(taskC) == SD_DONE && SD_task_get_state(taskD) < SD_RUNNING) SD_task_set_rate(taskD, 6.25); - xbt_dynar_free_container(&changed_tasks); } - xbt_dynar_free_container(&changed_tasks); XBT_DEBUG("Destroying tasks...");