Struct LocalIterMut

Source
pub struct LocalIterMut<'a, T: Dist, A: LamellarArray<T>> { /* private fields */ }
Expand description

Mutable LamellarArray local iterator

This struct is created by calling local_iter_mut on any of the LamellarWriteArray types

§Examples

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

 let world = LamellarWorldBuilder::new().build();
 let array = AtomicArray::<usize>::new(&world,100,Distribution::Block).block();
 let my_pe = world.my_pe();

 let local_iter = array.local_iter_mut().for_each(move|e| e.store(my_pe) );
 local_iter.block();

Trait Implementations§

Source§

impl<'a, T: Dist, A: LamellarArray<T>> Debug for LocalIterMut<'a, T, A>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<T: Dist + 'static, A: LamellarArray<T> + SyncSend + LocalIteratorLauncher + Clone + 'static> IndexedLocalIterator for LocalIterMut<'static, T, A>

Source§

fn iterator_index(&self, index: usize) -> Option<usize>

given an local index return the corresponding local iterator index ( or None otherwise)
Source§

fn enumerate(self) -> Enumerate<Self>

yields the local (to the calling PE) index along with each element Read more
Source§

fn chunks(self, size: usize) -> Chunks<Self>

Split an iterator into fixed-sized chunks Read more
Source§

fn skip(self, count: usize) -> Skip<Self>

An iterator that skips the first n elements Read more
Source§

fn step_by(self, step_size: usize) -> StepBy<Self>

An iterator that steps by step_size elements Read more
Source§

fn take(self, count: usize) -> Take<Self>

An iterator that takes the first n elements Read more
Source§

fn zip<I: IndexedLocalIterator>(self, iter: I) -> Zip<Self, I>

Iterates over tuples (A,B) where the A items are from this iterator and the B items are from the iter in the argument. If the two iterators are of unequal length, the returned iterator will be equal in length to the shorter of the two. Read more
Source§

impl<T: Dist + 'static, A: LamellarArray<T> + SyncSend + LocalIteratorLauncher + Clone + 'static> LocalIterator for LocalIterMut<'static, T, A>

Source§

type Item = &'static mut T

The type of item this local iterator produces
Source§

type Array = A

The array to which this local iterator was created from
Source§

fn array(&self) -> Self::Array

Return the original array this local iterator belongs too
Source§

fn next(&mut self) -> Option<Self::Item>

Return the next element in the iterator, otherwise return None
Source§

fn elems(&self, in_elems: usize) -> usize

Return the maximum number of elements in the iterator Read more
Source§

fn advance_index(&mut self, count: usize)

advance the internal iterator localtion by count elements
Source§

fn filter<F>(self, op: F) -> Filter<Self, F>
where F: Fn(&Self::Item) -> bool + Clone + 'static,

Applies op on each element of this iterator, producing a new iterator with only the elements that gave true results Read more
Source§

fn filter_map<F, R>(self, op: F) -> FilterMap<Self, F>
where F: Fn(Self::Item) -> Option<R> + Clone + 'static, R: Send + 'static,

Applies op on each element of this iterator to get an Option, producing a new iterator with only the elements that return Some Read more
Source§

fn map<F, R>(self, op: F) -> Map<Self, F>
where F: Fn(Self::Item) -> R + Clone + 'static, R: Send + 'static,

Applies op to each element producing a new iterator with the results Read more
Source§

fn monotonic(self) -> Monotonic<Self>

Similar to the Enumerate iterator (which can only be applied to IndexedLocalIterators), but the yielded indicies are only guaranteed to be unique and monotonically increasing, they should not be considered to have any relation to the underlying location of data in the local array. Read more
Source§

fn for_each<F>(&self, op: F) -> LocalIterForEachHandle
where F: Fn(Self::Item) + SyncSend + Clone + 'static,

Calls a closure on each element of a Local Iterator in parallel on the calling PE (the PE must have some local data of the array). Read more
Source§

fn for_each_with_schedule<F>( &self, sched: Schedule, op: F, ) -> LocalIterForEachHandle
where F: Fn(Self::Item) + SyncSend + Clone + 'static,

Calls a closure on each element of a Local Iterator in parallel on the calling PE (the PE must have some local data of the array) using the specififed Scehedule policy. Read more
Source§

fn for_each_async<F, Fut>(&self, op: F) -> LocalIterForEachHandle
where F: Fn(Self::Item) -> Fut + SyncSend + Clone + 'static, Fut: Future<Output = ()> + Send + 'static,

Calls a closure and immediately awaits the result on each element of a Local Iterator in parallel on the calling PE (the PE must have some local data of the array). Read more
Source§

fn for_each_async_with_schedule<F, Fut>( &self, sched: Schedule, op: F, ) -> LocalIterForEachHandle
where F: Fn(Self::Item) -> Fut + SyncSend + Clone + 'static, Fut: Future<Output = ()> + Send + 'static,

