meta-par-0.3: Provides the monad-par interface, but based on modular scheduler "mix-ins".

Safe HaskellSafe-Infered

Control.Monad.Par.Meta.Resources.SMP

Contents

Description

This module implements a Meta-Par Resource for SMP parallelism, suitable as a base for combined execution resources (e.g., Control.Monad.Par.Meta.AccSMP).

Synopsis

Resource creation

mkResourceSource

Arguments

:: Int

The number of steal attempts per WorkSearch call.

-> Resource 

Create an SMP resource for all capabilities.

mkResourceOnSource

Arguments

:: [Int]

Capability list.

-> Int

The number of steal attempts per WorkSearch call.

-> Resource 

Create an SMP resource for a configurable list of capabilities.

Default implementation

defaultStartup :: StartupSource

Startup for spawning threads on all capabilities, or from a read-able list of capability numbers in the environment variable SMP_CAPS.

defaultWorkSearch :: Int -> WorkSearchSource

WorkSearch for all capabilities.

Customizable implementation

startupForCaps :: [Int] -> StartupSource

Startup for spawning threads only on a particular set of capabilities.

wsForCaps :: [Int] -> Int -> WorkSearchSource

Given a set of capabilities and a number of steals to attempt per capability, return a WorkSearch.