Safe Haskell | None |
---|
Distributed ST computations.
Computations of type DistST
are data-parallel computations which
are run on each thread of a gang. At the moment, they can only access the
element of a (possibly mutable) distributed value owned by the current
thread.
TODO: Add facilities for implementing parallel scans etc.
TODO:
- data DistST s a
- stToDistST :: ST s a -> DistST s a
- distST_ :: Comp -> Gang -> DistST s () -> ST s ()
- distST :: DT a => Comp -> Gang -> DistST s a -> ST s (Dist a)
- runDistST :: DT a => Comp -> Gang -> (forall s. DistST s a) -> Dist a
- runDistST_seq :: forall a. DT a => Gang -> (forall s. DistST s a) -> Dist a
- myIndex :: DistST s Int
- myD :: DT a => Dist a -> DistST s a
- readMyMD :: DT a => MDist a s -> DistST s a
- writeMyMD :: DT a => MDist a s -> a -> DistST s ()
- mapDST_ :: DT a => What -> Gang -> (a -> DistST s ()) -> Dist a -> ST s ()
- mapDST :: (DT a, DT b) => What -> Gang -> (a -> DistST s b) -> Dist a -> ST s (Dist b)
- zipWithDST_ :: (DT a, DT b) => What -> Gang -> (a -> b -> DistST s ()) -> Dist a -> Dist b -> ST s ()
- zipWithDST :: (DT a, DT b, DT c) => What -> Gang -> (a -> b -> DistST s c) -> Dist a -> Dist b -> ST s (Dist c)
Documentation
Data-parallel computations. When applied to a thread gang, the computation implicitly knows the index of the thread it's working on. Alternatively, if we know the thread index then we can make a regular ST computation.
Primitives.
stToDistST :: ST s a -> DistST s aSource
distST_ :: Comp -> Gang -> DistST s () -> ST s ()Source
Execute a data-parallel computation on a Gang
.
The same DistST comutation runs on each thread.
distST :: DT a => Comp -> Gang -> DistST s a -> ST s (Dist a)Source
Execute a data-parallel computation, yielding the distributed result.
runDistST :: DT a => Comp -> Gang -> (forall s. DistST s a) -> Dist aSource
Run a data-parallel computation, yielding the distributed result.
readMyMD :: DT a => MDist a s -> DistST s aSource
Yields the MDist
element owned by the current thread.
writeMyMD :: DT a => MDist a s -> a -> DistST s ()Source
Writes the MDist
element owned by the current thread.