Skip to main content

LamellarArrayMutIterators

Trait LamellarArrayMutIterators 

Source
pub trait LamellarArrayMutIterators<T: Dist> {
    type DistIter: DistributedIterator;
    type LocalIter: LocalIterator;

    // Required methods
    fn dist_iter_mut(&self) -> Self::DistIter;
    fn local_iter_mut(&self) -> Self::LocalIter;
}
Expand description

The interface for creating the various lamellar array mutable iterator types

This is only implemented for Safe Array types, UnsafeArray directly provides unsafe versions of the same functions

Required Associated Types§

Required Methods§

Source

fn dist_iter_mut(&self) -> Self::DistIter

Create a mutable DistributedIterator for this array

§Collective Operation

Requires all PEs associated with the array to enter the call otherwise deadlock will occur (i.e. barriers are being called internally) Throughout execution of the iteration, data movement may occur amongst various PEs

§Examples
 use lamellar::array::prelude::*;
 let world = LamellarWorldBuilder::new().build();
 let my_pe = world.my_pe();
 let array: LocalLockArray<usize> = LocalLockArray::new(&world,100,Distribution::Cyclic).block();


     array.dist_iter_mut().for_each(move |elem| *elem = my_pe)
 .block();
Source

fn local_iter_mut(&self) -> Self::LocalIter

Create a mutable LocalIterator for this array

§One-sided Operation

The iteration is launched and local to only the calling PE. No data movement from remote PEs is required

§Examples
 use lamellar::array::prelude::*;
 let world = LamellarWorldBuilder::new().build();
 let my_pe = world.my_pe();
 let array: LocalLockArray<usize> = LocalLockArray::new(&world,100,Distribution::Cyclic).block();


    array.local_iter_mut().for_each(move |elem| *elem = my_pe)
 .block();

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<T: Dist> LamellarArrayMutIterators<T> for AtomicArray<T>

Source§

type DistIter = AtomicDistIter<T>

Source§

type LocalIter = AtomicLocalIter<T>

Source§

impl<T: Dist> LamellarArrayMutIterators<T> for GenericAtomicArray<T>

Source§

type DistIter = GenericAtomicDistIter<T>

Source§

type LocalIter = GenericAtomicLocalIter<T>

Source§

impl<T: Dist> LamellarArrayMutIterators<T> for GlobalLockArray<T>

Source§

type DistIter = GlobalLockDistIterMut<T>

Source§

type LocalIter = GlobalLockLocalIterMut<T>

Source§

impl<T: Dist> LamellarArrayMutIterators<T> for LocalLockArray<T>

Source§

type DistIter = LocalLockDistIterMut<'static, T>

Source§

type LocalIter = LocalLockLocalIterMut<'static, T>

Source§

impl<T: Dist> LamellarArrayMutIterators<T> for NativeAtomicArray<T>

Source§

type DistIter = NativeAtomicDistIter<T>

Source§

type LocalIter = NativeAtomicLocalIter<T>