Safe Haskell | None |
---|
- class DT a where
- data Dist a
- data MDist a :: * -> *
- indexD :: String -> Dist a -> Int -> a
- newMD :: Gang -> ST s (MDist a s)
- readMD :: MDist a s -> Int -> ST s a
- writeMD :: MDist a s -> Int -> a -> ST s ()
- unsafeFreezeMD :: MDist a s -> ST s (Dist a)
- deepSeqD :: a -> b -> b
- sizeD :: Dist a -> Int
- sizeMD :: MDist a s -> Int
- measureD :: a -> String
- checkGangD :: DT a => String -> Gang -> Dist a -> b -> b
- checkGangMD :: DT a => String -> Gang -> MDist a s -> b -> b
- newD :: DT a => Gang -> (forall s. MDist a s -> ST s ()) -> Dist a
- debugD :: DT a => Dist a -> String
Distributable Types
Class of distributable types. Instances of DT
can be
distributed across all workers of a Gang
.
All such types must be hyperstrict as we do not want to pass thunks
into distributed computations.
indexD :: String -> Dist a -> Int -> aSource
Extract a single element of an immutable distributed value.
newMD :: Gang -> ST s (MDist a s)Source
Create an unitialised distributed value for the given Gang
.
The gang is used (only) to know how many elements are needed
in the distributed value.
readMD :: MDist a s -> Int -> ST s aSource
Extract an element from a mutable distributed value.
writeMD :: MDist a s -> Int -> a -> ST s ()Source
Write an element of a mutable distributed value.
unsafeFreezeMD :: MDist a s -> ST s (Dist a)Source
Unsafely freeze a mutable distributed value.
Ensure a distributed value is fully evaluated.
Number of elements in the distributed value.
- For debugging only, as code shouldn't be sensitive to the return value.
sizeMD :: MDist a s -> IntSource
Number of elements in the mutable distributed value.
- For debugging only, as code shouldn't be sensitive to the return value.
Show a distributed value.
- For debugging only.
Checking
checkGangD :: DT a => String -> Gang -> Dist a -> b -> bSource
Check that the sizes of the Gang
and of the distributed value match.
checkGangMD :: DT a => String -> Gang -> MDist a s -> b -> bSource
Check that the sizes of the Gang
and of the mutable distributed value match.