Logo AND Algorithmique Numérique Distribuée

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