Skip to content

Commit

Permalink
wrap namespaces
Browse files Browse the repository at this point in the history
  • Loading branch information
ldhulipala committed Jun 21, 2020
1 parent 822adc5 commit ba238af
Show file tree
Hide file tree
Showing 295 changed files with 1,236 additions and 701 deletions.
1 change: 0 additions & 1 deletion benchmarks/Biconnectivity/TarjanVishkin/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ cc_library(
"//benchmarks/Connectivity/WorkEfficientSDB14:Connectivity",
"//gbbs:gbbs",
"//gbbs/pbbslib:dyn_arr",
"//gbbs/pbbslib:sparse_table",
"//pbbslib:random",
"//pbbslib:sample_sort",
"//pbbslib/strings:string_basics",
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/Biconnectivity/TarjanVishkin/Biconnectivity.cc
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ void BiconnectivityStats(symmetric_graph<vertex, W>& GA, char* s,

size_t mask = (1 << 12) - 1;
auto empty = std::make_tuple(UINT_E_MAX, UINT_E_MAX);
auto ST = sparse_additive_map<uintE, uintE>(n, empty);
auto ST = pbbslib::sparse_additive_map<uintE, uintE>(n, empty);

auto map_bc_label = [&](const uintE& src, const uintE& ngh, const W& wgh) {
auto label = bicc_label(src, ngh);
Expand Down
1 change: 0 additions & 1 deletion benchmarks/Biconnectivity/TarjanVishkin/Biconnectivity.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@

#include "gbbs/gbbs.h"
#include "gbbs/pbbslib/dyn_arr.h"
#include "gbbs/pbbslib/sparse_table.h"
#include "pbbslib/random.h"
#include "pbbslib/sample_sort.h"
#include "pbbslib/strings/string_basics.h"
Expand Down
1 change: 0 additions & 1 deletion benchmarks/CliqueCounting/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ cc_library(
"//gbbs:edge_map_reduce",
"//gbbs:gbbs",
"//gbbs/pbbslib:dyn_arr",
"//gbbs/pbbslib:sparse_table",
]
)

Expand Down
1 change: 0 additions & 1 deletion benchmarks/CliqueCounting/Clique.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
#include "gbbs/edge_map_reduce.h"
#include "gbbs/gbbs.h"
#include "gbbs/pbbslib/dyn_arr.h"
#include "gbbs/pbbslib/sparse_table.h"
#include "pbbslib/assert.h"
#include "pbbslib/list_allocator.h"
#include "pbbslib/integer_sort.h"
Expand Down
1 change: 0 additions & 1 deletion benchmarks/CliqueCounting/intersect.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#include "gbbs/edge_map_reduce.h"
#include "gbbs/gbbs.h"
#include "gbbs/pbbslib/dyn_arr.h"
#include "gbbs/pbbslib/sparse_table.h"

#define INDUCED_STACK_THR 5000

Expand Down
4 changes: 2 additions & 2 deletions benchmarks/CliqueCounting/peel.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ inline size_t triUpdate(Graph& G, Graph2& DG, F get_active, size_t active_size,

// Hash table to contain triangle count updates
size_t edge_table_size = (size_t) (active_deg < n ? active_deg : n);
auto edge_table = sparse_table<uintE, bool, hashtup>(edge_table_size, std::make_tuple(UINT_E_MAX, false), hashtup());
auto edge_table = pbbslib::sparse_table<uintE, bool, hashtup>(edge_table_size, std::make_tuple(UINT_E_MAX, false), hashtup());

// Function that dictates which edges to consider in first level of recursion
auto ignore_f = [&](const uintE& u, const uintE& v) {
Expand Down Expand Up @@ -204,7 +204,7 @@ inline size_t cliqueUpdate(Graph& G, Graph2& DG, size_t k, size_t max_deg, bool

// Hash table to contain clique count updates
size_t edge_table_size = (size_t) (active_deg < n ? active_deg : n);
auto edge_table = sparse_table<uintE, bool, hashtup>(edge_table_size, std::make_tuple(UINT_E_MAX, false), hashtup());
auto edge_table = pbbslib::sparse_table<uintE, bool, hashtup>(edge_table_size, std::make_tuple(UINT_E_MAX, false), hashtup());

// Function that dictates which edges to consider in first level of recursion
auto ignore_f = [&](const uintE& u, const uintE& v) {
Expand Down
1 change: 0 additions & 1 deletion benchmarks/CoSimRank/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ cc_library(
hdrs = ["CoSimRank.h"],
deps = [
"//gbbs:gbbs",
"//gbbs:edge_map_reduce",
]
)

Expand Down
4 changes: 3 additions & 1 deletion benchmarks/CoSimRank/CoSimRank.cc
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@

#include "CoSimRank.h"

namespace gbbs {
template <class Graph>
double CoSimRank_runner(Graph& G, commandLine P) {
std::cout << "### Application: CoSimRank" << std::endl;
Expand All @@ -56,5 +57,6 @@ double CoSimRank_runner(Graph& G, commandLine P) {
std::cout << "### Running Time: " << tt << std::endl;
return tt;
}
} // namespace gbbs

generate_main(CoSimRank_runner, false);
generate_main(gbbs::CoSimRank_runner, false);
2 changes: 2 additions & 0 deletions benchmarks/CoSimRank/CoSimRank.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

#include "gbbs/gbbs.h"

namespace gbbs {
template <class Graph>
struct PR_F {
using W = typename Graph::weight_type;
Expand Down Expand Up @@ -202,3 +203,4 @@ void CoSimRank(Graph& G, uintE v, uintE u, double eps = 0.000001, double c = 0.8
cout << "max_pr = " << max_pr_v << ", " << max_pr_u << endl;
cout << "sim = " << sim << endl;
}
} // namespace gbbs
6 changes: 5 additions & 1 deletion benchmarks/Connectivity/BFSCC/Connectivity.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@

#include "Connectivity.h"

namespace gbbs {

template <class Graph>
double CC_runner(Graph& G, commandLine P) {
std::cout << "### Application: CC (Connectivity)" << std::endl;
Expand All @@ -52,4 +54,6 @@ double CC_runner(Graph& G, commandLine P) {
return tt;
}

generate_main(CC_runner, false);
} // namespace gbbs

generate_main(gbbs::CC_runner, false);
2 changes: 2 additions & 0 deletions benchmarks/Connectivity/BFSCC/Connectivity.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include "gbbs/gbbs.h"
#include "benchmarks/Connectivity/common.h"

namespace gbbs {
namespace bfs_cc {

template <class W>
Expand Down Expand Up @@ -85,3 +86,4 @@ inline sequence<parent> CC(Graph& G) {
}

} // namespace bfs_cc
} // namespace gbbs
4 changes: 3 additions & 1 deletion benchmarks/Connectivity/Framework/benchmark_edge_gather.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

#include "utils/benchmark.h"

namespace gbbs {
template <class CpuStats>
void print_result(commandLine& P, std::string method, size_t rounds, double time, CpuStats& stats) {
std::cout << "{" << std::endl;
Expand Down Expand Up @@ -114,5 +115,6 @@ double Sampler(Graph& G, commandLine& P) {

std::cout << "]" << std::endl;
}
} // namespace gbbs

generate_symmetric_once_main(Sampler, false);
generate_symmetric_once_main(gbbs::Sampler, false);
4 changes: 3 additions & 1 deletion benchmarks/Connectivity/Framework/benchmark_sampling.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

#include "utils/benchmark.h"

namespace gbbs {
void print_result(commandLine& P, std::string sampling_method, size_t rounds, double sampling_time, double pct_covered, double pct_ic_edges, size_t k=0) {
std::cout << "{" << std::endl;
std::cout << " \"test_type\": \"sampling_result\"," << std::endl;
Expand Down Expand Up @@ -329,5 +330,6 @@ double Sampler(Graph& G, commandLine& P) {

std::cout << "]" << std::endl;
}
} // namespace gbbs

generate_symmetric_once_main(Sampler, false);
generate_symmetric_once_main(gbbs::Sampler, false);
4 changes: 3 additions & 1 deletion benchmarks/Connectivity/Framework/framework.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

#include "sampling.h"

namespace gbbs {
namespace connectit {

/* Union-Find Strategies */
Expand Down Expand Up @@ -263,4 +264,5 @@ namespace connectit {
}


} // namesapce connectit
} // namesapce connectit
} // namespace gbbs
2 changes: 2 additions & 0 deletions benchmarks/Connectivity/Framework/mains/bench_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

/* ************************* Benchmark Utils *************************** */

namespace gbbs {
static timer bt;
using uchar = unsigned char;

Expand Down Expand Up @@ -121,3 +122,4 @@ double t_gbbs_cc(Graph& G, commandLine P, pbbs::sequence<parent>& correct) {
}
return t;
}
} // namespace gbbs
4 changes: 3 additions & 1 deletion benchmarks/Connectivity/Framework/mains/bfscc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@

#include "bench_utils.h"

namespace gbbs {
namespace connectit {

template <class Graph>
Expand Down Expand Up @@ -63,5 +64,6 @@ double Benchmark_runner(Graph& G, commandLine P) {
});
return 1.0;
}
} // namespace gbbs

generate_symmetric_once_main(Benchmark_runner, false);
generate_symmetric_once_main(gbbs::Benchmark_runner, false);
2 changes: 2 additions & 0 deletions benchmarks/Connectivity/Framework/mains/check.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

/* ************************* Utils *************************** */

namespace gbbs {
template <class Seq>
inline size_t num_cc(Seq& labels) {
size_t n = labels.size();
Expand Down Expand Up @@ -72,3 +73,4 @@ inline void cc_check(S1& correct, S2& check) {
cout << "# correctness check: " << is_correct << endl;
cout << "# max_cor = " << max_cor << " max_chk = " << max_chk << endl;
}
} // namespace gbbs
4 changes: 3 additions & 1 deletion benchmarks/Connectivity/Framework/mains/gbbscc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@

#include "bench_utils.h"

namespace gbbs {
namespace connectit {

template <class Graph>
Expand Down Expand Up @@ -65,5 +66,6 @@ double Benchmark_runner(Graph& G, commandLine P) {
});
return 1.0;
}
} // namespace gbbs

generate_symmetric_once_main(Benchmark_runner, false);
generate_symmetric_once_main(gbbs::Benchmark_runner, false);
4 changes: 3 additions & 1 deletion benchmarks/Connectivity/Framework/mains/jayanti_bfs.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include "bench_utils.h"
#include "uf_utils.h"

namespace gbbs {
namespace connectit {
template <class Graph>
void jayanti_find_twotrysplit(Graph& G, int rounds, commandLine& P, pbbs::sequence<parent>& correct) {
Expand Down Expand Up @@ -59,5 +60,6 @@ double Benchmark_runner(Graph& G, commandLine P) {
});
return 1.0;
}
} // namespace gbbs

generate_symmetric_once_main(Benchmark_runner, false);
generate_symmetric_once_main(gbbs::Benchmark_runner, false);
4 changes: 3 additions & 1 deletion benchmarks/Connectivity/Framework/mains/jayanti_kout.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include "bench_utils.h"
#include "uf_utils.h"

namespace gbbs {
namespace connectit {
template <class Graph>
void jayanti_find_twotrysplit(Graph& G, int rounds, commandLine& P, pbbs::sequence<parent>& correct) {
Expand Down Expand Up @@ -59,5 +60,6 @@ double Benchmark_runner(Graph& G, commandLine P) {
});
return 1.0;
}
} // namespace gbbs

generate_symmetric_once_main(Benchmark_runner, false);
generate_symmetric_once_main(gbbs::Benchmark_runner, false);
4 changes: 3 additions & 1 deletion benchmarks/Connectivity/Framework/mains/jayanti_ldd.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include "bench_utils.h"
#include "uf_utils.h"

namespace gbbs {
namespace connectit {
template <class Graph>
void jayanti_find_twotrysplit(Graph& G, int rounds, commandLine& P, pbbs::sequence<parent>& correct) {
Expand Down Expand Up @@ -59,5 +60,6 @@ double Benchmark_runner(Graph& G, commandLine P) {
});
return 1.0;
}
} // namespace gbbs

generate_symmetric_once_main(Benchmark_runner, false);
generate_symmetric_once_main(gbbs::Benchmark_runner, false);
4 changes: 3 additions & 1 deletion benchmarks/Connectivity/Framework/mains/jayanti_nosample.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include "bench_utils.h"
#include "uf_utils.h"

namespace gbbs {
namespace connectit {
template <class Graph>
void jayanti_find_twotrysplit(Graph& G, int rounds, commandLine& P, pbbs::sequence<parent>& correct) {
Expand Down Expand Up @@ -58,5 +59,6 @@ double Benchmark_runner(Graph& G, commandLine P) {
});
return 1.0;
}
} // namespace gbbs

generate_symmetric_once_main(Benchmark_runner, false);
generate_symmetric_once_main(gbbs::Benchmark_runner, false);
4 changes: 3 additions & 1 deletion benchmarks/Connectivity/Framework/mains/label_propagation.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@

#include "bench_utils.h"

namespace gbbs {
namespace connectit {
template<
class Graph,
Expand Down Expand Up @@ -95,5 +96,6 @@ double Benchmark_runner(Graph& G, commandLine P) {
});
return 1.0;
}
} // namespace gbbs

generate_symmetric_once_main(Benchmark_runner, false);
generate_symmetric_once_main(gbbs::Benchmark_runner, false);
4 changes: 3 additions & 1 deletion benchmarks/Connectivity/Framework/mains/liutarjan_bfs.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include "bench_utils.h"
#include "uf_utils.h"

namespace gbbs {
namespace connectit {

template<
Expand Down Expand Up @@ -211,5 +212,6 @@ double Benchmark_runner(Graph& G, commandLine P) {
});
return 1.0;
}
} // namespace gbbs

generate_symmetric_once_main(Benchmark_runner, false);
generate_symmetric_once_main(gbbs::Benchmark_runner, false);
4 changes: 3 additions & 1 deletion benchmarks/Connectivity/Framework/mains/liutarjan_kout.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include "bench_utils.h"
#include "uf_utils.h"

namespace gbbs {
namespace connectit {

template<
Expand Down Expand Up @@ -211,5 +212,6 @@ double Benchmark_runner(Graph& G, commandLine P) {
});
return 1.0;
}
} // namespace gbbs

generate_symmetric_once_main(Benchmark_runner, false);
generate_symmetric_once_main(gbbs::Benchmark_runner, false);
4 changes: 3 additions & 1 deletion benchmarks/Connectivity/Framework/mains/liutarjan_ldd.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include "bench_utils.h"
#include "uf_utils.h"

namespace gbbs {
namespace connectit {

template<
Expand Down Expand Up @@ -211,5 +212,6 @@ double Benchmark_runner(Graph& G, commandLine P) {
});
return 1.0;
}
} // namespace gbbs

generate_symmetric_once_main(Benchmark_runner, false);
generate_symmetric_once_main(gbbs::Benchmark_runner, false);
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include "bench_utils.h"
#include "uf_utils.h"

namespace gbbs {
namespace connectit {

template<
Expand Down Expand Up @@ -211,5 +212,6 @@ double Benchmark_runner(Graph& G, commandLine P) {
});
return 1.0;
}
} // namespace gbbs

generate_symmetric_once_main(Benchmark_runner, false);
generate_symmetric_once_main(gbbs::Benchmark_runner, false);
4 changes: 3 additions & 1 deletion benchmarks/Connectivity/Framework/mains/shiloach_vishkin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

#include "bench_utils.h"

namespace gbbs {
namespace connectit {
template<
class Graph,
Expand Down Expand Up @@ -93,5 +94,6 @@ double Benchmark_runner(Graph& G, commandLine P) {
});
return 1.0;
}
} // namespace gbbs

generate_symmetric_once_main(Benchmark_runner, false);
generate_symmetric_once_main(gbbs::Benchmark_runner, false);
Loading

0 comments on commit ba238af

Please sign in to comment.