From: Arnaud Giersch Date: Wed, 15 Dec 2010 22:36:26 +0000 (+0100) Subject: Cosmetics: sort topologies in source files. X-Git-Tag: v0.1~236 X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/loba.git/commitdiff_plain/86907b33d6c8f6f749d37a7bf9bcad5e6dcc0695 Cosmetics: sort topologies in source files. --- diff --git a/deployment.cpp b/deployment.cpp index 1b26a8a..c5a1f9d 100644 --- a/deployment.cpp +++ b/deployment.cpp @@ -64,33 +64,6 @@ void deployment_generator::deploy() xbt_dynar_free(&args); } -void deployment_line::generate() -{ - for (unsigned i = 0 ; i < size() - 1 ; ++i) - set_link(i, i + 1); -} - -void deployment_ring::generate() -{ - set_neighbor(0, size() - 1); - for (unsigned i = 0 ; i < size() - 1 ; ++i) - set_link(i, i + 1); - set_neighbor(size() - 1, 0); -} - -void deployment_star::generate() -{ - for (unsigned i = 1 ; i < size() ; ++i) - set_link(0, i); -} - -void deployment_clique::generate() -{ - for (unsigned i = 0 ; i < size() ; ++i) - for (unsigned j = 0 ; j < i ; ++j) - set_link(i, j); -} - void deployment_btree::generate() { for (unsigned i = 0 ; i < size() / 2 ; ++i) { @@ -104,9 +77,12 @@ void deployment_btree::generate() } } -// void deployment_torus::generate() -// { -// } +void deployment_clique::generate() +{ + for (unsigned i = 0 ; i < size() ; ++i) + for (unsigned j = 0 ; j < i ; ++j) + set_link(i, j); +} void deployment_hcube::generate() { @@ -125,3 +101,27 @@ void deployment_hcube::generate() set_link(i, j); } } + +void deployment_line::generate() +{ + for (unsigned i = 0 ; i < size() - 1 ; ++i) + set_link(i, i + 1); +} + +void deployment_ring::generate() +{ + set_neighbor(0, size() - 1); + for (unsigned i = 0 ; i < size() - 1 ; ++i) + set_link(i, i + 1); + set_neighbor(size() - 1, 0); +} + +void deployment_star::generate() +{ + for (unsigned i = 1 ; i < size() ; ++i) + set_link(0, i); +} + +// void deployment_torus::generate() +// { +// } diff --git a/deployment.h b/deployment.h index 3cbe6ae..2009b36 100644 --- a/deployment.h +++ b/deployment.h @@ -31,13 +31,13 @@ private: public: void generate(); \ } +DEPLOYMENT(btree); +DEPLOYMENT(clique); +DEPLOYMENT(hcube); DEPLOYMENT(line); DEPLOYMENT(ring); DEPLOYMENT(star); -DEPLOYMENT(clique); -DEPLOYMENT(btree); // DEPLOYMENT(torus); -DEPLOYMENT(hcube); #undef DEPLOYMENT diff --git a/options.cpp b/options.cpp index f881ad3..7a65a71 100644 --- a/options.cpp +++ b/options.cpp @@ -52,16 +52,16 @@ namespace opt { topologies_type topologies; topologies_type::topologies_type() { + NOL_INSERT("btree", "binary tree topologym intiial load at root", + deployment_btree); + NOL_INSERT("clique", "all connected topology", deployment_clique); + NOL_INSERT("hcube", "hypercube topology", deployment_hcube); NOL_INSERT("line", "line topology, initial load at one end", deployment_line); NOL_INSERT("ring", "ring topology", deployment_ring); NOL_INSERT("star", "star topology, initial load at center", deployment_star); - NOL_INSERT("clique", "all connected topology", deployment_clique); - NOL_INSERT("btree", "binary tree topologym intiial load at root", - deployment_btree); // NOL_INSERT("torus", "torus topology", deployment_torus); - NOL_INSERT("hcube", "hypercube topology", deployment_hcube); } } // namespace opt