7 #define BOOST_TEST_DYN_LINK
8 #define BOOST_TEST_MODULE "Test module for zoltan load balancing library"
10 #include <boost/test/unit_test.hpp>
34 using namespace boost;
48 m_argc = boost::unit_test::framework::master_test_suite().argc;
49 m_argv = boost::unit_test::framework::master_test_suite().argv;
74 Core::instance().initiate(m_argc,m_argv);
75 PE::Comm::instance().init(m_argc,m_argv);
85 for (
Uint pid=0; pid<PE::Comm::instance().size(); ++pid)
87 const unsigned int procup = (PE::Comm::instance().rank() + pid) %
88 PE::Comm::instance().size();
89 const unsigned int procdown = (PE::Comm::instance().size() +
90 PE::Comm::instance().rank() - pid) %
91 PE::Comm::instance().size();
93 std::cout <<
PERank << procup <<
" / " << procdown << std::endl;
203 Core::instance().environment().options().set(
"log_level",(
Uint)
DEBUG);
204 boost::shared_ptr< MeshGenerator > meshgenerator = build_component_abstract_type<MeshGenerator>(
"cf3.mesh.SimpleMeshGenerator",
"1Dgenerator");
206 meshgenerator->options().set(
"mesh",
URI(
"//rect"));
207 std::vector<Uint> nb_cells(2); nb_cells[0] = 3; nb_cells[1] = 2;
208 std::vector<Real> lengths(2); lengths[0] = nb_cells[0]; lengths[1] = nb_cells[1];
209 meshgenerator->options().set(
"nb_cells",nb_cells);
210 meshgenerator->options().set(
"lengths",lengths);
211 meshgenerator->options().set(
"bdry",
false);
212 Mesh&
mesh = meshgenerator->generate();
215 boost::shared_ptr< MeshTransformer > glb_numbering = build_component_abstract_type<MeshTransformer>(
"cf3.mesh.actions.GlobalNumbering",
"glb_numbering");
216 glb_numbering->transform(mesh);
217 boost::shared_ptr< MeshTransformer > glb_connectivity = build_component_abstract_type<MeshTransformer>(
"cf3.mesh.actions.GlobalConnectivity",
"glb_connectivity");
218 glb_connectivity->transform(mesh);
220 boost::shared_ptr< MeshWriter > meshwriter = build_component_abstract_type<MeshWriter>(
"cf3.mesh.gmsh.Writer",
"meshwriter");
221 meshwriter->write_from_to(mesh,
"rect.msh");
223 boost::shared_ptr< MeshPartitioner > partitioner_ptr = boost::dynamic_pointer_cast<
MeshPartitioner>(build_component_abstract_type<MeshTransformer>(
"cf3.mesh.zoltan.Partitioner",
"partitioner"));
225 MeshPartitioner&
p = *partitioner_ptr;
226 BOOST_CHECK_EQUAL(p.
name(),
"partitioner");
228 Core::instance().initiate(m_argc,m_argv);
231 p.
options().
set(
"graph_package", std::string(
"PHG"));
243 boost::shared_ptr< MeshTransformer > glb_node_numbering = build_component_abstract_type<MeshTransformer>(
"cf3.mesh.actions.GlobalNumberingNodes",
"glb_node_numbering");
244 glb_node_numbering->options().set(
"debug",
true);
245 glb_node_numbering->transform(mesh);
259 boost::shared_ptr< MeshWriter > tecwriter = build_component_abstract_type<MeshWriter>(
"cf3.mesh.tecplot.Writer",
"meshwriter");
260 tecwriter->write_from_to(mesh,
"rect_repartitioned.plt");
261 meshwriter->write_from_to(mesh,
"rect_repartitioned.msh");
271 PE::Comm::instance().finalize();
273 Core::instance().terminate();
278 BOOST_AUTO_TEST_SUITE_END()
#define CFinfo
these are always defined
virtual void partition_graph()=0
external boost library namespace
ConstElementsRange elements_range() const
void initialize(Mesh &mesh)
common::List< Uint > & rank()
Return the rank of every field row.
#define boost_foreach
lowercase version of BOOST_FOREACH
const std::string & name() const
Access the name of the component.
const Field & coordinates() const
BOOST_AUTO_TEST_CASE(init_mpi)
int m_argc
possibly common functions used on the tests below
~ZoltanTests_Fixture()
common tear-down for each test case
ZoltanTests_Fixture()
common setup for each test case
PropertyList & properties()
Basic Classes for Mesh applications used by COOLFluiD.
TYPE value(const std::string &pname) const
Top-level namespace for coolfluid.
unsigned int Uint
typedef for unsigned int
void migrate()
Migrate the elements and nodes to corresponding processors.
Classes offering a MPI interface for COOLFluiD.
Region & topology() const
Dictionary & geometry_fields() const
void set(const std::string &pname, const boost::any &val)
Most basic kernel library.
#define PEProcessSortedExecute(irank, expression)