Skip to content

Commit

Permalink
added new binaries to graphing code
Browse files Browse the repository at this point in the history
  • Loading branch information
Magdalen Dobson committed Feb 10, 2024
1 parent fef7969 commit dd0f290
Show file tree
Hide file tree
Showing 10 changed files with 267 additions and 234 deletions.
385 changes: 187 additions & 198 deletions benchmarks/concurrentKNN/octTree/create_graphs.py

Large diffs are not rendered by default.

28 changes: 13 additions & 15 deletions benchmarks/concurrentKNN/octTree/experiments.sh
Original file line number Diff line number Diff line change
@@ -1,31 +1,29 @@
#!/bin/bash

mkdir -p graphs
#run to quickly test the setup
python3 run_experiments.py [neighbors_bench,neighbors_bench_path_copy,neighbors_bench_lockfree,neighbors_bench_hoh] [36,72,144] [50] [1,10] 3 [3DinCube_20M]


# python3 run_experiments.py [neighbors_bench,neighbors_bench_path_copy] [1,2,4,8,12,36,72,144] 100 [1,10] 3 3DinCube_20M
# python3 run_experiments.py [neighbors_bench,neighbors_bench_path_copy] [1,2,4,8,12,36,72,144] 50 [1,10] 3 3DinCube_20M
# python3 run_experiments.py [neighbors_bench,neighbors_bench_path_copy] [1,2,4,8,12,36,72,144] 10 [1,10] 3 3DinCube_20M
# python3 run_experiments.py [neighbors_bench,neighbors_bench_path_copy,neighbors_bench_lockfree,neighbors_bench_hoh] [1,2,4,8,12,36,72,144] [100] [1] 3 [3DinCube_20M]
# python3 run_experiments.py [neighbors_bench,neighbors_bench_path_copy] [1,2,4,8,12,36,72,144] [50] [1,10] 3 3DinCube_20M
# python3 run_experiments.py [neighbors_bench,neighbors_bench_path_copy] [1,2,4,8,12,36,72,144] [10] [1,10] 3 3DinCube_20M


# python3 run_experiments.py [neighbors_bench,neighbors_bench_path_copy] [1,2,4,8,12,36,72,144] 10 [1,10] 3 3DinCube_2M

# python3 run_experiments.py [neighbors_bench,neighbors_bench_path_copy] [1,2,4,8,12,36,72,144] 10 [1,10] 2 2DinCube_20M
# python3 run_experiments.py [neighbors_bench,neighbors_bench_path_copy] [1,2,4,8,12,36,72,144] [50] [1,10] 2 [2DinCube_20M]

# python3 run_experiments.py [neighbors_bench,neighbors_bench_path_copy] [1,2,4,8,12,36,72,144] 10 [1,10] 3 3Dplummer_20M
# python3 run_experiments.py [neighbors_bench,neighbors_bench_path_copy] [144] [50] [1,10] 3 [3DinCube_2M,3DinCube_20M,3DinCube_200M,3DinCube_2B]

# python3 run_experiments.py [neighbors_bench,neighbors_bench_path_copy] [1,2,4,8,12,36,72,144] 10 [1,10] 3 lucy3D_2M
# python3 run_experiments.py [neighbors_bench] [144] [0,25,50,75,100] [1] 3 [3Dplummer_20M]
# python3 run_experiments.py [neighbors_bench] [144] [0,25,50,75,100] [1] 3 [3DinCube_20M]

# python3 run_experiments.py [neighbors_bench,neighbors_bench_path_copy] [1,2,4,8,12,36,72,144] 10 [1,10] 3 lucy3D_14M
# python3 run_experiments.py [neighbors_bench,neighbors_bench_path_copy] [1,2,4,8,12,36,72,144] 50 [1,10] 3 lucy3D_14M
# python3 run_experiments.py [neighbors_bench,neighbors_bench_path_copy] [1,2,4,8,12,36,72,144] 100 [1,10] 3 lucy3D_14M
# python3 run_experiments.py [neighbors_bench,neighbors_bench_path_copy] [1,2,4,8,12,36,72,144] [10] [1,10] 3 3DPlummer_20M

# python3 run_experiments.py [neighbors_bench,neighbors_bench_path_copy] [1,2,4,8,12,36,72,144] 10 [1,10] 3 thai_statue2M
# python3 run_experiments.py [neighbors_bench,neighbors_bench_path_copy] [1,2,4,8,12,36,72,144] [50] [1,10] 3 lucy3D_14M

