Skip to content

Commit 008a8a9

Browse files
committed
---
yaml --- r: 15947 b: refs/heads/try c: 5a4e2ae h: refs/heads/master i: 15945: c4952a4 15943: 7e7c3f6 v: v3
1 parent 9c40c7a commit 008a8a9

File tree

2 files changed

+21
-17
lines changed

2 files changed

+21
-17
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: 7f05f088c7e47442e6fee4bfc519227b814b39a4
5+
refs/heads/try: 5a4e2ae70660d5e23e04f7dbb6c1b1ab3c9dd0b0
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105

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

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,7 @@ fn pbfs(graph: graph, key: node_id) -> bfs_result {
261261
}
262262
};
263263

264+
#[inline(always)]
264265
fn is_gray(c: color) -> bool {
265266
alt c {
266267
gray(_) { true }
@@ -274,25 +275,28 @@ fn pbfs(graph: graph, key: node_id) -> bfs_result {
274275
log(info, #fmt("PBFS iteration %?", i));
275276
i += 1u;
276277
let old_len = colors.len();
277-
colors = par::mapi(colors) {|i, c, copy colors|
278+
let pc = ptr::addr_of(colors);
279+
let pg = ptr::addr_of(graph);
280+
colors = par::mapi(colors) {|i, c|
278281
let c : color = c;
279282
alt c {
280283
white {
281-
let i = i as node_id;
282-
283-
let neighbors = graph[i];
284-
285-
let mut color = white;
286-
287-
neighbors.each() {|k|
288-
if is_gray(colors[k]) {
289-
color = gray(k);
290-
false
291-
}
292-
else { true }
293-
};
294-
295-
color
284+
unsafe {
285+
let i = i as node_id;
286+
287+
let neighbors = &(*pg)[i];
288+
289+
let mut color = white;
290+
291+
(*neighbors).each() {|k|
292+
if is_gray((*pc)[k]) {
293+
color = gray(k);
294+
false
295+
}
296+
else { true }
297+
};
298+
color
299+
}
296300
}
297301
gray(parent) { black(parent) }
298302
black(parent) { black(parent) }

0 commit comments

Comments
 (0)