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

mkResource

Arguments

:: Int

The number of steal attempts per WorkSearch call.

-> Resource 

Create an SMP resource for all capabilities.

mkResourceOn

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 :: Startup

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

defaultWorkSearch :: Int -> WorkSearch

WorkSearch for all capabilities.

Customizable implementation

startupForCaps :: [Int] -> Startup

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

wsForCaps :: [Int] -> Int -> WorkSearch

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