8 #ifndef DEC_OPTIMIZE_HPP_ 
    9 #define DEC_OPTIMIZE_HPP_ 
   12 #include "Graph/CartesianGraphFactory.hpp" 
   13 #include "Graph/map_graph.hpp" 
   14 #include "Decomposition/Distribution/metis_util.hpp" 
   15 #include "dec_optimizer.hpp" 
   16 #include "util/SimpleRNG.hpp" 
   21 BOOST_AUTO_TEST_SUITE( dec_optimizer_test )
 
   23 BOOST_AUTO_TEST_CASE( dec_optimizer_test_use_np)
 
   29     size_t sz[3] = {GS_SIZE,GS_SIZE,GS_SIZE};
 
   35     size_t bc[] = {NON_PERIODIC,NON_PERIODIC,NON_PERIODIC};
 
   59 BOOST_AUTO_TEST_CASE( dec_optimizer_test_use_p)
 
   65     size_t sz[3] = {GS_SIZE,GS_SIZE,GS_SIZE};
 
   74     size_t bc[] = {PERIODIC,PERIODIC,PERIODIC};
 
   87     for (
size_t i = 0 ; i < GS_SIZE ; i++)
 
   89         p[0] = (i < GS_SIZE/2)?
false:
true;
 
   90         for (
size_t j = 0 ; j < GS_SIZE ; j++)
 
   92             p[1] = (j < GS_SIZE/2)?
false:
true;
 
   93             for (
size_t k = 0 ; k < GS_SIZE ; k++)
 
   95                 p[2] = (k < GS_SIZE/2)?
false:
true;
 
   96                 size_t id = 4*p[2] + 2*p[1] + p[0];
 
   99                 gp.vertex(gs.LinId(
key)).get<nm_part_v::id>() = id;
 
  100                 g.
vertex(gs.LinId(
key)).get<nm_v::id>() = id;
 
  121     BOOST_REQUIRE_EQUAL(box_nn_processor.size(),8ul);
 
  123     for(
size_t i = 0 ; i < box_nn_processor.size() ; i++)
 
  125         BOOST_REQUIRE_EQUAL(box_nn_processor.get(i).size(),8ul);
 
  126         for (
size_t j = 0 ; j < box_nn_processor.get(i).size(); j++)
 
  128             BOOST_REQUIRE(box_nn_processor.get(i).get(j) < 8);
 
  135 BOOST_AUTO_TEST_CASE( dec_optimizer_disconnected_subdomains_np)
 
  147     size_t sz[2] = {GS_SIZE,GS_SIZE};
 
  153     size_t bc[] = {NON_PERIODIC,NON_PERIODIC};
 
  184     std::stringstream str_g;
 
  186     std::stringstream str_gt;
 
  187     str_gt << 
"src/Decomposition/Distribution/test_data/dec_optimizer_disc_graph" << vcl.
getProcessUnitID() << 
"_test.vtk";
 
  189     std::stringstream str_s;
 
  191     std::stringstream str_st;
 
  192     str_st << 
"src/Decomposition/Distribution/test_data/dec_optimizer_disc_sub" << vcl.
getProcessUnitID() << 
"_test.vtk";
 
  195     wrt.write(
"dec_optimizer_disc_graph" + std::to_string(vcl.
getProcessUnitID()) + 
".vtk");
 
  198     vtk_box1.add(loc_box);
 
  199     vtk_box1.write(
"dec_optimizer_disc_sub" + std::to_string(vcl.
getProcessUnitID()) + std::string(
".vtk"));
 
  201     bool test = compare(str_g.str(), str_gt.str());
 
  202     BOOST_REQUIRE_EQUAL(
true,test);
 
  204     test = compare(str_s.str(),str_st.str());
 
  205     BOOST_REQUIRE_EQUAL(
true,test);
 
  208 BOOST_AUTO_TEST_SUITE_END()
 
auto getVertexIterator() const -> decltype(v.getIterator())
Get the vertex iterator. 
 
grid_key_dx is the key to access any element in the grid 
 
size_t getProcessUnitID()
Get the process unit id. 
 
static const unsigned int communication
computation property id in boost::fusion::vector 
 
Helper class to define Metis graph. 
 
auto vertex_p(size_t id) -> decltype(v.template get< i >(id))
operator to access the vertex 
 
Implementation of VCluster class. 
 
SimpleRNG is a simple random number generator based on George Marsaglia's MWC (multiply with carry) g...
 
This class construct a cartesian graph. 
 
static const unsigned int sub_id
sub_id property id in boost::fusion::vector 
 
static const unsigned int id
partition id in the boost::fusion::vector 
 
This class is a trick to indicate the compiler a specific specialization pattern. ...
 
auto vertex(size_t id) -> decltype(v.get(id))
Function to access the vertex. 
 
static const unsigned int id
id property id in boost::fusion::vector 
 
This class take a graph representing the space decomposition and produce a simplified version...
 
static Graph construct(const size_t(&sz)[dim], Box< dim, T > dom, const size_t(&bc)[dim])
Construct a cartesian graph, with V and E edge properties. 
 
static const unsigned int proc_id
proc_id property id in boost::fusion::vector 
 
Implementation of 1-D std::vector like structure. 
 
size_t getProcessingUnits()
Get the total number of processors.