aivika-distributed-1.5: Parallel distributed discrete event simulation module for the Aivika library
CopyrightCopyright (c) 2015-2017 David Sorokin <david.sorokin@gmail.com>
LicenseBSD3
MaintainerDavid Sorokin <david.sorokin@gmail.com>
Stabilityexperimental
Safe HaskellSafe-Inferred
LanguageHaskell2010

Simulation.Aivika.Distributed.Optimistic.DIO

Description

Tested with: GHC 7.10.3

This module defines DIO as an instance of the MonadDES and EventIOQueueing type classes.

Synopsis

Documentation

data DIO a Source #

The distributed computation based on IO.

Instances

Instances details
MonadComp DIO Source # 
Instance details

Defined in Simulation.Aivika.Distributed.Optimistic.DIO

MonadDES DIO Source # 
Instance details

Defined in Simulation.Aivika.Distributed.Optimistic.DIO

MonadException DIO Source # 
Instance details

Defined in Simulation.Aivika.Distributed.Optimistic.Internal.DIO

Methods

catchComp :: Exception e => DIO a -> (e -> DIO a) -> DIO a #

finallyComp :: DIO a -> DIO b -> DIO a #

throwComp :: Exception e => e -> DIO a #

MonadGenerator DIO Source # 
Instance details

Defined in Simulation.Aivika.Distributed.Optimistic.Generator

Associated Types

data Generator DIO #

EventIOQueueing DIO Source #

DIO is an instance of EventIOQueueing.

Instance details

Defined in Simulation.Aivika.Distributed.Optimistic.Internal.Event

Methods

enqueueEventIO :: Double -> Event DIO () -> Event DIO () #

EventQueueing DIO Source #

An implementation of the EventQueueing type class.

Instance details

Defined in Simulation.Aivika.Distributed.Optimistic.Internal.Event

Associated Types

data EventQueue DIO #

MonadRef DIO Source #

The implementation of lazy mutable references.

Instance details

Defined in Simulation.Aivika.Distributed.Optimistic.Ref.Base.Lazy

Associated Types

data Ref DIO a #

Methods

newRef :: a -> Simulation DIO (Ref DIO a) #

readRef :: Ref DIO a -> Event DIO a #

writeRef :: Ref DIO a -> a -> Event DIO () #

modifyRef :: Ref DIO a -> (a -> a) -> Event DIO () #

equalRef :: Ref DIO a -> Ref DIO a -> Bool #

MonadRef0 DIO Source # 
Instance details

Defined in Simulation.Aivika.Distributed.Optimistic.Ref.Base.Lazy

Methods

newRef0 :: a -> DIO (Ref DIO a) #

MonadRef DIO Source #

The implementation of strict mutable references.

Instance details

Defined in Simulation.Aivika.Distributed.Optimistic.Ref.Base.Strict

Associated Types

data Ref DIO a #

Methods

newRef :: a -> Simulation DIO (Ref DIO a) #

readRef :: Ref DIO a -> Event DIO a #

writeRef :: Ref DIO a -> a -> Event DIO () #

modifyRef :: Ref DIO a -> (a -> a) -> Event DIO () #

equalRef :: Ref DIO a -> Ref DIO a -> Bool #

MonadRef0 DIO Source # 
Instance details

Defined in Simulation.Aivika.Distributed.Optimistic.Ref.Base.Strict

Methods

newRef0 :: a -> DIO (Ref DIO a) #

Applicative DIO Source # 
Instance details

Defined in Simulation.Aivika.Distributed.Optimistic.Internal.DIO

Methods

pure :: a -> DIO a #

(<*>) :: DIO (a -> b) -> DIO a -> DIO b #

liftA2 :: (a -> b -> c) -> DIO a -> DIO b -> DIO c #

(*>) :: DIO a -> DIO b -> DIO b #

(<*) :: DIO a -> DIO b -> DIO a #

Functor DIO Source # 
Instance details

Defined in Simulation.Aivika.Distributed.Optimistic.Internal.DIO

Methods

fmap :: (a -> b) -> DIO a -> DIO b #

(<$) :: a -> DIO b -> DIO a #

Monad DIO Source # 
Instance details

Defined in Simulation.Aivika.Distributed.Optimistic.Internal.DIO

Methods

(>>=) :: DIO a -> (a -> DIO b) -> DIO b #

(>>) :: DIO a -> DIO b -> DIO b #

return :: a -> DIO a #

DequeueStrategy DIO FCFS Source #

An implementation of the FCFS queue strategy.

Instance details

Defined in Simulation.Aivika.Distributed.Optimistic.QueueStrategy

