Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
8fa78e792b7e297c7c30c910a61b239a78e9a087
[simgrid.git] / examples / amok / alnem / alnem_builder.c
1 /* ALNeM builder. Take an interference matrix as argument,                  */
2 /*  and reconstruct the corresponding graph itself                          */
3
4 /* Copyright (c) 2005, 2010. The SimGrid Team.
5  * All rights reserved.                                                     */
6
7 /* This program is free software; you can redistribute it and/or modify it
8  * under the terms of the license (GNU LGPL) which comes with this package. */
9
10
11 #include <stdio.h>
12 #include <stdlib.h>
13
14 #include <tbx_graph.h> /* alvin's graph toolbox (+ reconstruction algorithm) */
15
16 int main(int argc,char *argv[]) {
17   TBX_Graph_t graph; /* a dummy graph containing all hosts */
18   TBX_FIFO_t host_fifo;
19   TBX_InterfTable_t interf; /* the measured interferences */
20   TBX_Graph_t builded_graph; /* the graph builded from the interferences */
21
22   if (argc != 2) {
23     fprintf(stderr,"alnem_builder: USAGE:\n");
24     fprintf(stderr,"  alnem_builder interference_file\n");
25     exit (1);
26   }
27
28   if (TBX_Graph_interferenceTableRead (argv[1],&graph,&interf,&host_fifo)) {
29     fprintf(stderr,"Can't read the interference data, aborting\n");
30     exit (1);
31   }
32
33   builded_graph = TBX_Graph_exploreInterference(interf);
34   TBX_Graph_exportToGraphViz(builded_graph, "toto.dot");
35   return 0;
36 }