pnnl / lamellar-runtime

Lamellar is an asynchronous tasking runtime for HPC systems developed in RUST
Other
43 stars 5 forks source link

Example does not compile with Rust 1.68.1 #21

Closed kwaters4 closed 1 year ago

kwaters4 commented 1 year ago

The following example on the page does not compile.

Code Block

use lamellar::array::prelude::*;

fn main(){
    let world = lamellar::LamellarWorldBuilder::new().build();
    let my_pe = world.my_pe();
    let block_array = AtomicArray::<usize>::new(&world, 1000, Distribution::Block); //we also support Cyclic distribution.
    block_array.dist_iter_mut().enumerate().for_each(move |elem| *elem = my_pe); //simultaneosuly initialize array accross all pes, each pe only updates its local data
    block_array.wait_all();
    block_array.barrier();
    if my_pe == 0{
        for (i,elem) in block_array.onesided_iter().into_iter().enumerate(){ //iterate through entire array on pe 0 (automatically transfering remote data)
            println!("i: {} = {})",i,elem);
        }
    }
}

Error Message

error[E0614]: type `(usize, lamellar::array::atomic::AtomicElement<usize>)` cannot be dereferenced

Version

RustC 1.68.1 
Lamellar = 0.5
rdfriese commented 1 year ago

Good catch... and on the readme too oops, should be fixed now

kwaters4 commented 1 year ago

Perfect! Thanks.