MCPcopy Create free account
hub / github.com/KaHIP/KaHIP / executeParhip

Function executeParhip

parallel/parallel_src/app/dspac.cpp:142–252  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

140}
141
142static void executeParhip(parallel_graph_access &G, PPartitionConfig &partitionConfig) {
143 timer t;
144 int rank, size;
145 MPI_Comm communicator = MPI_COMM_WORLD;
146 MPI_Comm_rank(communicator, &rank);
147 MPI_Comm_size(communicator, &size);
148
149 MPI_Barrier(MPI_COMM_WORLD);
150
151 if (communicator != MPI_COMM_NULL) {
152 MPI_Comm_rank(communicator, &rank);
153 MPI_Comm_size(communicator, &size);
154
155 if (rank == ROOT) {
156 PRINT(std::cout << "log> cluster coarsening factor is set to "
157 << partitionConfig.cluster_coarsening_factor << std::endl;)
158 }
159
160 partitionConfig.stop_factor /= partitionConfig.k;
161 if (rank != 0) partitionConfig.seed = partitionConfig.seed * size + rank;
162 srand(static_cast<unsigned int>(partitionConfig.seed));
163
164 random_functions::setSeed(partitionConfig.seed);
165 parallel_graph_access::set_comm_rounds(partitionConfig.comm_rounds / size);
166 parallel_graph_access::set_comm_rounds_up(partitionConfig.comm_rounds / size);
167 distributed_partitioner::generate_random_choices(partitionConfig);
168
169 G.printMemoryUsage(std::cout);
170
171 //compute some stats
172 EdgeWeight interPEedges = 0;
173 EdgeWeight localEdges = 0;
174 forall_local_nodes(G, node)
175 {
176 forall_out_edges(G, e, node)
177 {
178 NodeID target = G.getEdgeTarget(e);
179 if (!G.is_local_node(target)) {
180 interPEedges++;
181 } else {
182 localEdges++;
183 }
184 }
185 endfor
186 }
187 endfor
188
189 EdgeWeight globalInterEdges = 0;
190 EdgeWeight globalIntraEdges = 0;
191 MPI_Reduce(&interPEedges, &globalInterEdges, 1, MPI_UNSIGNED_LONG_LONG, MPI_SUM, ROOT, communicator);
192 MPI_Reduce(&localEdges, &globalIntraEdges, 1, MPI_UNSIGNED_LONG_LONG, MPI_SUM, ROOT, communicator);
193
194 if (rank == ROOT) {
195 std::cout << "log> ghost edges " << globalInterEdges / (double) G.number_of_global_edges() << std::endl;
196 std::cout << "log> local edges " << globalIntraEdges / (double) G.number_of_global_edges() << std::endl;
197 }
198
199 t.restart();

Callers 1

mainFunction · 0.85

Calls 12

printMemoryUsageMethod · 0.80
balance_loadMethod · 0.80
balance_load_distMethod · 0.80
comm_volMethod · 0.80
comm_vol_distMethod · 0.80
restartMethod · 0.45
perform_partitioningMethod · 0.45
elapsedMethod · 0.45
edge_cutMethod · 0.45
balanceMethod · 0.45

Tested by

no test coverage detected