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

GPU backend branch merge #148

Open
wants to merge 117 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 115 commits
Commits
Show all changes
117 commits
Select commit Hold shift + click to select a range
17a90fb
SSSP basic compiling
AjayBrahmakshatriya Sep 23, 2019
d46022b
SSSP compiled and running correctly. Correctness verified
AjayBrahmakshatriya Sep 23, 2019
530b472
Added support for deduplicaiton, unfused_boolmap frontier creation an…
AjayBrahmakshatriya Sep 25, 2019
71692ad
Pull direction working with just VertexBased load balance
AjayBrahmakshatriya Sep 25, 2019
05fb2ab
Added a src filter. Doesn't affect performance for SSSP
AjayBrahmakshatriya Sep 26, 2019
4d79563
reformating and adding new GPU schedule tests
yunmingzhang17 Sep 27, 2019
b0a3392
Merge branch 'gpu_backend' of github.com:GraphIt-DSL/graphit into gpu…
yunmingzhang17 Sep 27, 2019
505441d
Working Hybrid operator
AjayBrahmakshatriya Sep 30, 2019
c4bc834
Fixed the apply expr lower vardecl->assign conversion only if GPU sch…
AjayBrahmakshatriya Sep 30, 2019
cb0c070
Added bitmap support for PULL direction
AjayBrahmakshatriya Oct 1, 2019
9d109fb
Added GPU test framework
AjayBrahmakshatriya Oct 1, 2019
85fb156
Added runtime library tests to GPU test suite
AjayBrahmakshatriya Oct 2, 2019
cde571c
Wrapped load balance functions in host wrappers
AjayBrahmakshatriya Oct 2, 2019
fe272bf
setting up tests for gpu-based priority queue
Oct 3, 2019
5e2ff33
Merge branch 'gpu_backend' of github.com:GraphIt-DSL/graphit into gpu…
Oct 3, 2019
6532105
adding the file for gpu priority queue
Oct 3, 2019
4811023
start working on a sssp_delta_stepping gpu runtime library test
Oct 3, 2019
8b9f8c7
Basic Kernel fusion implemented. Compiling for SSSP. Need to get oper…
AjayBrahmakshatriya Oct 3, 2019
0ea0af5
Merge branch 'gpu_backend' of github.com:GraphIt-DSL/graphit into gpu…
AjayBrahmakshatriya Oct 3, 2019
0439720
Added hoisted decls for fused kernel generation and printing support
AjayBrahmakshatriya Oct 4, 2019
7198946
adding correctness test for sssp, setting up the first verifier
Oct 7, 2019
7ad6cfe
Merge branch 'gpu_backend' of github.com:GraphIt-DSL/graphit into gpu…
Oct 7, 2019
4f29384
Basic Kernel fusion working for SSSP TWCE push unfused
AjayBrahmakshatriya Oct 7, 2019
c318d42
Merge branch 'gpu_backend' of github.com:GraphIt-DSL/graphit into gpu…
AjayBrahmakshatriya Oct 7, 2019
537c5fe
Changed file name for 4.mtx and relevant test cases
AjayBrahmakshatriya Oct 7, 2019
19ba657
Added generating Function declaration before kernel
AjayBrahmakshatriya Oct 8, 2019
ffddce8
Added destination filter to push edge set apply and fixed the bitmap …
AjayBrahmakshatriya Oct 8, 2019
ed487f1
moving the sssp runtime lib into a sssp_lp (label propagation) file, …
Oct 8, 2019
57bea68
converting a true delta stepping version to use the runtime libraries
Oct 8, 2019
561c9ad
merging with the latest code
Oct 8, 2019
09c6e74
gradually adding library rountines for frontier and load balance
Oct 14, 2019
e31115c
adding code to allocate the SP array
Oct 14, 2019
d5923d2
Made the vertexset apply operator more general
AjayBrahmakshatriya Oct 14, 2019
916a532
Merge branch 'gpu_backend' of github.com:GraphIt-DSL/graphit into gpu…
AjayBrahmakshatriya Oct 14, 2019
d4d0ec5
Added test cases for vertex set apply kernel and fixed the call in ss…
AjayBrahmakshatriya Oct 14, 2019
de32c7a
fixing the initialization of SP on device
Oct 14, 2019
d1c9738
Merge branch 'gpu_backend' of github.com:GraphIt-DSL/graphit into gpu…
Oct 14, 2019
8fe8e41
Fixed the broken runtime test and added graphit compile and exec tests
AjayBrahmakshatriya Oct 15, 2019
b609ea0
Merge branch 'gpu_backend' of github.com:GraphIt-DSL/graphit into gpu…
AjayBrahmakshatriya Oct 15, 2019
51ccc4d
switching to the frontier and prepare sparse APIs
Oct 15, 2019
f5f9033
comment out the unncessary parts of the code
Oct 15, 2019
653fca8
adding support for windowing in the updateEdge function
Oct 15, 2019
e3ad3b5
Changed kernel fusion to use local copies instead of global variables
AjayBrahmakshatriya Oct 15, 2019
f468b6c
Merge branch 'gpu_backend' of github.com:GraphIt-DSL/graphit into gpu…
AjayBrahmakshatriya Oct 15, 2019
625ab39
Working Kernel fusion for BFS
AjayBrahmakshatriya Oct 15, 2019
4fac36f
Changed the binary extension in the loader and the loader can directl…
AjayBrahmakshatriya Oct 16, 2019
f85d8a5
fixing a bug with copying window_upper
Oct 16, 2019
07bd866
adding support to pass start vertex as a commandline argument, cleani…
Oct 17, 2019
d6f0000
fixing a bug caused by previous cleanup
Oct 17, 2019
8ee2212
further cleaning up the gpu sssp delta stepping code to get ready for…
Oct 17, 2019
420f56d
Generating working code for PageRank
AjayBrahmakshatriya Oct 17, 2019
5efafa5
Merge branch 'gpu_backend' of github.com:GraphIt-DSL/graphit into gpu…
AjayBrahmakshatriya Oct 17, 2019
38ed3e8
adding support for timing the code
Oct 17, 2019
1e78dd1
Merge branch 'gpu_backend' of github.com:GraphIt-DSL/graphit into gpu…
Oct 17, 2019
7c0d5aa
Fixed the indentation issue with sssp_verified_test to be compatible …
AjayBrahmakshatriya Oct 22, 2019
afbf29a
Merge branch 'gpu_backend' of github.com:GraphIt-DSL/graphit into gpu…
AjayBrahmakshatriya Oct 22, 2019
cd2ae36
updating the priority queue
yunmingzhang17 Oct 22, 2019
a60f25e
Merge branch 'gpu_backend' of github.com:GraphIt-DSL/graphit into gpu…
yunmingzhang17 Oct 22, 2019
7f092a1
Implemented new vector field property analyzer for GPU and changed th…
AjayBrahmakshatriya Oct 22, 2019
5083e35
Merge branch 'gpu_backend' of github.com:GraphIt-DSL/graphit into gpu…
AjayBrahmakshatriya Oct 22, 2019
ce14b3f
Added liveness analysis for frontier reuse in edgeset apply expr
AjayBrahmakshatriya Oct 23, 2019
717cf1f
Fixed all runtime test issues
AjayBrahmakshatriya Oct 23, 2019
7c5b21c
Added support for argv for hybrid threshold and scheduling options fo…
AjayBrahmakshatriya Oct 24, 2019
ff9e4ba
refactoring to current_priority_ , delta, and window_upper_ in the pr…
yunmingzhang17 Oct 24, 2019
3592bab
Merge branch 'gpu_backend' of github.com:GraphIt-DSL/graphit into gpu…
yunmingzhang17 Oct 24, 2019
5bc43cb
Fixed the argv issue not working properly on device
AjayBrahmakshatriya Oct 24, 2019
e72f3ed
Merge branch 'gpu_backend' of github.com:GraphIt-DSL/graphit into gpu…
yunmingzhang17 Oct 24, 2019
e26f331
refactoring out the terminate condition with finished
yunmingzhang17 Oct 24, 2019
bd3ef98
Merged TWC, CM and WM with test cases for all load balance schemes
AjayBrahmakshatriya Oct 25, 2019
494c4d7
Merge branch 'gpu_backend' of github.com:GraphIt-DSL/graphit into gpu…
AjayBrahmakshatriya Oct 25, 2019
bc91bb9
refactoring the code to make frontier a member of priority queue and …
yunmingzhang17 Oct 25, 2019
5f28a18
Merge branch 'gpu_backend' of github.com:GraphIt-DSL/graphit into gpu…
yunmingzhang17 Oct 25, 2019
48f0877
replace the priorities accessed in update_nodes_identify_min and upda…
yunmingzhang17 Oct 25, 2019
c982666
Added strict load balance and test case for strict with test cases fo…
AjayBrahmakshatriya Oct 25, 2019
9d293bf
Merge branch 'gpu_backend' of github.com:GraphIt-DSL/graphit into gpu…
AjayBrahmakshatriya Oct 25, 2019
bae47f1
Fixed small bug in strict
AjayBrahmakshatriya Oct 25, 2019
4f7d15a
switching to launch kernel functions in the dequeue method with point…
yunmingzhang17 Oct 25, 2019
996434a
adding a default NUM_BLOCKS for priority queue
yunmingzhang17 Oct 25, 2019
2464f10
Merge branch 'gpu_backend' of github.com:GraphIt-DSL/graphit into gpu…
yunmingzhang17 Oct 25, 2019
c975b9d
Added graph blocking operation and improved performance of TWCE
AjayBrahmakshatriya Oct 25, 2019
b4bfa59
Small change in TWCE
AjayBrahmakshatriya Oct 25, 2019
122401e
moving the dequeue operation to the start of the while loop instead o…
yunmingzhang17 Oct 28, 2019
8313c6d
refactoring the code to use dequeueReadySet
yunmingzhang17 Oct 29, 2019
5dd4716
cleaning up the refactored code
yunmingzhang17 Oct 29, 2019
fb89292
Merge branch 'gpu_backend' of github.com:GraphIt-DSL/graphit into gpu…
yunmingzhang17 Oct 29, 2019
35a3571
comment out the debug flag
yunmingzhang17 Oct 29, 2019
f06c645
Got CC working. Moved the output frontier enqueing logic inside the UDF
AjayBrahmakshatriya Oct 29, 2019
7dcc7fc
Merge branch 'gpu_backend' of github.com:GraphIt-DSL/graphit into gpu…
AjayBrahmakshatriya Oct 29, 2019
a10baa0
refactoring the finished function to dequeue when the current frontie…
yunmingzhang17 Oct 29, 2019
2af2fbb
Merge branch 'gpu_backend' of github.com:GraphIt-DSL/graphit into gpu…
yunmingzhang17 Oct 29, 2019
23b8c83
using reference for the frontier
yunmingzhang17 Oct 29, 2019
156a3f3
Added the EnqueueVertex operator and fixed the implementation for BFS
AjayBrahmakshatriya Oct 29, 2019
5a6e067
t Merge branch 'gpu_backend' of github.com:GraphIt-DSL/graphit into g…
AjayBrahmakshatriya Oct 29, 2019
437ecb0
refactor with updatePriorityMin on the priority queue
yunmingzhang17 Oct 29, 2019
6e28e5a
Merge branch 'gpu_backend' of github.com:GraphIt-DSL/graphit into gpu…
yunmingzhang17 Oct 29, 2019
0303539
adding a check to make sure only eager or eager with merge schedule w…
yunmingzhang17 Oct 31, 2019
b2cdecc
Fixed all codegen for SSSP_delta_stepping
AjayBrahmakshatriya Nov 5, 2019
1795db6
Working code for Priority Queue with kernel fusion
AjayBrahmakshatriya Nov 8, 2019
489735b
Typo in codegen for fused kernel
AjayBrahmakshatriya Nov 8, 2019
842f1d8
PageRank blocking issue fixed
AjayBrahmakshatriya Nov 22, 2019
98c468c
Fixed soem issues for BFS
AjayBrahmakshatriya Jan 2, 2020
3b854e6
Added GPU autotuner
AjayBrahmakshatriya Feb 28, 2020
2dc1827
Added Pointer jumping version of cc
AjayBrahmakshatriya Mar 5, 2020
6754d68
Removed schedule from pjump
AjayBrahmakshatriya Mar 5, 2020
08c3ae8
BC changes and autotuner support for GPU backend
AjayBrahmakshatriya Apr 21, 2020
8a2e1e0
Added implementation and test cases for MIRMetadata
AjayBrahmakshatriya May 19, 2020
63f31f3
cloning function for mir metadata
AjayBrahmakshatriya May 28, 2020
c3be307
Added perf tests for GPU
AjayBrahmakshatriya Jun 24, 2020
4c8aac8
Update .travis.yml
AjayBrahmakshatriya Jul 1, 2020
729421d
Small changes
AjayBrahmakshatriya Dec 3, 2020
09682fc
Merge branch 'gpu_backend' of github.com:GraphIt-DSL/graphit into gpu…
AjayBrahmakshatriya Dec 3, 2020
5974418
Very minor code generation bug
AjayBrahmakshatriya Dec 3, 2020
6cc3eca
Update README.md
AjayBrahmakshatriya Mar 10, 2021
42ff6cb
Merge completed. All CPU + GPU tests passing
AjayBrahmakshatriya Mar 19, 2021
f8646f1
Added CGO21 AE to the repo, all tests passing
AjayBrahmakshatriya Mar 19, 2021
7acdcef
Fixed minor Codegen bug for AE
AjayBrahmakshatriya Nov 18, 2021
b55323b
Merge pull request #154 from GraphIt-DSL/cgo_ae
AjayBrahmakshatriya Dec 3, 2021
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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,7 @@
.settings/
.idea/
build/
autotune/*.json
*.graphit_bin
*.graphit_sbin
cmake-build-debug/
10 changes: 10 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,19 @@ add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/graphit.py
VERBATIM
)

find_package(CUDA QUIET)

add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/gpu_tests/all_gpu_tests.py
COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/gpu_tests
COMMAND sed -e s?\$\{NVCC_COMPILER\}?${CUDA_NVCC_EXECUTABLE}?g -e s?\$\{GRAPHIT_SOURCE_DIRECTORY\}?${CMAKE_SOURCE_DIR}?g -e s?\$\{CXX_COMPILER\}?${CMAKE_CXX_COMPILER}?g -e s?\$\{GRAPHIT_BUILD_DIRECTORY\}?${CMAKE_BINARY_DIR}?g ${CMAKE_SOURCE_DIR}/test/gpu_tests/all_gpu_tests.py > ${CMAKE_BINARY_DIR}/gpu_tests/all_gpu_tests.py
DEPENDS ${CMAKE_SOURCE_DIR}/test/gpu_tests/all_gpu_tests.py
VERBATIM
)

add_custom_target(copy_graphitc_py ALL DEPENDS ${GRAPHITC_PY})
add_custom_target(copy_python_tests ALL DEPENDS ${CMAKE_BINARY_DIR}/python_tests/test_with_schedules.py ${CMAKE_BINARY_DIR}/python_tests/test.py ${CMAKE_BINARY_DIR}/python_tests/pybind_test.py)
add_custom_target(copy_graphit_py ALL DEPENDS ${CMAKE_BINARY_DIR}/graphit.py)
add_custom_target(copy_all_gpu_tests_py ALL DEPENDS ${CMAKE_BINARY_DIR}/gpu_tests/all_gpu_tests.py)

configure_file(src/main.cpp ${CMAKE_BINARY_DIR}/bin/main.cpp COPYONLY)
configure_file(test/library_test_drivers/library_test_driver_cpp.txt ${CMAKE_BINARY_DIR}/bin/library_test_driver.cpp COPYONLY)
Expand Down
55 changes: 55 additions & 0 deletions apps/cc_pjump.gt
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
element Vertex end
element Edge end

const edges : edgeset{Edge}(Vertex,Vertex) = load (argv[1]);

const vertices : vertexset{Vertex} = edges.getVertices();
const IDs : vector{Vertex}(int) = 1;

const update: vector[1](int);

func updateEdge(src : Vertex, dst : Vertex)
var src_id: Vertex = IDs[src];
var dst_id: Vertex = IDs[dst];

IDs[dst_id] min= IDs[src_id];
IDs[src_id] min= IDs[dst_id];
end

func init(v : Vertex)
IDs[v] = v;
end

func pjump(v: Vertex)
var y: Vertex = IDs[v];
var x: Vertex = IDs[y];
if x != y
IDs[v] = x;
update[0] = 1;
end
end

func main()
var n : int = edges.getVertices();
for trail in 0:10
var frontier : vertexset{Vertex} = new vertexset{Vertex}(n);
startTimer();
vertices.apply(init);
while (frontier.getVertexSetSize() != 0)
#s1# var output: vertexset{Vertex} = edges.from(frontier).applyModified(updateEdge,IDs);
delete frontier;
frontier = output;
update[0] = 1;
while update[0] != 0
update[0] = 0;
vertices.apply(pjump);
end
end
var elapsed_time : float = stopTimer();
delete frontier;
print "elapsed time: ";
print elapsed_time;
end
end


1 change: 1 addition & 0 deletions autotune/cmd.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
python3 graphit_gpu_autotuner.py --graph /local/ajaybr/graph-dataset/clean_general/soc-LiveJournal1.mtx --algo_file gpu_apps/sssp_delta_stepping.gt --killed_process_report_runtime_limit 1 --max_delta 100 --runtime_limit 10 --stop-after 900
3 changes: 3 additions & 0 deletions autotune/compile_gpu.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
python ../build/bin/graphitc.py -a algotorun.gt -f schedule_0 -o test.cu
/usr/local/cuda/bin/nvcc -ccbin /usr/bin/c++ -std=c++11 -I ../src/runtime_lib/ -o test -Xcompiler "-w" -O3 test.cu -DNUM_CTA=80 -DCTA_SIZE=512 -Wno-deprecated-gpu-targets -gencode arch=compute_70,code=sm_70 --use_fast_math -Xptxas "-v -dlcm=ca --maxrregcount=64" -rdc=true -DFRONTIER_MULTIPLIER=3
#/usr/local/cuda/bin/nvcc -ccbin /usr/bin/c++ -std=c++11 -I ../src/runtime_lib/ -o test -Xcompiler "-w" -O3 test.cu -DNUM_CTA=60 -DCTA_SIZE=512 -Wno-deprecated-gpu-targets -gencode arch=compute_61,code=sm_61 --use_fast_math -Xptxas "-v -dlcm=ca --maxrregcount=64" -rdc=true -DFRONTIER_MULTIPLIER=2
41 changes: 41 additions & 0 deletions autotune/gpu_apps/bfs.gt
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
element Vertex end
element Edge end

const edges : edgeset{Edge}(Vertex,Vertex) = load (argv[1]);
const vertices : vertexset{Vertex} = edges.getVertices();
const parent : vector{Vertex}(int) = -1;


func updateEdge(src : Vertex, dst : Vertex)
parent[dst] = src;
end

func toFilter(v : Vertex) -> output : bool
output = parent[v] == -1;
end

func reset(v: Vertex)
parent[v] = -1;
end

func main()
for trail in 0:10
var frontier : vertexset{Vertex} = new vertexset{Vertex}(0);
startTimer();
vertices.apply(reset);
var start_vertex : int = atoi(argv[2]);
frontier.addVertex(start_vertex);
parent[start_vertex] = start_vertex;

#s0# while (frontier.getVertexSetSize() != 0)
#s1# var output : vertexset{Vertex} = edges.from(frontier).to(toFilter).applyModified(updateEdge,parent, true);
delete frontier;
frontier = output;
end
var elapsed_time : float = stopTimer();
delete frontier;
print "elapsed time: ";
print elapsed_time;
end
end

55 changes: 55 additions & 0 deletions autotune/gpu_apps/cc.gt
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
element Vertex end
element Edge end

const edges : edgeset{Edge}(Vertex,Vertex) = load (argv[1]);

const vertices : vertexset{Vertex} = edges.getVertices();
const IDs : vector{Vertex}(int) = 1;

const update: vector[1](int);

func updateEdge(src : Vertex, dst : Vertex)
var src_id: Vertex = IDs[src];
var dst_id: Vertex = IDs[dst];

IDs[dst_id] min= IDs[src_id];
IDs[src_id] min= IDs[dst_id];
end

func init(v : Vertex)
IDs[v] = v;
end

func pjump(v: Vertex)
var y: Vertex = IDs[v];
var x: Vertex = IDs[y];
if x != y
IDs[v] = x;
update[0] = 1;
end
end

func main()
var n : int = edges.getVertices();
for trail in 0:10
var frontier : vertexset{Vertex} = new vertexset{Vertex}(n);
startTimer();
vertices.apply(init);
#s0# while (frontier.getVertexSetSize() != 0)
#s1# var output: vertexset{Vertex} = edges.from(frontier).applyModified(updateEdge,IDs);
delete frontier;
frontier = output;
update[0] = 1;
while update[0] != 0
update[0] = 0;
vertices.apply(pjump);
end
end
var elapsed_time : float = stopTimer();
delete frontier;
print "elapsed time: ";
print elapsed_time;
end
end


53 changes: 53 additions & 0 deletions autotune/gpu_apps/pagerank.gt
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
element Vertex end
element Edge end
const edges : edgeset{Edge}(Vertex,Vertex) = load (argv[1]);
const vertices : vertexset{Vertex} = edges.getVertices();
const old_rank : vector{Vertex}(float) = 1.0/vertices.size();
const new_rank : vector{Vertex}(float) = 0.0;
const out_degree : vector {Vertex}(int) = edges.getOutDegrees();
const contrib : vector{Vertex}(float) = 0.0;
const error : vector{Vertex}(float) = 0.0;
const damp : float = 0.85;
const beta_score : float = (1.0 - damp) / vertices.size();

func computeContrib(v : Vertex)
contrib[v] = old_rank[v] / out_degree[v];
end

func updateEdge(src : Vertex, dst : Vertex)
new_rank[dst] += contrib[src];
end

func updateVertex(v : Vertex)
var old_score : float = old_rank[v];
new_rank[v] = beta_score + damp*(new_rank[v]);
error[v] = fabs(new_rank[v] - old_rank[v]);
old_rank[v] = new_rank[v];
new_rank[v] = 0.0;
end

func printRank(v : Vertex)
print old_rank[v];
end

func reset(v: Vertex)
old_rank[v] = 1.0/vertices.size();
new_rank[v] = 0.0;
end

func main()
for trail in 0:10
startTimer();
vertices.apply(reset);
#s0# for i in 0:20
vertices.apply(computeContrib);
#s1# edges.apply(updateEdge);
vertices.apply(updateVertex);
end

var elapsed_time : float = stopTimer();
print "elapsed time: ";
print elapsed_time;
end
end

38 changes: 38 additions & 0 deletions autotune/gpu_apps/sssp_delta_stepping.gt
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
element Vertex end
element Edge end
const edges : edgeset{Edge}(Vertex,Vertex, int) = load (argv[1]);
const vertices : vertexset{Vertex} = edges.getVertices();
const dist : vector{Vertex}(int) = 2147483647; %should be INT_MAX
const pq: priority_queue{Vertex}(int);

func updateEdge(src : Vertex, dst : Vertex, weight : int)
var new_dist : int = dist[src] + weight;
pq.updatePriorityMin(dst, dist[dst], new_dist);
end

func printDist(v : Vertex)
print dist[v];
end

func reset(v: Vertex)
dist[v] = 2147483647;
end

func main()
for trail in 0:10
var start_vertex : int = atoi(argv[2]);
pq = new priority_queue{Vertex}(int)(false, false, dist, 1, 2, false, start_vertex);
startTimer();
vertices.apply(reset);
dist[start_vertex] = 0;
#s0# while (pq.finished() == false)
var frontier : vertexset{Vertex} = pq.dequeue_ready_set(); % dequeue lowest priority nodes
#s1# edges.from(frontier).applyUpdatePriority(updateEdge);
delete frontier;
end
var elapsed_time : float = stopTimer();
print "elapsed time: ";
print elapsed_time;
delete pq;
end
end
Loading