Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Kill old $Id$ command dating from CVS
[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) 2003 Martin Quinson. All rights reserved.                  */
5
6 /* This program is free software; you can redistribute it and/or modify it
7  * under the terms of the license (GNU LGPL) which comes with this package. */
8
9
10 #include <stdio.h>
11 #include <stdlib.h>
12
13 #include <tbx_graph.h> /* alvin's graph toolbox (+ reconstruction algorithm) */
14
15 int main(int argc,char *argv[]) {
16   TBX_Graph_t graph; /* a dummy graph containing all hosts */
17   TBX_FIFO_t host_fifo;
18   TBX_InterfTable_t interf; /* the measured interferences */
19   TBX_Graph_t builded_graph; /* the graph builded from the interferences */
20
21   if (argc != 2) {
22     fprintf(stderr,"alnem_builder: USAGE:\n");
23     fprintf(stderr,"  alnem_builder interference_file\n");
24     exit (1);
25   }
26
27   if (TBX_Graph_interferenceTableRead (argv[1],&graph,&interf,&host_fifo)) {
28     fprintf(stderr,"Can't read the interference data, aborting\n");
29     exit (1);
30   }
31
32   builded_graph = TBX_Graph_exploreInterference(interf);
33   TBX_Graph_exportToGraphViz(builded_graph, "toto.dot");
34   return 0;
35 }