DequeueStrategy DIO LCFS Source #

An implementation of the LCFS queue strategy.

Instance details

Defined in Simulation.Aivika.Distributed.Optimistic.QueueStrategy

EnqueueStrategy DIO FCFS Source #

An implementation of the FCFS queue strategy.

Instance details

Defined in Simulation.Aivika.Distributed.Optimistic.QueueStrategy

EnqueueStrategy DIO LCFS Source #

An implementation of the LCFS queue strategy.

Instance details

Defined in Simulation.Aivika.Distributed.Optimistic.QueueStrategy

QueueStrategy DIO FCFS Source #

An implementation of the FCFS queue strategy.

Instance details

Defined in Simulation.Aivika.Distributed.Optimistic.QueueStrategy

Associated Types

data StrategyQueue DIO FCFS :: Type -> Type #

QueueStrategy DIO LCFS Source #

An implementation of the LCFS queue strategy.

Instance details

Defined in Simulation.Aivika.Distributed.Optimistic.QueueStrategy

Associated Types

data StrategyQueue DIO LCFS :: Type -> Type #

MonadIO (Composite DIO) Source # 
Instance details

Defined in Simulation.Aivika.Distributed.Optimistic.DIO

Methods

liftIO :: IO a -> Composite DIO a #

MonadIO (Process DIO) Source # 
Instance details

Defined in Simulation.Aivika.Distributed.Optimistic.DIO

Methods

liftIO :: IO a -> Process DIO a #

MonadIO (Event DIO) Source # 
Instance details

Defined in Simulation.Aivika.Distributed.Optimistic.Internal.Event

Methods

liftIO :: IO a -> Event DIO a #

data Generator DIO Source # 
Instance details

Defined in Simulation.Aivika.Distributed.Optimistic.Generator

data EventQueue DIO Source # 
Instance details

Defined in Simulation.Aivika.Distributed.Optimistic.Internal.Event

newtype Ref DIO a Source # 
Instance details

Defined in Simulation.Aivika.Distributed.Optimistic.Ref.Base.Lazy

newtype Ref DIO a = Ref {}
newtype Ref DIO a Source # 
Instance details

Defined in Simulation.Aivika.Distributed.Optimistic.Ref.Base.Strict

newtype Ref DIO a = Ref {}
newtype StrategyQueue DIO FCFS a Source # 
Instance details

Defined in Simulation.Aivika.Distributed.Optimistic.QueueStrategy

newtype StrategyQueue DIO LCFS a Source # 
Instance details

Defined in Simulation.Aivika.Distributed.Optimistic.QueueStrategy

data DIOParams Source #

The parameters for the DIO computation.

Constructors

DIOParams 

Fields

Instances

Instances details
Generic DIOParams Source # 
Instance details

Defined in Simulation.Aivika.Distributed.Optimistic.Internal.DIO

Associated Types

type Rep DIOParams :: Type -> Type #

Show DIOParams Source # 
Instance details

Defined in Simulation.Aivika.Distributed.Optimistic.Internal.DIO

Binary DIOParams Source # 
Instance details

Defined in Simulation.Aivika.Distributed.Optimistic.Internal.DIO

Eq DIOParams Source # 
Instance details

Defined in Simulation.Aivika.Distributed.Optimistic.Internal.DIO

Ord DIOParams Source # 
Instance details

Defined in Simulation.Aivika.Distributed.Optimistic.Internal.DIO

type Rep DIOParams Source # 
Instance details

Defined in Simulation.Aivika.Distributed.Optimistic.Internal.DIO

