Implement count for local_iter
JosephCottam opened this issue · 1 comments
JosephCottam commented
It would be nice to be able to do things like this:
let table: LocalLockArray<T> = LocalLockArray::<u128>::new(&world, 10000, Distribution::Block);
let local_count = table
.local_iter()
.filter(|e| e==0)
.count();
let local_sum = table.local_iter().sum();
rdfriese commented
The above APIs should now be available! could you pull the branch associated with this issue and give it a try?
I've also added a new example: array_consumer_schedules.rs which is slightly more complicated than your example, but it also highlights how to use the different Iteration "Schedules" (our version of OpenMP scheduling)