Parry-0.1.0.0: A proven synchronization server for high performance computing.

Copyright(c) Pierre-Étienne Meunier 2014
LicenseGPL-3
Maintainerpierre-etienne.meunier@lif.univ-mrs.fr
Stabilityexperimental
PortabilityAll
Safe HaskellNone
LanguageHaskell2010

Parry.Client

Contents

Description

Tool to build clients for Parry.

Synopsis

Jobs on the client side

class Client j where Source

For a job to be usable by Parry's clients, it must be a member of this class.

Methods

isResult :: j -> Bool Source

This function is used by the client to distinguish results from regular jobs.

Writing clients

client :: (Binary j, Client j) => Config -> (Bool -> ([j] -> [j] -> IO ()) -> j -> IO [j]) -> IO () Source

client config work calls its argument function work on a boolean s (if the server asked to share jobs) and the actual job j that must be done. work must return a list of resulting jobs, that may include results (see Client).

Workers asked to share their input job should share it as early as possible: this usually means that the job already got killed in a previous attempt, probably because of its length.

data Config Source

Client configuration

Constructors

Config 

Fields

server :: String

The server's host name (either a DNS name or an IP address).

port :: PortID

The port number (for instance PortNumber 5129).

privateKey :: PrivateKey

The private key to sign messages.

publicKey :: PublicKey

The public key, that the server must know of before the clients connect.

defaultConfig :: PrivateKey -> PublicKey -> Config Source

A default configuration, matching the server's defaultConfig. Note that, like in the server, you must provide your own private key for signing the protocol messages. See defaultConfig for an example method to generate these keys.