Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Autogenerated file
[simgrid.git] / teshsuite / simdag / basic3.c
1 #include <stdio.h>
2 #include <stdlib.h>
3 #include "simdag/simdag.h"
4
5 int main(int argc, char **argv) {
6
7         SD_task_t taskInit;
8     SD_task_t taskA;
9     SD_task_t taskFin;
10
11         /* scheduling parameters */
12
13     double no_cost[] = { 0.0, 0.0, 0.0, 0.0 };
14
15     /* initialisation of SD */
16     SD_init(&argc, argv);
17
18     /* creation of the environment */
19     SD_create_environment(argv[1]);
20
21     /* creation of the tasks and their dependencies */
22     taskInit = SD_task_create("Task Init",NULL,1.0);
23     taskA = SD_task_create("Task A", NULL, 1.0);
24     taskFin = SD_task_create("Task Fin", NULL, 1.0);
25
26     /* let's launch the simulation! */
27     SD_task_schedule(taskInit, 1, SD_workstation_get_list(), no_cost, no_cost, -1.0);
28     SD_task_schedule(taskA, 2, SD_workstation_get_list(), no_cost, no_cost, -1.0);
29     SD_task_schedule(taskFin, 1, SD_workstation_get_list(), no_cost, no_cost, -1.0);
30
31     SD_task_dependency_add(NULL, NULL, taskInit, taskA);
32     SD_task_dependency_add(NULL, NULL, taskA, taskFin);
33     
34     SD_simulate(-1.0);
35
36     SD_exit();
37     return 0;
38 }