Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
3ba784d51191797d1307c0e076a23f77d70389a1
[simgrid.git] / examples / simdag / dax / dax_test.c
1 /* simple test trying to load a DAX file.                                   */
2
3 /* Copyright (c) 2009 Da SimGrid Team. All rights reserved.                 */
4
5 /* This program is free software; you can redistribute it and/or modify it
6  * under the terms of the license (GNU LGPL) which comes with this package. */
7
8 #include <stdlib.h>
9 #include "simdag/simdag.h"
10 #include "xbt/log.h"
11
12 XBT_LOG_NEW_DEFAULT_CATEGORY(test,
13                              "Logging specific to this SimDag example");
14
15
16 int main(int argc, char **argv) {
17   xbt_dynar_t dax;
18   unsigned int cursor;
19   SD_task_t task;
20
21   /* initialisation of SD */
22   SD_init(&argc, argv);
23
24   /* Check our arguments */
25   if (argc < 3) {
26     INFO1("Usage: %s platform_file dax_file", argv[0]);
27     INFO1("example: %s ../sd_platform.xml Montage_50.xml", argv[0]);
28     exit(1);
29   }
30
31   /* creation of the environment */
32   SD_create_environment(argv[1]);
33
34   /* load the DAX file */
35   dax=SD_daxload(argv[2]);
36
37   /* Display all the tasks */
38   xbt_dynar_foreach(dax,cursor,task) {
39     SD_task_dump(task);
40   }
41   /* exit */
42   SD_exit();
43   return 1;
44 }