mirror of
https://github.com/xythrez/RustMP.git
synced 2025-09-04 21:52:36 +00:00
Refactoring part2: renamed keywords to blocksize, read, locked, private, reduction.
This commit is contained in:
parent
dcd1afbc12
commit
64b830c7e6
2 changed files with 60 additions and 60 deletions
|
@ -22,7 +22,7 @@ fn main() {
|
|||
let numbers: Vec<Student> = vec![];
|
||||
|
||||
par_for! {
|
||||
for i in 1..32, blocksize 4, capturing numbers, {
|
||||
for i in 1..32, blocksize 4, locked numbers, {
|
||||
//std::thread::sleep(
|
||||
// time::Duration::from_secs(
|
||||
// rand::thread_rng().gen_range(1..10)));
|
||||
|
@ -48,7 +48,7 @@ fn main() {
|
|||
for j in 0..n {
|
||||
let mut x = 0;
|
||||
par_for! {
|
||||
for k in 0..n, using a b, reducing x#+, {
|
||||
for k in 0..n, read a b, reduction x#+, {
|
||||
x += a[i][k]*b[k][j];
|
||||
}
|
||||
}
|
||||
|
@ -58,7 +58,7 @@ fn main() {
|
|||
println!("{:?}", c);
|
||||
// let mut local = 0;
|
||||
// par_for! {
|
||||
// for i in 1..32, blocksize 1, capturing numbers, private local, {
|
||||
// for i in 1..32, blocksize 1, locked numbers, private local, {
|
||||
// local += 1;
|
||||
// println!("{}", local);
|
||||
// let mut lock = numbers.write();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue