9 bool lireFichier(string nom, double tab[][6], int nb);
11 int main(int argc, char **argv)
13 double tab[16][6]; // tableau des résultats en Latex
17 for(i=1; i<argc; i++){
18 if(argv[i][0] == '-'){
22 base = string(argv[i]);
28 for(lig=0; lig<16; ++lig){
29 for(col=0; col<6; ++col){
34 nom = string("expe_10/") + base;
35 if(!lireFichier(nom, tab, 10)){
36 cout << "Erreur d'ouverture du fichier d'entrées " << nom << endl;
39 nom = string("expe_50/") + base;
40 if(!lireFichier(nom, tab, 50)){
41 cout << "Erreur d'ouverture du fichier d'entrées " << nom << endl;
45 for(lig=0; lig<16; ++lig){
47 cout << "\\multirow{8}{7em}{Homogeneous processors} & ";
50 cout << "\\multirow{8}{7em}{Heterogeneous processors} & ";
54 cout << "\\multirow{4}{7em}{Constant links} & ";
57 cout << "\\multirow{4}{7em}{Intermittent links} & ";
61 cout << "\\multirow{2}{7em}{All tasks on one node} & ";
64 cout << "\\multirow{2}{7em}{Homogeneous distribution} & ";
68 for(col=0; col<5; ++col){
69 cout << tab[lig][col] << " & ";
71 cout << tab[lig][col] << " \\\\" << endl;
74 for(lig=0; lig<8; lig+=2){
77 cout << "\\hline" << endl;
80 cout << "\\cline{2-6}" << endl;
84 cout << "\\multirow{4}{7em}{Constant links} & ";
87 cout << "\\multirow{4}{7em}{Intermittent links} & ";
91 cout << "\\multirow{2}{6em}{All tasks on one node} & ";
94 cout << "\\multirow{2}{6em}{Homogeneous distribution} & ";
99 cout << tab[lig + 1][1] << " & ";
100 cout << tab[lig + 1][4] << " & ";
101 cout << tab[8 + lig + 1][1] << " & ";
102 cout << tab[8 + lig + 1][4] << " \\\\" << endl;
104 cout << " & & \\emph{" << tab[lig + 1][2] << "} & ";
105 cout << " \\emph{" << tab[lig + 1][5] << "} & ";
106 cout << " \\emph{" << tab[8 + lig + 1][2] << "} & ";
107 cout << " \\emph{" << tab[8 + lig + 1][5] << "} \\\\" << endl;
113 bool lireFichier(string nom, double tab[][6], int nb)
121 cout << "Lecture données " << nom << " avec " << nb << " procs " << endl;
123 fic.open(nom.c_str());
132 while(fic.good() && !fini){
136 fic >> mot; // "calcul"
138 fic >> tab[lig][col];
139 // cout << lig << " " << col << " : " << tab[lig][col] << endl;
141 if(mot == "optimal"){
143 fic >> tab[lig][col + 1];
144 // cout << lig << " " << col + 1 << " : " << tab[lig][col+1] << endl;
146 if(mot == "initial"){
148 fic >> tab[lig][col + 2];
149 // cout << lig << " " << col + 2 << " : " << tab[lig][col+2] << endl;
154 if(mot == "Surcoût"){
158 fic >> tab[lig + 1][col + 1];
159 // cout << lig + 1 << " " << col + 1 << " : " << tab[lig+1][col+1] << endl;
166 fic >> tab[lig + 1][col + 2];
167 // cout << lig + 1 << " " << col + 2 << " : " << tab[lig+1][col+2] << endl;