type Rep DIOParams = D1 ('MetaData "DIOParams" "Simulation.Aivika.Distributed.Optimistic.Internal.DIO" "aivika-distributed-1.5-9UhGvcCbdOeLYFelPUdJpU" 'False) (C1 ('MetaCons "DIOParams" 'PrefixI 'True) ((((S1 ('MetaSel ('Just "dioLoggingPriority") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Priority) :*: S1 ('MetaSel ('Just "dioName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String)) :*: (S1 ('MetaSel ('Just "dioTimeHorizon") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Double)) :*: S1 ('MetaSel ('Just "dioUndoableLogSizeThreshold") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int))) :*: ((S1 ('MetaSel ('Just "dioOutputMessageQueueSizeThreshold") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int) :*: S1 ('MetaSel ('Just "dioTransientMessageQueueSizeThreshold") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int)) :*: (S1 ('MetaSel ('Just "dioSyncTimeout") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int) :*: (S1 ('MetaSel ('Just "dioAllowPrematureIO") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool) :*: S1 ('MetaSel ('Just "dioAllowSkippingOutdatedMessage") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool))))) :*: (((S1 ('MetaSel ('Just "dioProcessMonitoringEnabled") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool) :*: S1 ('MetaSel ('Just "dioProcessMonitoringDelay") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int)) :*: (S1 ('MetaSel ('Just "dioProcessReconnectingEnabled") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool) :*: (S1 ('MetaSel ('Just "dioProcessReconnectingDelay") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int) :*: S1 ('MetaSel ('Just "dioKeepAliveInterval") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int)))) :*: ((S1 ('MetaSel ('Just "dioTimeServerAcknowledgementTimeout") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int) :*: S1 ('MetaSel ('Just "dioSimulationMonitoringInterval") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int)) :*: (S1 ('MetaSel ('Just "dioSimulationMonitoringTimeout") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int) :*: (S1 ('MetaSel ('Just "dioStrategy") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 DIOStrategy) :*: S1 ('MetaSel ('Just "dioProcessDisconnectingEnabled") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool)))))))

data DIOEnv Source #

Those DIO environment parameters that cannot be serialized and passed to another process via the net.

Constructors

DIOEnv 

Fields

data DIOStrategy Source #

The logical process strategy.

Constructors

WaitIndefinitelyForTimeServer

Wait for the time server forever

TerminateDueToTimeServerTimeout Int

Terminate due to the exceeded time server timeout in microseconds, but not less than dioSyncTimeout

Instances

Instances details
Generic DIOStrategy Source # 
Instance details

Defined in Simulation.Aivika.Distributed.Optimistic.Internal.DIO

Associated Types

type Rep DIOStrategy :: Type -> Type #

Show DIOStrategy Source # 
Instance details

Defined in Simulation.Aivika.Distributed.Optimistic.Internal.DIO

Binary DIOStrategy Source # 
Instance details

Defined in Simulation.Aivika.Distributed.Optimistic.Internal.DIO

Eq DIOStrategy Source # 
Instance details

Defined in Simulation.Aivika.Distributed.Optimistic.Internal.DIO

Ord DIOStrategy Source # 
Instance details

Defined in Simulation.Aivika.Distributed.Optimistic.Internal.DIO

type Rep DIOStrategy Source # 
Instance details

Defined in Simulation.Aivika.Distributed.Optimistic.Internal.DIO

type Rep DIOStrategy = D1 ('MetaData "DIOStrategy" "Simulation.Aivika.Distributed.Optimistic.Internal.DIO" "aivika-distributed-1.5-9UhGvcCbdOeLYFelPUdJpU" 'False) (C1 ('MetaCons "WaitIndefinitelyForTimeServer" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "TerminateDueToTimeServerTimeout" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int)))

runDIO :: DIO a -> DIOParams -> ProcessId -> Process (ProcessId, Process a) Source #

Run the computation using the specified parameters along with time server process identifier and return the inbox process identifier and a new simulation process.

runDIOWithEnv :: DIO a -> DIOParams -> DIOEnv -> ProcessId -> Process (ProcessId, Process a) Source #

A full version of runDIO that also allows specifying the environment parameters.

defaultDIOParams :: DIOParams Source #

The default parameters for the DIO computation

defaultDIOEnv :: DIOEnv Source #

The default environment parameters for the DIO computation

dioParams :: DIO DIOParams Source #

Return the parameters of the current computation.

messageInboxId :: DIO ProcessId Source #

Return the process identifier of the inbox that receives messages.

timeServerId :: DIO ProcessId Source #

Return the time server process identifier.

logDIO :: Priority -> String -> DIO () Source #

Log the message with the specified priority.

terminateDIO :: DIO () Source #

Terminate the simulation including the processes in all nodes connected to the time server.

registerDIO :: DIO () Source #

Register the simulation process in the time server, which requires some initial quorum to start synchronizing the global time.

unregisterDIO :: DIO () Source #

Unregister the simulation process from the time server without affecting the processes in other nodes connected to the corresponding time server.

monitorProcessDIO :: ProcessId -> DIO () Source #

Monitor the specified process.

processMonitorSignal :: Signal DIO ProcessMonitorNotification Source #

A signal triggered when coming the process monitor notification from the Cloud Haskell back-end.

Orphan instances

MonadComp DIO Source # 
Instance details

MonadDES DIO Source # 
Instance details

MonadIO (Composite DIO) Source # 
Instance details

Methods

liftIO :: IO a -> Composite DIO a #

MonadIO (Process DIO) Source # 
Instance details

Methods

liftIO :: IO a -> Process DIO a #