Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
STUPID ME. Don't die awfully when pals shutdown there sockets properly. Shame, shame
[simgrid.git] / testsuite / simdag / sd_test.c
1 #include <stdio.h>
2 #include <stdlib.h>
3 #include "simdag/simdag.h"
4
5 int main(int argc, char **argv) {
6   
7   /* No deployment file
8   if (argc < 3) {
9      printf ("Usage: %s platform_file deployment_file\n", argv[0]);
10      printf ("example: %s msg_platform.xml msg_deployment.xml\n", argv[0]);
11      exit(1);
12   }
13   */
14
15   if (argc < 2) {
16      printf ("Usage: %s platform_file\n", argv[0]);
17      printf ("example: %s msg_platform.xml\n", argv[0]);
18      exit(1);
19   }
20
21   /* initialisation of SD */
22   SD_init(&argc, argv);
23
24   /* creation of the environment */
25   char * platform_file = argv[1];
26   SD_create_environment(platform_file);
27
28   /* creation of the tasks and their dependencies */
29   SD_task_t task1 = SD_task_create("Task 1", NULL, 10.0);
30
31   /* watch points */
32   SD_task_watch(task1, SD_SCHEDULED);
33   SD_task_watch(task1, SD_DONE);
34   SD_task_unwatch(task1, SD_SCHEDULED);
35   SD_task_watch(task1, SD_DONE);
36   SD_task_watch(task1, SD_SCHEDULED);
37   
38   /* let's launch the simulation! */
39   SD_simulate(100);
40
41   SD_task_destroy(task1);
42   SD_exit();
43   return 0;
44 }