Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge commit '045db1657e870c721be490b411868f4181a12ced' into surf++
[simgrid.git] / teshsuite / simdag / platforms / is_router_test.c
1 /* Copyright (c) 2008-2013. 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_platf_t routing_platf;
13
14 int main(int argc, char **argv)
15 {
16   /* initialisation of SD */
17   int size;
18   xbt_lib_cursor_t cursor = NULL;
19   char *key, *data;
20
21 #ifdef _XBT_WIN32
22   setbuf(stderr, NULL);
23   setbuf(stdout, NULL);
24 #endif
25
26   SD_init(&argc, argv);
27
28   /* creation of the environment */
29   SD_create_environment(argv[1]);
30
31   size = xbt_lib_length(host_lib) + xbt_lib_length(as_router_lib);
32
33   printf("Workstation number: %d, link number: %d, elmts number: %d\n",
34          SD_workstation_get_number(), SD_link_get_number(), size);
35
36   xbt_lib_foreach(host_lib, cursor, key, data) {
37     printf("   - Seen: \"%s\" is type : %d\n", key,
38            (int) routing_get_network_element_type(key));
39   }
40
41   xbt_lib_foreach(as_router_lib, cursor, key, data) {
42     printf("   - Seen: \"%s\" is type : %d\n", key,
43            (int) routing_get_network_element_type(key));
44   }
45
46   SD_exit();
47   return 0;
48 }