Skip to content

Commit 44bea03

Browse files
committed
Updating bfs to work with the new random methods.
1 parent 2443152 commit 44bea03

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

src/test/bench/graph500-bfs.rs

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import std::map;
1010
import std::map::hashmap;
1111
import std::deque;
1212
import std::deque::t;
13-
//import std::par;
1413
import io::writer_util;
1514
import comm::*;
1615
import int::abs;
@@ -76,7 +75,7 @@ fn make_edges(scale: uint, edgefactor: uint) -> [(node_id, node_id)] {
7675
let j = j * 2;
7776
let scale = scale - 1u;
7877

79-
let x = r.next_float();
78+
let x = r.gen_float();
8079

8180
if x < A {
8281
choose_edge(i, j, scale, r)
@@ -123,14 +122,8 @@ fn gen_search_keys(graph: graph, n: uint) -> [node_id] {
123122
let keys = map::int_hash();
124123
let r = rand::rng();
125124

126-
impl methods for rand::rng {
127-
fn r64() -> u64 {
128-
self.next() as u64 << 32u + self.next() as u64
129-
}
130-
}
131-
132125
while keys.size() < n {
133-
let k = r.r64() % graph.len() as node_id;
126+
let k = r.gen_u64() % graph.len() as node_id;
134127

135128
if graph[k].len() > 0u && vec::any(graph[k]) {|i|
136129
i != k

0 commit comments

Comments
 (0)