Copyright | (c) Adam Conner-Sax 2019 |
---|---|
License | BSD-3-Clause |
Maintainer | adam_conner_sax@yahoo.com |
Stability | experimental |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Some basic attempts at parallel map-reduce folds with lists as intermediate type. There are multiple places we can do things in parallel.
- We can map (unpack/assign) in parallel.
- We can reduce in parallel.
- We can fold our intermediate monoid (in the gatherer) in parallel
- We can fold our result monoid in parallel
NB: This does not seem to be faster--and is often slower!--than the serial engine. I leave it here as a starting point for improvement.
Synopsis
- parallelListEngine :: forall g y k c x d. (NFData k, NFData c, NFData d, Foldable g, Functor g) => Int -> ([(k, c)] -> [(k, g c)]) -> MapReduceFold y k c [] x d
- class NFData a
Parallel map/reduce fold builder
parallelListEngine :: forall g y k c x d. (NFData k, NFData c, NFData d, Foldable g, Functor g) => Int -> ([(k, c)] -> [(k, g c)]) -> MapReduceFold y k c [] x d Source #
Parallel map-reduce-fold list engine. Uses the given parameters to use multiple sparks when mapping and reducing. Chunks the input to numThreads chunks and sparks each chunk for mapping, merges the results, groups, then uses the same chunking and merging to do the reductions. grouping could also be parallel but that is under the control of the given function.
re-exports
A class of types that can be fully evaluated.
Since: deepseq-1.1.0.0
Instances
NFData All | Since: deepseq-1.4.0.0 |
Defined in Control.DeepSeq | |
NFData Any | Since: deepseq-1.4.0.0 |
Defined in Control.DeepSeq | |
NFData TypeRep | NOTE: Prior to Since: deepseq-1.4.0.0 |
Defined in Control.DeepSeq | |
NFData Unique | Since: deepseq-1.4.0.0 |
Defined in Control.DeepSeq | |
NFData Version | Since: deepseq-1.3.0.0 |
Defined in Control.DeepSeq | |
NFData Void | Since: deepseq-1.4.0.0 |
Defined in Control.DeepSeq | |
NFData CBool | Since: deepseq-1.4.3.0 |
Defined in Control.DeepSeq | |
NFData CChar | Since: deepseq-1.4.0.0 |
Defined in Control.DeepSeq | |
NFData CClock | Since: deepseq-1.4.0.0 |
Defined in Control.DeepSeq | |
NFData CDouble | Since: deepseq-1.4.0.0 |
Defined in Control.DeepSeq | |
NFData CFile | Since: deepseq-1.4.0.0 |
Defined in Control.DeepSeq | |
NFData CFloat | Since: deepseq-1.4.0.0 |
Defined in Control.DeepSeq | |
NFData CFpos | Since: deepseq-1.4.0.0 |
Defined in Control.DeepSeq | |
NFData CInt | Since: deepseq-1.4.0.0 |
Defined in Control.DeepSeq | |
NFData CIntMax | Since: deepseq-1.4.0.0 |
Defined in Control.DeepSeq | |
NFData CIntPtr | Since: deepseq-1.4.0.0 |
Defined in Control.DeepSeq | |
NFData CJmpBuf | Since: deepseq-1.4.0.0 |
Defined in Control.DeepSeq | |
NFData CLLong | Since: deepseq-1.4.0.0 |
Defined in Control.DeepSeq | |
NFData CLong | Since: deepseq-1.4.0.0 |
Defined in Control.DeepSeq | |
NFData CPtrdiff | Since: deepseq-1.4.0.0 |
Defined in Control.DeepSeq | |
NFData CSChar | Since: deepseq-1.4.0.0 |
Defined in Control.DeepSeq | |
NFData CSUSeconds | Since: deepseq-1.4.0.0 |
Defined in Control.DeepSeq rnf :: CSUSeconds -> () # | |
NFData CShort | Since: deepseq-1.4.0.0 |
Defined in Control.DeepSeq | |
NFData CSigAtomic | Since: deepseq-1.4.0.0 |
Defined in Control.DeepSeq rnf :: CSigAtomic -> () # | |
NFData CSize | Since: deepseq-1.4.0.0 |
Defined in Control.DeepSeq | |
NFData CTime | Since: deepseq-1.4.0.0 |
Defined in Control.DeepSeq | |
NFData CUChar | Since: deepseq-1.4.0.0 |
Defined in Control.DeepSeq | |
NFData CUInt | Since: deepseq-1.4.0.0 |
Defined in Control.DeepSeq | |
NFData CUIntMax | Since: deepseq-1.4.0.0 |
Defined in Control.DeepSeq | |
NFData CUIntPtr | Since: deepseq-1.4.0.0 |
Defined in Control.DeepSeq | |
NFData CULLong | Since: deepseq-1.4.0.0 |
Defined in Control.DeepSeq | |
NFData CULong | Since: deepseq-1.4.0.0 |
Defined in Control.DeepSeq | |
NFData CUSeconds | Since: deepseq-1.4.0.0 |
Defined in Control.DeepSeq | |
NFData CUShort | Since: deepseq-1.4.0.0 |
Defined in Control.DeepSeq | |
NFData CWchar | Since: deepseq-1.4.0.0 |
Defined in Control.DeepSeq | |
NFData ThreadId | Since: deepseq-1.4.0.0 |
Defined in Control.DeepSeq | |
NFData Fingerprint | Since: deepseq-1.4.0.0 |
Defined in Control.DeepSeq rnf :: Fingerprint -> () # | |
NFData MaskingState | Since: deepseq-1.4.4.0 |
Defined in Control.DeepSeq rnf :: MaskingState -> () # | |
NFData ExitCode | Since: deepseq-1.4.2.0 |
Defined in Control.DeepSeq | |
NFData Int16 | |
Defined in Control.DeepSeq | |
NFData Int32 | |
Defined in Control.DeepSeq | |
NFData Int64 | |
Defined in Control.DeepSeq | |
NFData Int8 | |
Defined in Control.DeepSeq | |
NFData CallStack | Since: deepseq-1.4.2.0 |
Defined in Control.DeepSeq | |
NFData SrcLoc | Since: deepseq-1.4.2.0 |
Defined in Control.DeepSeq | |
NFData Word16 | |
Defined in Control.DeepSeq | |
NFData Word32 | |
Defined in Control.DeepSeq | |
NFData Word64 | |
Defined in Control.DeepSeq | |
NFData Word8 | |
Defined in Control.DeepSeq | |
NFData ByteString | |
Defined in Data.ByteString.Internal rnf :: ByteString -> () # | |
NFData ByteString | |
Defined in Data.ByteString.Lazy.Internal rnf :: ByteString -> () # | |
NFData ShortByteString | |
Defined in Data.ByteString.Short.Internal rnf :: ShortByteString -> () # | |
NFData IntSet | |
Defined in Data.IntSet.Internal | |
NFData ByteArray | |
Defined in Data.Array.Byte | |
NFData Ordering | |
Defined in Control.DeepSeq | |
NFData TyCon | NOTE: Prior to Since: deepseq-1.4.0.0 |
Defined in Control.DeepSeq | |
NFData TextDetails | |
Defined in Text.PrettyPrint.Annotated.HughesPJ rnf :: TextDetails -> () # | |
NFData Doc | |
Defined in Text.PrettyPrint.HughesPJ | |
NFData StdGen | |
Defined in System.Random.Internal | |
NFData Integer | |
Defined in Control.DeepSeq | |
NFData Natural | Since: deepseq-1.4.0.0 |
Defined in Control.DeepSeq | |
NFData () | |
Defined in Control.DeepSeq | |
NFData Bool | |
Defined in Control.DeepSeq | |
NFData Char | |
Defined in Control.DeepSeq | |
NFData Double | |
Defined in Control.DeepSeq | |
NFData Float | |
Defined in Control.DeepSeq | |
NFData Int | |
Defined in Control.DeepSeq | |
NFData Word | |
Defined in Control.DeepSeq | |
NFData a => NFData (ZipList a) | Since: deepseq-1.4.0.0 |
Defined in Control.DeepSeq | |
NFData a => NFData (Complex a) | |
Defined in Control.DeepSeq | |
NFData a => NFData (Identity a) | Since: deepseq-1.4.0.0 |
Defined in Control.DeepSeq | |
NFData a => NFData (First a) | Since: deepseq-1.4.0.0 |
Defined in Control.DeepSeq | |
NFData a => NFData (Last a) | Since: deepseq-1.4.0.0 |
Defined in Control.DeepSeq | |
NFData a => NFData (Down a) | Since: deepseq-1.4.0.0 |
Defined in Control.DeepSeq | |
NFData a => NFData (First a) | Since: deepseq-1.4.2.0 |
Defined in Control.DeepSeq | |
NFData a => NFData (Last a) | Since: deepseq-1.4.2.0 |
Defined in Control.DeepSeq | |
NFData a => NFData (Max a) | Since: deepseq-1.4.2.0 |
Defined in Control.DeepSeq | |
NFData a => NFData (Min a) | Since: deepseq-1.4.2.0 |
Defined in Control.DeepSeq | |
NFData m => NFData (WrappedMonoid m) | Since: deepseq-1.4.2.0 |
Defined in Control.DeepSeq rnf :: WrappedMonoid m -> () # | |
NFData a => NFData (Dual a) | Since: deepseq-1.4.0.0 |
Defined in Control.DeepSeq | |
NFData a => NFData (Product a) | Since: deepseq-1.4.0.0 |
Defined in Control.DeepSeq | |
NFData a => NFData (Sum a) | Since: deepseq-1.4.0.0 |
Defined in Control.DeepSeq | |
NFData (IORef a) | NOTE: Only strict in the reference and not the referenced value. Since: deepseq-1.4.2.0 |
Defined in Control.DeepSeq | |
NFData (MVar a) | NOTE: Only strict in the reference and not the referenced value. Since: deepseq-1.4.2.0 |
Defined in Control.DeepSeq | |
NFData (FunPtr a) | Since: deepseq-1.4.2.0 |
Defined in Control.DeepSeq | |
NFData (Ptr a) | Since: deepseq-1.4.2.0 |
Defined in Control.DeepSeq | |
NFData a => NFData (Ratio a) | |
Defined in Control.DeepSeq | |
NFData (StableName a) | Since: deepseq-1.4.0.0 |
Defined in Control.DeepSeq rnf :: StableName a -> () # | |
NFData a => NFData (IntMap a) | |
Defined in Data.IntMap.Internal | |
NFData a => NFData (Digit a) | |
Defined in Data.Sequence.Internal | |
NFData a => NFData (Elem a) | |
Defined in Data.Sequence.Internal | |
NFData a => NFData (FingerTree a) | |
Defined in Data.Sequence.Internal rnf :: FingerTree a -> () # | |
NFData a => NFData (Node a) | |
Defined in Data.Sequence.Internal | |
NFData a => NFData (Seq a) | |
Defined in Data.Sequence.Internal | |
NFData a => NFData (Set a) | |
Defined in Data.Set.Internal | |
NFData a => NFData (Tree a) | |
NFData (MutableByteArray s) | |
Defined in Data.Array.Byte rnf :: MutableByteArray s -> () # | |
NFData a => NFData (SmallArray a) | |
Defined in Data.Discrimination.Internal.SmallArray rnf :: SmallArray a -> () # | |
NFData a => NFData (Hashed a) | |
Defined in Data.Hashable.Class | |
NFData a => NFData (AnnotDetails a) | |
Defined in Text.PrettyPrint.Annotated.HughesPJ rnf :: AnnotDetails a -> () # | |
NFData a => NFData (Doc a) | |
Defined in Text.PrettyPrint.Annotated.HughesPJ | |
NFData a => NFData (Array a) | |
Defined in Data.Primitive.Array | |
NFData (PrimArray a) | |
Defined in Data.Primitive.PrimArray | |
NFData a => NFData (SmallArray a) | |
Defined in Data.Primitive.SmallArray rnf :: SmallArray a -> () # | |
NFData g => NFData (StateGen g) | |
Defined in System.Random.Internal | |
NFData (Array a) | |
Defined in Streamly.Internal.Data.Array.Foreign.Type | |
NFData a => NFData (HashSet a) | |
Defined in Data.HashSet.Internal | |
NFData a => NFData (Vector a) | |
Defined in Data.Vector | |
NFData (Vector a) | |
Defined in Data.Vector.Primitive | |
NFData (Vector a) | |
Defined in Data.Vector.Unboxed.Base | |
NFData a => NFData (NonEmpty a) | Since: deepseq-1.4.2.0 |
Defined in Control.DeepSeq | |
NFData a => NFData (Maybe a) | |
Defined in Control.DeepSeq | |
NFData a => NFData [a] | |
Defined in Control.DeepSeq | |
(NFData a, NFData b) => NFData (Either a b) | |
Defined in Control.DeepSeq | |
NFData (Fixed a) | Since: deepseq-1.3.0.0 |
Defined in Control.DeepSeq | |
NFData (Proxy a) | Since: deepseq-1.4.0.0 |
Defined in Control.DeepSeq | |
(NFData a, NFData b) => NFData (Arg a b) | Since: deepseq-1.4.2.0 |
Defined in Control.DeepSeq | |
(NFData a, NFData b) => NFData (Array a b) | |
Defined in Control.DeepSeq | |
NFData (STRef s a) | NOTE: Only strict in the reference and not the referenced value. Since: deepseq-1.4.2.0 |
Defined in Control.DeepSeq | |
(NFData k, NFData a) => NFData (Map k a) | |
Defined in Data.Map.Internal | |
NFData (MutablePrimArray s a) | |
Defined in Data.Primitive.PrimArray rnf :: MutablePrimArray s a -> () # | |
NFData a => NFData (SerialT Identity a) | |
Defined in Streamly.Internal.Data.Stream.Serial | |
NFData a => NFData (WSerialT Identity a) | |
Defined in Streamly.Internal.Data.Stream.Serial | |
NFData a => NFData (ZipSerialM Identity a) | |
Defined in Streamly.Internal.Data.Stream.Zip rnf :: ZipSerialM Identity a -> () # | |
(NFData k, NFData v) => NFData (HashMap k v) | |
Defined in Data.HashMap.Internal | |
(NFData k, NFData v) => NFData (Leaf k v) | |
Defined in Data.HashMap.Internal | |
NFData (MVector s a) | |
Defined in Data.Vector.Unboxed.Base | |
NFData (a -> b) | This instance is for convenience and consistency with Since: deepseq-1.3.0.0 |
Defined in Control.DeepSeq | |
(NFData a, NFData b) => NFData (a, b) | |
Defined in Control.DeepSeq | |
NFData a => NFData (Const a b) | Since: deepseq-1.4.0.0 |
Defined in Control.DeepSeq | |
NFData (a :~: b) | Since: deepseq-1.4.3.0 |
Defined in Control.DeepSeq | |
NFData b => NFData (Tagged s b) | |
Defined in Data.Tagged | |
(NFData a1, NFData a2, NFData a3) => NFData (a1, a2, a3) | |
Defined in Control.DeepSeq | |
(NFData1 f, NFData1 g, NFData a) => NFData (Product f g a) | Since: deepseq-1.4.3.0 |
Defined in Control.DeepSeq | |
(NFData1 f, NFData1 g, NFData a) => NFData (Sum f g a) | Since: deepseq-1.4.3.0 |
Defined in Control.DeepSeq | |
NFData (a :~~: b) | Since: deepseq-1.4.3.0 |
Defined in Control.DeepSeq | |
(NFData a1, NFData a2, NFData a3, NFData a4) => NFData (a1, a2, a3, a4) | |
Defined in Control.DeepSeq | |
(NFData1 f, NFData1 g, NFData a) => NFData (Compose f g a) | Since: deepseq-1.4.3.0 |
Defined in Control.DeepSeq | |
(NFData a1, NFData a2, NFData a3, NFData a4, NFData a5) => NFData (a1, a2, a3, a4, a5) | |
Defined in Control.DeepSeq | |
(NFData a1, NFData a2, NFData a3, NFData a4, NFData a5, NFData a6) => NFData (a1, a2, a3, a4, a5, a6) | |
Defined in Control.DeepSeq | |
(NFData a1, NFData a2, NFData a3, NFData a4, NFData a5, NFData a6, NFData a7) => NFData (a1, a2, a3, a4, a5, a6, a7) | |
Defined in Control.DeepSeq | |
(NFData a1, NFData a2, NFData a3, NFData a4, NFData a5, NFData a6, NFData a7, NFData a8) => NFData (a1, a2, a3, a4, a5, a6, a7, a8) | |
Defined in Control.DeepSeq | |
(NFData a1, NFData a2, NFData a3, NFData a4, NFData a5, NFData a6, NFData a7, NFData a8, NFData a9) => NFData (a1, a2, a3, a4, a5, a6, a7, a8, a9) | |
Defined in Control.DeepSeq |