Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix uses of structured bindings to conform to C++17 standard and appe… #61

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -435,16 +435,20 @@ inline sequence<label_type> StronglyConnectedComponents(Graph& GA, double beta =
auto centers_copy = centers;
size_t centers_size = centers.size();
auto in_f = vertexSubset(n, centers_size, centers.to_array());
auto [in_table, in_elts] =
auto [in_table_sb, in_elts_sb] =
multi_search(PG, labels, bits, in_f, cur_label_offset, in_edges);
auto in_table = in_table_sb;
auto in_elts = in_elts_sb;
std::cout << "Finished in search"
<< "\n";
// in_table.analyze();
ins.stop(); ins.reportTotal("insearch time");

timer outs; outs.start();
auto out_f = vertexSubset(n, centers_size, centers_copy.to_array());
auto [out_table, out_elts] = multi_search(PG, labels, bits, out_f, cur_label_offset);
auto [out_table_sb, out_elts_sb] = multi_search(PG, labels, bits, out_f, cur_label_offset);
auto out_table = out_table_sb;
auto out_elts = out_elts_sb;
std::cout << "in_table, m = " << in_table.m << " ne = " << in_table.ne
<< "\n";
std::cout << "out_table, m = " << out_table.m << " ne = " << out_table.ne
Expand Down
32 changes: 24 additions & 8 deletions sage/sage_io.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,12 @@ std::pair<char*, size_t> mmap_pmem(const char* filename) {
template <class weight_type>
symmetric_graph<csv_bytepd_amortized, weight_type>
read_compressed_symmetric_graph(const char* f1, const char* f2) {
auto [s0, s0_size] = mmap_pmem(f1);
auto [s1, s1_size] = mmap_pmem(f2);
auto [s0_sb, s0_size_sb] = mmap_pmem(f1);
auto [s1_sb, s1_size_sb] = mmap_pmem(f2);
auto s0 = s0_sb;
auto s0_size = s0_size_sb;
auto s1 = s1_sb;
auto s1_size = s1_size_sb;
if (s0_size != s1_size) {
std::cout << f1 << " and " << f2 << " have different file lengths, aborting" << std::endl;
exit(-1);
Expand Down Expand Up @@ -130,8 +134,12 @@ read_compressed_symmetric_graph(const char* f1, const char* f2) {
template <class weight_type>
asymmetric_graph<cav_bytepd_amortized, weight_type>
read_compressed_asymmetric_graph(const char* f1, const char* f2) {
auto [s0, s0_size] = mmap_pmem(f1);
auto [s1, s1_size] = mmap_pmem(f2);
auto [s0_sb, s0_size_sb] = mmap_pmem(f1);
auto [s1_sb, s1_size_sb] = mmap_pmem(f2);
auto s0 = s0_sb;
auto s0_size = s0_size_sb;
auto s1 = s1_sb;
auto s1_size = s1_size_sb;
if (s0_size != s1_size) {
std::cout << f1 << " and " << f2 << " have different file lengths, aborting" << std::endl;
exit(-1);
Expand Down Expand Up @@ -185,8 +193,12 @@ read_compressed_asymmetric_graph(const char* f1, const char* f2) {
template <class weight_type>
symmetric_graph<symmetric_vertex, weight_type>
read_symmetric_binary_graph(const char* f1, const char* f2) {
auto [s0, s0_size] = mmap_pmem(f1);
auto [s1, s1_size] = mmap_pmem(f2);
auto [s0_sb, s0_size_sb] = mmap_pmem(f1);
auto [s1_sb, s1_size_sb] = mmap_pmem(f2);
auto s0 = s0_sb;
auto s0_size = s0_size_sb;
auto s1 = s1_sb;
auto s1_size = s1_size_sb;
if (s0_size != s1_size) {
std::cout << f1 << " and " << f2 << " have different file lengths, aborting" << std::endl;
exit(-1);
Expand Down Expand Up @@ -225,8 +237,12 @@ read_symmetric_binary_graph(const char* f1, const char* f2) {
template <class weight_type>
asymmetric_graph<asymmetric_vertex, weight_type>
read_asymmetric_binary_graph(const char* f1, const char* f2) {
auto [s0, s0_size] = mmap_pmem(f1);
auto [s1, s1_size] = mmap_pmem(f2);
auto [s0_sb, s0_size_sb] = mmap_pmem(f1);
auto [s1_sb, s1_size_sb] = mmap_pmem(f2);
auto s0 = s0_sb;
auto s0_size = s0_size_sb;
auto s1 = s1_sb;
auto s1_size = s1_size_sb;
if (s0_size != s1_size) {
std::cout << f1 << " and " << f2 << " have different file lengths, aborting" << std::endl;
exit(-1);
Expand Down