| 140 | } |
| 141 | |
| 142 | static 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(); |
no test coverage detected