Line data Source code
1 : /*
2 : * Copyright (c) 2015: G-CSC, Goethe University Frankfurt
3 : * Author: Sebastian Reiter
4 : *
5 : * This file is part of UG4.
6 : *
7 : * UG4 is free software: you can redistribute it and/or modify it under the
8 : * terms of the GNU Lesser General Public License version 3 (as published by the
9 : * Free Software Foundation) with the following additional attribution
10 : * requirements (according to LGPL/GPL v3 §7):
11 : *
12 : * (1) The following notice must be displayed in the Appropriate Legal Notices
13 : * of covered and combined works: "Based on UG4 (www.ug4.org/license)".
14 : *
15 : * (2) The following notice must be displayed at a prominent place in the
16 : * terminal output of covered works: "Based on UG4 (www.ug4.org/license)".
17 : *
18 : * (3) The following bibliography is recommended for citation and must be
19 : * preserved in all covered files:
20 : * "Reiter, S., Vogel, A., Heppner, I., Rupp, M., and Wittum, G. A massively
21 : * parallel geometric multigrid solver on hierarchically distributed grids.
22 : * Computing and visualization in science 16, 4 (2013), 151-164"
23 : * "Vogel, A., Reiter, S., Rupp, M., Nägel, A., and Wittum, G. UG4 -- a novel
24 : * flexible software system for simulating pde based models on high performance
25 : * computers. Computing and visualization in science 16, 4 (2013), 165-179"
26 : *
27 : * This program is distributed in the hope that it will be useful,
28 : * but WITHOUT ANY WARRANTY; without even the implied warranty of
29 : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
30 : * GNU Lesser General Public License for more details.
31 : */
32 :
33 : #include "grid_bridges.h"
34 : #include "lib_grid/parallelization/util/partition_weighting_callbacks.h"
35 : #include "lib_grid/tools/partition_map.h"
36 : #include "lib_grid/algorithms/graph/dual_graph.h" // DualGraphNeighborCollector
37 :
38 : using namespace std;
39 :
40 : namespace ug{
41 : namespace bridge{
42 :
43 1 : void RegisterGridBridge_Balancing(Registry& reg, string parentGroup)
44 : {
45 : string grp = parentGroup;
46 :
47 : // partition weighting in metis partitioning
48 3 : reg.add_class_<PartitionWeighting>("PartitionWeighting", grp)
49 1 : .add_constructor()
50 2 : .add_method("set_default_weights", &PartitionWeighting::set_default_weights, "", "hWeight#vWeight")
51 1 : .set_construct_as_smart_pointer(true);
52 3 : reg.add_class_<InterSubsetPartitionWeighting, PartitionWeighting>("InterSubsetPartitionWeighting", grp)
53 1 : .add_constructor()
54 2 : .add_method("set_inter_subset_weight", &InterSubsetPartitionWeighting::set_inter_subset_weight, "", "si1#si2#weight")
55 1 : .set_construct_as_smart_pointer(true);
56 3 : reg.add_class_<ProtectSubsetPartitionWeighting, PartitionWeighting>("ProtectSubsetPartitionWeighting", grp)
57 1 : .add_constructor()
58 2 : .add_method("set_weight", &ProtectSubsetPartitionWeighting::set_weight, "", "si#weight")
59 1 : .set_construct_as_smart_pointer(true);
60 :
61 : // PartitionMap
62 3 : reg.add_class_<PartitionMap>("PartitionMap", grp)
63 1 : .add_constructor()
64 2 : .add_method("clear", &PartitionMap::clear)
65 2 : .add_method("get_partition_handler", &PartitionMap::get_partition_handler)
66 2 : .add_method("add_target_proc", &PartitionMap::add_target_proc)
67 2 : .add_method("add_target_procs", &PartitionMap::add_target_procs)
68 2 : .add_method("num_target_procs", &PartitionMap::num_target_procs)
69 2 : .add_method("get_target_proc", &PartitionMap::get_target_proc)
70 2 : .add_method("shift_target_procs", &PartitionMap::shift_target_procs)
71 1 : .set_construct_as_smart_pointer(true);
72 1 : }
73 :
74 : }// end of namespace
75 : }// end of namespace
|