26 using namespace common;
27 using namespace common::PE;
29 #define RANK "[" << Comm::instance().rank() << "] "
43 .description(
"External library zoltan will use for graph partitioning")
44 .pretty_name(
"Graph Package")
48 .description(
"Internal zoltan debug level (0 to 10)")
49 .pretty_name(
"Debug Level");
53 cf3_assert_desc(
"Could not initialize zoltan", error_code == ZOLTAN_OK);
89 CFdebug.setFilterRankZero(
false);
103 Uint comp;
Uint loc_idx;
bool found;
121 CFdebug.setFilterRankZero(
true);
199 zoltan_handle().Set_Param(
"GRAPH_BUILD_TYPE",
"FAST_NO_DUP" );
244 ZOLTAN_ID_PTR globalID, ZOLTAN_ID_PTR localID,
245 int wgt_dim,
float *obj_wgts,
int *ierr)
269 ZOLTAN_ID_PTR globalID, ZOLTAN_ID_PTR localID,
270 int *numEdges,
int *ierr)
281 ZOLTAN_ID_PTR globalID, ZOLTAN_ID_PTR localID,
283 ZOLTAN_ID_PTR nborGID,
int *nborProc,
284 int wgt_dim,
float *ewgts,
int *ierr)
296 const Uint nb_obj = p.nb_owned_objects();
297 std::vector<Uint> numEdges(nb_obj);
298 Uint tot_nb_edges = p.nb_connected_objects(numEdges);
300 std::vector<Uint> conn_glbID(tot_nb_edges);
301 p.list_of_connected_objects(conn_glbID);
303 std::vector<Uint> glbID(nb_obj);
304 p.list_of_owned_objects(glbID);
309 index_foreach(
e,
const Uint nbEdge, numEdges)
312 CFdebug <<
" N" << p.to_node_glb(glbID[e]) <<
": ";
314 CFdebug <<
" E" << p.to_elem_glb(glbID[e]) <<
": ";
316 for (
Uint c=cnt; c<cnt+nbEdge; ++c)
319 CFdebug <<
" N" << p.to_node_glb(conn_glbID[c]);
321 CFdebug <<
" E" << p.to_elem_glb(conn_glbID[c]);
std::string name(ComponentWrapper &self)
void list_of_connected_procs_in_part(const Uint part, VectorT &proc_per_neighbor) const
void list_of_objects_owned_by_part(const Uint part, VectorT &obj_list) const
bool is_null(T ptr)
predicate for comparison to nullptr
Helper class to create the Builder and place it in the factory.
Partitioner(const std::string &name)
type of pointer to Component
cf3::common::ComponentBuilder< Partitioner, MeshTransformer, LibZoltan > zoltan_partitioner_transformer_builder
PropertyList & add(const std::string &name, const boost::any &value)
adds a property to the list
#define boost_foreach
lowercase version of BOOST_FOREACH
void list_of_connected_objects_in_part(const Uint part, VectorT &connections_per_obj, WeightsT &edge_weights) const
boost::tuple< Uint, Uint > location_idx(const Uint glb_obj) const
void set_partitioning_params()
Uint nb_objects_owned_by_part(const Uint part) const
Graph building functions.
Conversions from and to std::string.
Real max(const Real a, const Real b)
Maximum between two scalars.
Real e()
Definition of the Unit charge [C].
Common_API std::string to_str(const T &v)
Converts to std::string.
virtual ~Partitioner()
Virtual destructor.
#define cf3_assert_desc(m, a)
bool is_node(const Uint glb_obj) const
PropertyList & properties()
Top-level namespace for coolfluid.
static void query_list_of_objects(void *data, int sizeGID, int sizeLID, ZOLTAN_ID_PTR globalID, ZOLTAN_ID_PTR localID, int wgt_dim, float *obj_wgts, int *ierr)
ZOLTAN_ID_PTR importLocalIds
std::vector< std::vector< Uint > > m_nodes_to_export
nodes_to_export[part][loc_node_idx]
boost::shared_ptr< Zoltan > m_zz
unsigned int Uint
typedef for unsigned int
ZOLTAN_ID_PTR exportGlobalIds
ZOLTAN_ID_PTR exportLocalIds
static int query_nb_of_objects(void *data, int *ierr)
virtual void partition_graph()
std::vector< std::vector< std::vector< Uint > > > m_elements_to_export
elements_to_export[part][elements_comp_idx][loc_elem_idx]
SelectOptionType< T >::type & add(const std::string &name, const T &default_value=T())
static Comm & instance()
Return a reference to the current PE.
Uint nb_connected_objects_in_part(const Uint part, VectorT &nb_connections_per_obj) const
static void query_nb_connected_objects(void *data, int sizeGID, int sizeLID, int num_obj, ZOLTAN_ID_PTR globalID, ZOLTAN_ID_PTR localID, int *numEdges, int *ierr)
ZOLTAN_ID_PTR importGlobalIds
#define PEProcessSortedExecute(irank, expression)
static void query_list_of_connected_objects(void *data, int sizeGID, int sizeLID, int num_obj, ZOLTAN_ID_PTR globalID, ZOLTAN_ID_PTR localID, int *num_edges, ZOLTAN_ID_PTR nborGID, int *nborProc, int wgt_dim, float *ewgts, int *ierr)