-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
701 additions
and
110 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
#include <ink/ink.hpp> | ||
|
||
int main(int argc, char* argv[]) { | ||
if (argc != 5) { | ||
std::cerr | ||
<< "usage: ./Ink [graph_ops_file] [output_file] [#paths] [#iterations]\n"; | ||
std::exit(EXIT_FAILURE); | ||
} | ||
|
||
ink::Ink i1, i2; | ||
i1.read_ops(argv[1], argv[2]); | ||
i2.read_ops(argv[1], argv[2]); | ||
size_t k = std::stoul(argv[3]); | ||
size_t num_iters = std::stoul(argv[4]); | ||
|
||
std::cout << "# paths = " << k << '\n'; | ||
std::cout << "# iters = " << num_iters << '\n'; | ||
|
||
i1.report_incsfxt(k, true, false); | ||
i2.report_incsfxt(k, true, false); | ||
|
||
size_t sfxt_update_accum1{0}; | ||
size_t sfxt_update_accum2{0}; | ||
size_t pfxt_expansion_accum1{0}; | ||
size_t pfxt_expansion_accum2{0}; | ||
std::ofstream ofs1("multi-iter-exp-i1.txt"); | ||
std::ofstream ofs2("multi-iter-exp-i2.txt"); | ||
ofs1 << "iteration runtime\n"; | ||
ofs2 << "iteration runtime\n"; | ||
|
||
std::vector<float> c1; | ||
std::vector<float> c2; | ||
std::ofstream ofsf("full-costs"), ofsi("ink-costs"); | ||
|
||
|
||
|
||
|
||
for (size_t it = 0; it < num_iters; it++) { | ||
std::uniform_int_distribution<size_t> distr(0, i1.num_verts() - 1); | ||
size_t vid = distr(i1.rng); | ||
|
||
// full cpg mode | ||
i1.modify_vertex(vid, 0.025f); | ||
i1.report_rebuild(k, false); | ||
c1 = i1.get_path_costs(); | ||
sfxt_update_accum1 += i1.sfxt_update_time; | ||
pfxt_expansion_accum1 += i1.pfxt_expansion_time; | ||
ofs1 << it + 1 << ' ' << i1.full_time * 1e-6 << '\n'; | ||
|
||
// incremental cpg mode | ||
i2.modify_vertex(vid, 0.025f); | ||
i2.report_incremental(k, true, false, false); | ||
c2 = i2.get_path_costs(); | ||
sfxt_update_accum2 += i2.sfxt_update_time; | ||
pfxt_expansion_accum2 += i2.pfxt_expansion_time; | ||
ofs2 << it + 1 << ' ' << i2.incremental_time * 1e-6 << '\n'; | ||
} | ||
|
||
for (size_t i = 0; i < k; i++) { | ||
ofsf << c1[i] << '\n'; | ||
ofsi << c2[i] << '\n'; | ||
} | ||
|
||
std::cout << "avg sfxt update time full = " << (sfxt_update_accum1 * 1e-6) / num_iters << '\n'; | ||
std::cout << "avg pfxt expansion time full = " << (pfxt_expansion_accum1 * 1e-6) / num_iters << '\n'; | ||
std::cout << "avg sfxt update time inc = " << (sfxt_update_accum2 * 1e-6) / num_iters << '\n'; | ||
std::cout << "avg pfxt expansion time inc = " << (pfxt_expansion_accum2 * 1e-6) / num_iters << '\n'; | ||
|
||
|
||
return 0; | ||
} | ||
|
||
|
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#include <ink/ink.hpp> | ||
|
||
int main(int argc, char* argv[]) { | ||
if (argc != 5) { | ||
std::cerr | ||
<< "usage: ./Ink [graph_ops_file] [output_file] [#paths] [mode]\n"; | ||
std::exit(EXIT_FAILURE); | ||
} | ||
|
||
ink::Ink ink; | ||
ink.read_ops(argv[1], argv[2]); | ||
size_t k = std::stoul(argv[3]); | ||
size_t mode = std::stoul(argv[4]); | ||
|
||
std::cout << "# paths = " << k << '\n'; | ||
|
||
ink.report_incsfxt(k, true, false); | ||
|
||
std::uniform_int_distribution<size_t> distr(0, ink.num_verts() - 1); | ||
size_t vid = distr(ink.rng); | ||
|
||
if (mode == 0) { | ||
// full cpg mode | ||
ink.modify_vertex(vid, 0.025f); | ||
ink.report_rebuild(k, false); | ||
} | ||
else { | ||
// incremental cpg mode | ||
ink.modify_vertex(vid, 0.025f); | ||
ink.report_incremental(k, true, false, false); | ||
} | ||
|
||
|
||
return 0; | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# benchmarks | ||
declare -a benchmarks=("../benchmarks/leon2_iccad.edges" "../benchmarks/leon3mp_iccad.edges" "../benchmarks/netcard_iccad.edges") | ||
runs=10 | ||
rm *out | ||
mv report.csv report_old.csv | ||
|
||
for b in "${benchmarks[@]}" | ||
do | ||
for k in 1000000 2000000 3000000 | ||
do | ||
for qs in 40 80 120 160 | ||
do | ||
for ws in 4 8 12 16 | ||
do | ||
for bs in 1 2 4 | ||
do | ||
for node_distr in 0 1 | ||
do | ||
for policy in 0 1 | ||
do | ||
# echo "command: $b $k $qs $ws $bs $node_distr $policy" | ||
echo "benchmark=$b" | ||
echo "num paths=$k" | ||
echo "num queues=$qs" | ||
echo "num workers=$ws" | ||
echo "bulk size=$bs" | ||
echo "enable node redistr=$node_distr" | ||
echo "partition policy=$policy" | ||
./parallel $b out $k $qs $ws $bs $node_distr $policy 1.0 $runs 1 | ||
done | ||
done | ||
done | ||
done | ||
done | ||
done | ||
|
||
|
||
done | ||
|
||
|
Oops, something went wrong.