Skip to content

Commit 69bc0eb

Browse files
committed
---
yaml --- r: 16126 b: refs/heads/try c: 58fdbdc h: refs/heads/master v: v3
1 parent 8bf02e1 commit 69bc0eb

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
refs/heads/master: 61b1875c16de39c166b0f4d54bba19f9c6777d1a
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
5-
refs/heads/try: f0c345841ce14f6ce618d1ed09c1d728bd253c87
5+
refs/heads/try: 58fdbdc4ef7cee014775bafff23830900fcaf3ca
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105

branches/try/src/test/bench/graph500-bfs.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ fn bfs2(graph: graph, key: node_id) -> bfs_result {
199199
}
200200

201201
#[doc="A parallel version of the bfs function."]
202-
fn pbfs(graph: graph, key: node_id) -> bfs_result {
202+
fn pbfs(&&graph: arc::arc<graph>, key: node_id) -> bfs_result {
203203
// This works by doing functional updates of a color vector.
204204

205205
enum color {
@@ -210,7 +210,7 @@ fn pbfs(graph: graph, key: node_id) -> bfs_result {
210210
black(node_id)
211211
};
212212

213-
let mut colors = vec::from_fn(graph.len()) {|i|
213+
let mut colors = vec::from_fn((*arc::get(&graph)).len()) {|i|
214214
if i as node_id == key {
215215
gray(key)
216216
}
@@ -227,8 +227,6 @@ fn pbfs(graph: graph, key: node_id) -> bfs_result {
227227
}
228228
}
229229

230-
let graph = arc::arc(copy graph);
231-
232230
let mut i = 0u;
233231
while par::any(colors, is_gray) {
234232
// Do the BFS.
@@ -386,7 +384,7 @@ fn main(args: [str]) {
386384
let scale = uint::from_str(args[1]).get();
387385
let num_keys = uint::from_str(args[2]).get();
388386
let do_validate = false;
389-
let do_sequential = true;
387+
let do_sequential = false;
390388

391389
let start = time::precise_time_s();
392390
let edges = make_edges(scale, 16u);
@@ -409,6 +407,8 @@ fn main(args: [str]) {
409407
let mut total_seq = 0.0;
410408
let mut total_par = 0.0;
411409

410+
let graph_arc = arc::arc(copy graph);
411+
412412
gen_search_keys(graph, num_keys).map() {|root|
413413
io::stdout().write_line("");
414414
io::stdout().write_line(#fmt("Search key: %?", root));
@@ -456,7 +456,7 @@ fn main(args: [str]) {
456456
}
457457

458458
let start = time::precise_time_s();
459-
let bfs_tree = pbfs(graph, root);
459+
let bfs_tree = pbfs(graph_arc, root);
460460
let stop = time::precise_time_s();
461461

462462
total_par += stop - start;

0 commit comments

Comments
 (0)