Skip to content

Commit d0e9a14

Browse files
committed
---
yaml --- r: 35935 b: refs/heads/try2 c: f5f3a75 h: refs/heads/master i: 35933: a5f4fd6 35931: b7af6e5 35927: 7b3f300 35919: 9c3b48d 35903: 79dc866 v: v3
1 parent 74dfdad commit d0e9a14

16 files changed

+125
-124
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: eb8fd119c65c67f3b1b8268cc7341c22d39b7b61
55
refs/heads/try: d324a424d8f84b1eb049b12cf34182bda91b0024
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: e18c6bb3b6f9daab455227dae384d9a3b961aa1c
8+
refs/heads/try2: f5f3a75b6501c987ffb34b3fb7510e0139c64bb8
99
refs/heads/incoming: d9317a174e434d4c99fc1a37fd7dc0d2f5328d37
1010
refs/heads/dist-snap: 22efa39382d41b084fde1719df7ae8ce5697d8c9
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596

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

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ fn bfs(graph: graph, key: node_id) -> bfs_result {
119119
Q.add_back(key);
120120
marks[key] = key;
121121

122-
while Q.size() > 0u {
122+
while Q.size() > 0 {
123123
let t = Q.pop_front();
124124

125125
do graph[t].each() |k| {
@@ -131,7 +131,7 @@ fn bfs(graph: graph, key: node_id) -> bfs_result {
131131
};
132132
}
133133

134-
vec::from_mut(marks)
134+
vec::from_mut(move marks)
135135
}
136136

137137
/**
@@ -167,11 +167,11 @@ fn bfs2(graph: graph, key: node_id) -> bfs_result {
167167
}
168168
}
169169

170-
let mut i = 0u;
170+
let mut i = 0;
171171
while vec::any(colors, is_gray) {
172172
// Do the BFS.
173173
log(info, fmt!("PBFS iteration %?", i));
174-
i += 1u;
174+
i += 1;
175175
colors = do colors.mapi() |i, c| {
176176
let c : color = *c;
177177
match c {
@@ -245,13 +245,13 @@ fn pbfs(&&graph: arc::ARC<graph>, key: node_id) -> bfs_result {
245245
i += 1;
246246
let old_len = colors.len();
247247

248-
let color = arc::ARC(colors);
248+
let color = arc::ARC(move colors);
249249

250250
let color_vec = arc::get(&color); // FIXME #3387 requires this temp
251251
colors = do par::mapi_factory(*color_vec) {
252252
let colors = arc::clone(&color);
253253
let graph = arc::clone(&graph);
254-
fn~(+i: uint, +c: color) -> color {
254+
fn~(move graph, move colors, +i: uint, +c: color) -> color {
255255
let c : color = c;
256256
let colors = arc::get(&colors);
257257
let graph = arc::get(&graph);
@@ -388,7 +388,7 @@ fn main() {
388388
let args = os::args();
389389
let args = if os::getenv(~"RUST_BENCH").is_some() {
390390
~[~"", ~"15", ~"48"]
391-
} else if args.len() <= 1u {
391+
} else if args.len() <= 1 {
392392
~[~"", ~"10", ~"16"]
393393
} else {
394394
args
@@ -400,21 +400,21 @@ fn main() {
400400
let do_sequential = true;
401401

402402
let start = time::precise_time_s();
403-
let edges = make_edges(scale, 16u);
403+
let edges = make_edges(scale, 16);
404404
let stop = time::precise_time_s();
405405

406406
io::stdout().write_line(fmt!("Generated %? edges in %? seconds.",
407407
vec::len(edges), stop - start));
408408

409409
let start = time::precise_time_s();
410-
let graph = make_graph(1u << scale, edges);
410+
let graph = make_graph(1 << scale, edges);
411411
let stop = time::precise_time_s();
412412

413-
let mut total_edges = 0u;
413+
let mut total_edges = 0;
414414
vec::each(graph, |edges| { total_edges += edges.len(); true });
415415

416416
io::stdout().write_line(fmt!("Generated graph with %? edges in %? seconds.",
417-
total_edges / 2u,
417+
total_edges / 2,
418418
stop - start));
419419

420420
let mut total_seq = 0.0;

branches/try2/src/test/bench/msgsend-pipes-shared.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ use io::WriterUtil;
1919
use pipes::{Port, Chan, SharedChan};
2020

2121
macro_rules! move_out (
22-
{ $x:expr } => { unsafe { let y <- *ptr::addr_of(&($x)); y } }
22+
{ $x:expr } => { unsafe { let y <- *ptr::addr_of(&($x)); move y } }
2323
)
2424

2525
enum request {
@@ -50,26 +50,26 @@ fn run(args: &[~str]) {
5050
let (to_parent, from_child) = pipes::stream();
5151
let (to_child, from_parent) = pipes::stream();
5252

53-
let to_child = SharedChan(to_child);
53+
let to_child = SharedChan(move to_child);
5454

5555
let size = uint::from_str(args[1]).get();
5656
let workers = uint::from_str(args[2]).get();
5757
let num_bytes = 100;
5858
let start = std::time::precise_time_s();
5959
let mut worker_results = ~[];
60-
for uint::range(0u, workers) |i| {
60+
for uint::range(0, workers) |_i| {
6161
let to_child = to_child.clone();
6262
do task::task().future_result(|+r| {
63-
worker_results.push(r);
64-
}).spawn {
65-
for uint::range(0u, size / workers) |_i| {
63+
worker_results.push(move r);
64+
}).spawn |move to_child| {
65+
for uint::range(0, size / workers) |_i| {
6666
//error!("worker %?: sending %? bytes", i, num_bytes);
6767
to_child.send(bytes(num_bytes));
6868
}
6969
//error!("worker %? exiting", i);
7070
};
7171
}
72-
do task::spawn {
72+
do task::spawn |move from_parent, move to_parent| {
7373
server(from_parent, to_parent);
7474
}
7575

branches/try2/src/test/bench/msgsend-pipes.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use io::WriterUtil;
1515
use pipes::{Port, PortSet, Chan};
1616

1717
macro_rules! move_out (
18-
{ $x:expr } => { unsafe { let y <- *ptr::addr_of(&($x)); y } }
18+
{ $x:expr } => { unsafe { let y <- *ptr::addr_of(&($x)); move y } }
1919
)
2020

2121
enum request {
@@ -46,27 +46,27 @@ fn run(args: &[~str]) {
4646
let (to_parent, from_child) = pipes::stream();
4747
let (to_child, from_parent_) = pipes::stream();
4848
let from_parent = PortSet();
49-
from_parent.add(from_parent_);
49+
from_parent.add(move from_parent_);
5050

5151
let size = uint::from_str(args[1]).get();
5252
let workers = uint::from_str(args[2]).get();
5353
let num_bytes = 100;
5454
let start = std::time::precise_time_s();
5555
let mut worker_results = ~[];
56-
for uint::range(0u, workers) |i| {
56+
for uint::range(0, workers) |_i| {
5757
let (to_child, from_parent_) = pipes::stream();
58-
from_parent.add(from_parent_);
58+
from_parent.add(move from_parent_);
5959
do task::task().future_result(|+r| {
60-
worker_results.push(r);
61-
}).spawn {
62-
for uint::range(0u, size / workers) |_i| {
60+
worker_results.push(move r);
61+
}).spawn |move to_child| {
62+
for uint::range(0, size / workers) |_i| {
6363
//error!("worker %?: sending %? bytes", i, num_bytes);
6464
to_child.send(bytes(num_bytes));
6565
}
6666
//error!("worker %? exiting", i);
6767
};
6868
}
69-
do task::spawn {
69+
do task::spawn |move from_parent, move to_parent| {
7070
server(from_parent, to_parent);
7171
}
7272

branches/try2/src/test/bench/msgsend-ring-mutex-arcs.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -33,26 +33,26 @@ fn recv(p: &pipe) -> uint {
3333

3434
fn init() -> (pipe,pipe) {
3535
let m = arc::MutexARC(~[]);
36-
((&m).clone(), m)
36+
((&m).clone(), move m)
3737
}
3838

3939

4040
fn thread_ring(i: uint,
4141
count: uint,
4242
+num_chan: pipe,
4343
+num_port: pipe) {
44-
let mut num_chan <- Some(num_chan);
45-
let mut num_port <- Some(num_port);
44+
let mut num_chan <- Some(move num_chan);
45+
let mut num_port <- Some(move num_port);
4646
// Send/Receive lots of messages.
4747
for uint::range(0u, count) |j| {
4848
//error!("task %?, iter %?", i, j);
4949
let mut num_chan2 = option::swap_unwrap(&mut num_chan);
5050
let mut num_port2 = option::swap_unwrap(&mut num_port);
5151
send(&num_chan2, i * j);
52-
num_chan = Some(num_chan2);
52+
num_chan = Some(move num_chan2);
5353
let _n = recv(&num_port2);
5454
//log(error, _n);
55-
num_port = Some(num_port2);
55+
num_port = Some(move num_port2);
5656
};
5757
}
5858

@@ -70,7 +70,7 @@ fn main() {
7070
let msg_per_task = uint::from_str(args[2]).get();
7171

7272
let (num_chan, num_port) = init();
73-
let mut num_chan = Some(num_chan);
73+
let mut num_chan = Some(move num_chan);
7474

7575
let start = time::precise_time_s();
7676

@@ -82,22 +82,22 @@ fn main() {
8282
let (new_chan, num_port) = init();
8383
let num_chan2 = ~mut None;
8484
*num_chan2 <-> num_chan;
85-
let num_port = ~mut Some(num_port);
85+
let num_port = ~mut Some(move num_port);
8686
let new_future = future::spawn(|move num_chan2, move num_port| {
8787
let mut num_chan = None;
8888
num_chan <-> *num_chan2;
8989
let mut num_port1 = None;
9090
num_port1 <-> *num_port;
9191
thread_ring(i, msg_per_task,
92-
option::unwrap(num_chan),
93-
option::unwrap(num_port1))
92+
option::unwrap(move num_chan),
93+
option::unwrap(move num_port1))
9494
});
95-
futures.push(new_future);
96-
num_chan = Some(new_chan);
95+
futures.push(move new_future);
96+
num_chan = Some(move new_chan);
9797
};
9898

9999
// do our iteration
100-
thread_ring(0u, msg_per_task, option::unwrap(num_chan), num_port);
100+
thread_ring(0, msg_per_task, option::unwrap(move num_chan), move num_port);
101101

102102
// synchronize
103103
for futures.each |f| { future::get(f) };

branches/try2/src/test/bench/msgsend-ring-pipes.rs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -24,26 +24,26 @@ proto! ring (
2424
fn macros() {
2525
#macro[
2626
[#move_out[x],
27-
unsafe { let y <- *ptr::addr_of(&x); y }]
27+
unsafe { let y <- *ptr::addr_of(&x); move y }]
2828
];
2929
}
3030

3131
fn thread_ring(i: uint,
3232
count: uint,
3333
+num_chan: ring::client::num,
3434
+num_port: ring::server::num) {
35-
let mut num_chan <- Some(num_chan);
36-
let mut num_port <- Some(num_port);
35+
let mut num_chan <- Some(move num_chan);
36+
let mut num_port <- Some(move num_port);
3737
// Send/Receive lots of messages.
38-
for uint::range(0u, count) |j| {
38+
for uint::range(0, count) |j| {
3939
//error!("task %?, iter %?", i, j);
4040
let mut num_chan2 = None;
4141
let mut num_port2 = None;
4242
num_chan2 <-> num_chan;
4343
num_port2 <-> num_port;
44-
num_chan = Some(ring::client::num(option::unwrap(num_chan2), i * j));
45-
let port = option::unwrap(num_port2);
46-
match recv(port) {
44+
num_chan = Some(ring::client::num(option::unwrap(move num_chan2), i * j));
45+
let port = option::unwrap(move num_port2);
46+
match recv(move port) {
4747
ring::num(_n, p) => {
4848
//log(error, _n);
4949
num_port = Some(move_out!(p));
@@ -66,7 +66,7 @@ fn main() {
6666
let msg_per_task = uint::from_str(args[2]).get();
6767

6868
let (num_chan, num_port) = ring::init();
69-
let mut num_chan = Some(num_chan);
69+
let mut num_chan = Some(move num_chan);
7070

7171
let start = time::precise_time_s();
7272

@@ -78,23 +78,23 @@ fn main() {
7878
let (new_chan, num_port) = ring::init();
7979
let num_chan2 = ~mut None;
8080
*num_chan2 <-> num_chan;
81-
let num_port = ~mut Some(num_port);
81+
let num_port = ~mut Some(move num_port);
8282
let new_future = do future::spawn
8383
|move num_chan2, move num_port| {
8484
let mut num_chan = None;
8585
num_chan <-> *num_chan2;
8686
let mut num_port1 = None;
8787
num_port1 <-> *num_port;
8888
thread_ring(i, msg_per_task,
89-
option::unwrap(num_chan),
90-
option::unwrap(num_port1))
89+
option::unwrap(move num_chan),
90+
option::unwrap(move num_port1))
9191
};
92-
futures.push(new_future);
93-
num_chan = Some(new_chan);
92+
futures.push(move new_future);
93+
num_chan = Some(move new_chan);
9494
};
9595

9696
// do our iteration
97-
thread_ring(0u, msg_per_task, option::unwrap(num_chan), num_port);
97+
thread_ring(0, msg_per_task, option::unwrap(move num_chan), move num_port);
9898

9999
// synchronize
100100
for futures.each |f| { future::get(f) };

branches/try2/src/test/bench/msgsend-ring-rw-arcs.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -33,26 +33,26 @@ fn recv(p: &pipe) -> uint {
3333

3434
fn init() -> (pipe,pipe) {
3535
let x = arc::RWARC(~[]);
36-
((&x).clone(), x)
36+
((&x).clone(), move x)
3737
}
3838

3939

4040
fn thread_ring(i: uint,
4141
count: uint,
4242
+num_chan: pipe,
4343
+num_port: pipe) {
44-
let mut num_chan <- Some(num_chan);
45-
let mut num_port <- Some(num_port);
44+
let mut num_chan <- Some(move num_chan);
45+
let mut num_port <- Some(move num_port);
4646
// Send/Receive lots of messages.
4747
for uint::range(0u, count) |j| {
4848
//error!("task %?, iter %?", i, j);
4949
let mut num_chan2 = option::swap_unwrap(&mut num_chan);
5050
let mut num_port2 = option::swap_unwrap(&mut num_port);
5151
send(&num_chan2, i * j);
52-
num_chan = Some(num_chan2);
52+
num_chan = Some(move num_chan2);
5353
let _n = recv(&num_port2);
5454
//log(error, _n);
55-
num_port = Some(num_port2);
55+
num_port = Some(move num_port2);
5656
};
5757
}
5858

@@ -70,7 +70,7 @@ fn main() {
7070
let msg_per_task = uint::from_str(args[2]).get();
7171

7272
let (num_chan, num_port) = init();
73-
let mut num_chan = Some(num_chan);
73+
let mut num_chan = Some(move num_chan);
7474

7575
let start = time::precise_time_s();
7676

@@ -82,23 +82,23 @@ fn main() {
8282
let (new_chan, num_port) = init();
8383
let num_chan2 = ~mut None;
8484
*num_chan2 <-> num_chan;
85-
let num_port = ~mut Some(num_port);
85+
let num_port = ~mut Some(move num_port);
8686
let new_future = do future::spawn
8787
|move num_chan2, move num_port| {
8888
let mut num_chan = None;
8989
num_chan <-> *num_chan2;
9090
let mut num_port1 = None;
9191
num_port1 <-> *num_port;
9292
thread_ring(i, msg_per_task,
93-
option::unwrap(num_chan),
94-
option::unwrap(num_port1))
93+
option::unwrap(move num_chan),
94+
option::unwrap(move num_port1))
9595
};
96-
futures.push(new_future);
97-
num_chan = Some(new_chan);
96+
futures.push(move new_future);
97+
num_chan = Some(move new_chan);
9898
};
9999

100100
// do our iteration
101-
thread_ring(0u, msg_per_task, option::unwrap(num_chan), num_port);
101+
thread_ring(0, msg_per_task, option::unwrap(move num_chan), move num_port);
102102

103103
// synchronize
104104
for futures.each |f| { future::get(f) };

0 commit comments

Comments
 (0)