elynx-tools-0.1.0: Tools for ELynx

Copyright(c) Dominik Schrempf 2019
LicenseGPL-3
Maintainerdominik.schrempf@gmail.com
Stabilityunstable
Portabilityportable
Safe HaskellNone
LanguageHaskell2010

ELynx.Tools.Concurrent

Contents

Description

Creation date: Tue May 7 10:33:24 2019.

Synopsis

MWC

getNGen :: Int -> Maybe [Word32] -> IO [GenIO] Source #

Get a number of generators, possibly with a fixed seed.

splitGen :: PrimMonad m => Int -> Gen (PrimState m) -> m [Gen (PrimState m)] Source #

Split a generator.

Parallel stuff

parComp :: Int -> (Int -> GenIO -> IO b) -> GenIO -> IO [b] Source #

Perform random calculation in parallel. Does only work with IO and the moment.

getChunks :: Int -> Int -> [Int] Source #

For a given number of capabilities and number of calculations, get chunk sizes. The chunk sizes will be as evenly distributed as possible and sum up to the number of calculations.

parMapChunk :: Int -> (a -> b) -> [a] -> [b] Source #

Parallel map with given chunk size.