Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Forgot one free.
[simgrid.git] / teshsuite / simdag / platforms / is_router_test.c
1 /* Copyright (c) 2008, 2009, 2010. The SimGrid Team.
2  * All rights reserved.                                                     */
3
4 /* This program is free software; you can redistribute it and/or modify it
5  * under the terms of the license (GNU LGPL) which comes with this package. */
6
7 #include <stdio.h>
8 #include <stdlib.h>
9 #include "simdag/simdag.h"
10 #include "surf/surf_private.h"
11
12 extern routing_global_t global_routing;
13
14 int main(int argc, char **argv)
15 {
16   /* initialisation of SD */
17   int size;
18   xbt_dict_t eltms = xbt_dict_new();
19   SD_init(&argc, argv);
20   xbt_dict_cursor_t cursor = NULL;
21   char *key, *data;
22
23   /* creation of the environment */
24   SD_create_environment(argv[1]);
25
26   eltms = global_routing->where_network_elements;
27   size = xbt_dict_size(eltms);
28
29   printf("Workstation number: %d, link number: %d, elmts number: %d\n",
30          SD_workstation_get_number(), SD_link_get_number(), size);
31
32   xbt_dict_foreach(eltms, cursor, key, data) {
33     printf("   - Seen: \"%s\" is type : %d\n", key,
34            (int) global_routing->get_network_element_type(key));
35   }
36   SD_exit();
37   return 0;
38 }