-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
49 lines (45 loc) · 1.26 KB
/
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#include "SlashBurn.h"
#include "benchmark.h"
#include "bitmap.h"
#include "command_line.h"
#include "ips4o.hpp"
#include "spray.hpp"
#include <fmt/core.h>
#include <fmt/ranges.h>
#include <iostream>
#include <omp.h>
#include <random>
void print_sep() {
for (int i = 0; i < 74; ++i) {
std::cout << "-";
}
std::cout << "\n";
}
void info(uint32_t n_threads, uint32_t k, float p) {
print_sep();
fmt::print("Parallel SlashBurn Parameters:\n");
print_sep();
fmt::print("| Number of Threads: {:^14}| p: {:^14}| k: {:^14} |\n",
n_threads, p, k);
print_sep();
}
int main(int argc, char *argv[]) {
CLApp cli(argc, argv, "slashburn");
if (!cli.ParseArgs())
return -1;
Builder b(cli);
Graph g = b.MakeGraph();
int n_neighbour_rounds = 2;
float percent = cli.percent();
Bitmap bmap(g.num_nodes());
uint32_t num_nodes = g.num_nodes();
uint num_threads = cli.num_threads();
uint32_t k = num_nodes * percent;
fmt::print("{} vertices\n", num_nodes);
fmt::print("{} undirected edges\n", g.num_edges());
info(num_threads, k, percent);
SlashBurn sb = SlashBurn(g, n_neighbour_rounds, percent, bmap, num_threads);
sb.write_permutation(cli.out_filename());
fmt::print("{}ms to complete {} iterations.\n", sb.time, sb.n_iters);
return 0;
}