Calls a closure on each element of a Local Iterator in parallel on the calling PE (the PE must have some local data of the array) using the specififed Schedule policy. Read more
Source§

fn reduce<F>(&self, op: F) -> LocalIterReduceHandle<Self::Item, F>
where Self::Item: SyncSend + Copy, F: Fn(Self::Item, Self::Item) -> Self::Item + SyncSend + Clone + 'static,

Reduces the elements of the local iterator using the provided closure Read more
Source§

fn reduce_with_schedule<F>( &self, sched: Schedule, op: F, ) -> LocalIterReduceHandle<Self::Item, F>
where Self::Item: SyncSend + Copy, F: Fn(Self::Item, Self::Item) -> Self::Item + SyncSend + Clone + 'static,

Reduces the elements of the local iterator using the provided closure and specififed Schedule policy Read more
Source§

fn collect<A>(&self, d: Distribution) -> LocalIterCollectHandle<Self::Item, A>
where Self::Item: Dist + ArrayOps, A: AsyncTeamFrom<(Vec<Self::Item>, Distribution)> + SyncSend + Clone + 'static,

Collects the elements of the local iterator into the specified container type Read more
Source§

fn collect_with_schedule<A>( &self, sched: Schedule, d: Distribution, ) -> LocalIterCollectHandle<Self::Item, A>
where Self::Item: Dist + ArrayOps, A: AsyncTeamFrom<(Vec<Self::Item>, Distribution)> + SyncSend + Clone + 'static,

Collects the elements of the local iterator into the specified container type using the specified Schedule policy Read more
Source§

fn collect_async<A, T>(&self, d: Distribution) -> LocalIterCollectHandle<T, A>
where T: Dist + ArrayOps, Self::Item: Future<Output = T> + Send + 'static, A: AsyncTeamFrom<(Vec<T>, Distribution)> + SyncSend + Clone + 'static,

Collects the awaited elements of the local iterator into a new LamellarArray Read more
Source§

fn collect_async_with_schedule<A, T>( &self, sched: Schedule, d: Distribution, ) -> LocalIterCollectHandle<T, A>
where T: Dist + ArrayOps, Self::Item: Future<Output = T> + Send + 'static, A: AsyncTeamFrom<(Vec<T>, Distribution)> + SyncSend + Clone + 'static,

Collects the awaited elements of the local iterator into a new LamellarArray, using the provided Schedule policy Read more
Source§

fn count(&self) -> LocalIterCountHandle

Counts the number of the elements of the local iterator Read more
Source§

fn count_with_schedule(&self, sched: Schedule) -> LocalIterCountHandle

Counts the number of the elements of the local iterator using the provided Schedule policy Read more
Source§

fn sum(&self) -> LocalIterSumHandle<Self::Item>
where Self::Item: SyncSend + for<'a> Sum<&'a Self::Item> + Sum<Self::Item>,

Sums the elements of the local iterator. Read more
Source§

fn sum_with_schedule(&self, sched: Schedule) -> LocalIterSumHandle<Self::Item>
where Self::Item: SyncSend + for<'a> Sum<&'a Self::Item> + Sum<Self::Item>,

Sums the elements of the local iterator, using the specified Schedule policy Read more

Auto Trait Implementations§

§

impl<'a, T, A> Freeze for LocalIterMut<'a, T, A>
where A: Freeze,

§

impl<'a, T, A> RefUnwindSafe for LocalIterMut<'a, T, A>

§

impl<'a, T, A> Send for LocalIterMut<'a, T, A>
where A: Send,

§

impl<'a, T, A> Sync for LocalIterMut<'a, T, A>
where A: Sync,

§

impl<'a, T, A> Unpin for LocalIterMut<'a, T, A>
where A: Unpin,

§

impl<'a, T, A> UnwindSafe for LocalIterMut<'a, T, A>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T, U> AsyncTeamInto<U> for T
where T: Send, U: AsyncTeamFrom<T>,

Source§

fn team_into<'life0, 'async_trait>( self, team: &'life0 Arc<LamellarTeam>, ) -> Pin<Box<dyn Future<Output = U> + Send + 'async_trait>>
where 'life0: 'async_trait, T: 'async_trait,

converts this type into the (usually inferred) input type
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T, U> TeamInto<U> for T
where U: TeamFrom<T>,

Source§

fn team_into(self, team: &Arc<LamellarTeam>) -> U

converts this type into the (usually inferred) input type
Source§

impl<T, U> TeamTryInto<U> for T
where U: TeamTryFrom<T>,

Source§

fn team_try_into(self, team: &Arc<LamellarTeam>) -> Result<U, Error>

Trys to convert this type into the (usually inferred) input type
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> SyncSend for T
where T: Sync + Send,