1 /* Copyright (c) 2007, 2008 The SimGrid Team. All rights reserved. */
3 /* This program is free software; you can redistribute it and/or modify it
4 * under the terms of the license (GNU LGPL) which comes with this package. */
8 #include "simdag/simdag.h"
10 int main(int argc, char **argv)
17 /* scheduling parameters */
19 double communication_amount1[] = { 0, 100000000, 0, 0 };
20 double communication_amount2[] = { 0, 1, 0, 0 };
21 const double no_cost[] = { 0.0, 0.0 };
23 /* initialisation of SD */
26 /* creation of the environment */
27 SD_create_environment(argv[1]);
29 /* creation of the tasks and their dependencies */
30 taskInit = SD_task_create("Init", NULL, 1.0);
31 taskA = SD_task_create("Task Comm 1", NULL, 1.0);
32 taskB = SD_task_create("Task Comm 2", NULL, 1.0);
37 /* let's launch the simulation! */
39 SD_task_schedule(taskInit, 1, SD_workstation_get_list(), no_cost, no_cost,
41 SD_task_schedule(taskA, 2, SD_workstation_get_list(), no_cost,
42 communication_amount1, -1.0);
43 SD_task_schedule(taskB, 2, SD_workstation_get_list(), no_cost,
44 communication_amount2, -1.0);
46 SD_task_dependency_add(NULL, NULL, taskInit, taskA);
47 SD_task_dependency_add(NULL, NULL, taskInit, taskB);