# python3 run_experiments.py [neighbors_bench,neighbors_bench_path_copy] [1,2,4,8,12,36,72,144] 10 [1,10] 3 thai_statue5M
# python3 run_experiments.py [neighbors_bench,neighbors_bench_path_copy] [1,2,4,8,12,36,72,144] 50 [1,10] 3 thai_statue5M
# python3 run_experiments.py [neighbors_bench,neighbors_bench_path_copy] [1,2,4,8,12,36,72,144] [50] [1,10] 3 thai_statue5M

# python3 run_experiments.py [range_bench,range_bench_path_copy] [1,2,4,8,12,36,72,144] 10 [.014,.0176] 3 3Dplummer_20M
# python3 run_experiments.py [range_bench,range_bench_path_copy] [1,2,4,8,12,36,72,144] [10] [.014,.0176] 3 [3Dplummer_20M]



Expand Down
2 changes: 1 addition & 1 deletion benchmarks/concurrentKNN/octTree/flock/spin_lock.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// is_locked() -> bool

#include <parlay/parallel.h> // needed for worker_id
#include <flock/epoch.h> // for worker_id()
#include "epoch.h" // for worker_id()

#include <atomic>
#include<chrono>
Expand Down
1 change: 1 addition & 0 deletions benchmarks/concurrentKNN/octTree/neighbors_bench.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ void ANN(parlay::sequence<vtx*> &v, int k, int p, double trial_time, int update_
std::cout << "update_percent: " << update_percent << std::endl;
std::cout << "query size: " << k << std::endl;
std::cout << "trial_time: " << trial_time << std::endl;
std::cout << "index_size: " << v.size()/2 << std::endl;

//calculate bounding box around the whole point set
box whole_box = knn_tree::o_tree::get_box(v);
Expand Down
75 changes: 60 additions & 15 deletions benchmarks/concurrentKNN/octTree/run_experiments.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,22 +30,42 @@

data_options = {
"2DinCube_20M" : "../geometryData/data/2DinCube_20000000",
"3DinCube_2K" : "../geometryData/data/3DinCube_2000",
"3DinCube_20K" : "../geometryData/data/3DinCube_20000",
"3DinCube_200K" : "../geometryData/data/3DinCube_200000",
"3DinCube_2M" : "../geometryData/data/3DinCube_2000000",
"3DinCube_20M" : "../geometryData/data/3DinCube_20000000",
"3DinCube_200M" : "/ssd0/geometryData/3DinCube_200M",
"3DinCube_2B" : "/ssd0/geometryData/3DinCube_2B",
"3Dplummer_20M" : "../geometryData/data/3Dplummer_20000000",
"lucy3D_2M" : "/ssd0/angel/lucy3D_2M",
"lucy3D_14M" : "/ssd0/angel/lucy3D_14M",
"thai_statue2M" : "/ssd0/thai_statue/thai_statue2M",
"thai_statue5M" : "/ssd0/thai_statue/thai_statue5M",
}

data_sizes = {
"2DinCube_20M" : 10000000,
"3DinCube_2K" : 1000,
"3DinCube_20K" : 10000,
"3DinCube_200K" : 100000,
"3DinCube_2M" : 1000000,
"3DinCube_20M" : 10000000,
"3DinCube_200M" : 100000000,
"3Dplummer_20M" : 10000000,
"lucy3D_2M" : 1000000,
"lucy3D_14M" : 7000000,
"thai_statue2M" : 1000000,
"thai_statue5M" : 2500000,
}

parser = argparse.ArgumentParser()
parser.add_argument("ds_type", help="datastructure type")
parser.add_argument("threads", help="Number of threads")
parser.add_argument("ratios", help="Update ratio, number between 0 and 100.")
parser.add_argument("query_sizes", help="size of query (k)")
parser.add_argument("dimension", help="dimension of data")
parser.add_argument("input_name", help="input name")
parser.add_argument("input_names", help="input names")
parser.add_argument("-t", "--test_only", help="test script",
action="store_true")
parser.add_argument("-g", "--graphs_only", help="graphs only",
Expand All @@ -55,10 +75,10 @@
args = parser.parse_args()
print("datastructure: " + args.ds_type)
print("threads: " + args.threads)
print("update percent: " + args.ratios)
print("update percents: " + args.ratios)
print("query_sizes: " + args.query_sizes)
print("dimension: " + args.dimension)
print("input_name: " + args.input_name)
print("input_names: " + args.input_names)

test_only = args.test_only
graphs_only = args.graphs_only
Expand Down Expand Up @@ -94,7 +114,7 @@ def runstring(test, op, outfile, k):

def runtest(test,procs,u,k,d,infile,extra,outfile) :
r = rounds
otherargs = " -c -t 10.0 "
otherargs = " -c -t 1.0 "

runstring(test, "PARLAY_NUM_THREADS=" + str(min(int(procs), maxcpus)) + " numactl -i all ./" + test + " -r " + str(r) + " -d " + str(d) + " -k " + str(k) + " -p " + str(procs) + extra + " -u " + str(u) + otherargs + " " + infile, outfile, k)

Expand All @@ -105,8 +125,7 @@ def runtest(test,procs,u,k,d,infile,extra,outfile) :
ratios = args.ratios
query_sizes = args.query_sizes
dimension = args.dimension
input_name = args.input_name
input_file = data_options[input_name]
input_names = args.input_names

if '[' in args.threads:
exp_type = "scalability"
Expand All @@ -127,14 +146,32 @@ def runtest(test,procs,u,k,d,infile,extra,outfile) :
print('invalid argument')
exit(1)

if '[' in args.ratios:
ratios = string_to_list(ratios)
else:
print('invalid argument')
exit(1)

if '[' in args.input_names:
input_names = string_to_list(input_names)
else:
print('invalid argument')
exit(1)

input_files = []
for name in input_names:
input_files.append(data_options[name])
print(input_files)



for i in ds_types:
if i.find("range") != -1:
exp_category = "range"
else:
exp_category = "neighbors"

outfile = "results/" + exp_category + "-".join([ratios+"up", input_name]) + ".txt"
outfile = "results/" + exp_category + "-".join([input_names[0]]) + ".txt"

datastructures=[]
for ds in ds_types:
Expand All @@ -143,32 +180,40 @@ def runtest(test,procs,u,k,d,infile,extra,outfile) :
if not graphs_only:
# clear output file
os.system("echo \"\" > " + outfile)
for ds in datastructures:
for th in to_list(threads):
for k in to_list(query_sizes):
runtest(ds,th,ratios,k,dimension,input_file,"",outfile)
for file in input_files:
for ds in datastructures:
for th in to_list(threads):
for k in to_list(query_sizes):
for u in to_list(ratios):
runtest(ds,th,u,k,dimension,file,"",outfile)

throughput = {}
stddev = {}
threads = []
ratios = []
algs = []
sizes = []

readResultsFile(outfile, throughput, stddev, threads, ratios, algs)
readResultsFile(outfile, throughput, stddev, threads, ratios, sizes, algs)

threads.sort()
ratios.sort()

print('threads: ' + str(threads))
print('update ratios: ' + str(ratios))
print('algs: ' + str(algs))
print(throughput)

graph_name=exp_category+input_name
graph_name=exp_category+input_names[0]

alg_names=[]
for ds in ds_types:
for k in query_sizes:
alg_names.append(ds+"-"+str(k))

plot_scalability_graphs(throughput, stddev, threads, ratios, alg_names, graph_name, args.paper_ver)

if(len(input_names) <= 1):
plot_scalability_graphs(throughput, stddev, threads, ratios, sizes[0], alg_names, "scalability_"+graph_name, args.paper_ver)
plot_ratio_graphs(throughput, stddev, threads, ratios, sizes[0], alg_names, "ratio_"+graph_name, args.paper_ver)
else:
plot_size_graphs(throughput, stddev, threads, ratios, sizes, alg_names, "sizes_"+graph_name, args.paper_ver)

2 changes: 1 addition & 1 deletion benchmarks/concurrentKNN/octTree/verlib/timestamps.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#pragma once
#include <limits>
#include <atomic>
#include "flock/epoch.h"
#include "../flock/epoch.h"
#include <x86intrin.h>

namespace verlib {
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/concurrentKNN/octTree/verlib/verlib.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#pragma once
#include <parlay/parallel.h>
#include <parlay/sequence.h>
#include "flock/flock.h"
#include "../flock/flock.h"

namespace verlib {
bool strict_lock = false;
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/concurrentKNN/octTree/verlib/versioned_hybrid.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include "flock/flock.h"
#include "../flock/flock.h"
#include "timestamps.h"

namespace verlib {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#pragma once
#include "flock/flock.h"
#include "../flock/flock.h"
#include "timestamps.h"

namespace verlib {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
// PPoPP 2021

#pragma once
#include "flock/flock.h"
#include "../flock/flock.h"
#include "timestamps.h"

namespace verlib {
Expand Down

0 comments on commit dd0f290

Please sign in to comment.