Commit 7017d46d authored by Yiannis Tsiouris's avatar Yiannis Tsiouris

Re-format files w/ stylish-haskell

parent 4140b535
...@@ -3,40 +3,21 @@ ...@@ -3,40 +3,21 @@
-- --
module Master () where module Master () where
import Control.Distributed.Process import Control.Distributed.Process (Process, ProcessId, match,
( Process receiveWait)
, ProcessId import Credit (credit, is_one)
, receiveWait import qualified Sequential as Sq (orbit)
, match import Table (freq_from_stat, freq_to_stat,
) sum_freqs)
import qualified Sequential as Sq import Types (Generator, HostInfo (..),
( orbit MaybeHosts (..), ParConf, Stats,
) Vertex)
import Credit import Worker (credit_retd_from_stat,
( is_one init_idle_from_stat,
, credit max_idle_from_stat,
) min_atomic_credit_from_stat,
import Table tail_idle_from_stat,
( sum_freqs verts_recvd_from_stat)
, freq_from_stat
, freq_to_stat
)
import Worker
( verts_recvd_from_stat
, credit_retd_from_stat
, min_atomic_credit_from_stat
, init_idle_from_stat
, max_idle_from_stat
, tail_idle_from_stat
)
import Types
( Generator
, HostInfo(..)
, MaybeHosts(..)
, ParConf
, Stats
, Vertex
)
-- DATA -- DATA
-- Static Machine Configuration: -- Static Machine Configuration:
......
...@@ -4,34 +4,12 @@ ...@@ -4,34 +4,12 @@
module Sequential(Generator module Sequential(Generator
, orbit) where , orbit) where
import Data.Hashable import Data.Dequeue (BankersDequeue, fromList, popFront, pushBack)
( hash import Data.Hashable (hash)
) import Table (freq_to_stat, get_freq, insert, is_member, new,
import Data.Dequeue to_list)
( BankersDequeue import Types (Freq, Generator, SeqConf, Stats, VTable, Vertex)
, fromList import Worker (now)
, popFront
, pushBack
)
import Table
( get_freq
, freq_to_stat
, is_member
, insert
, new
, to_list
)
import Worker
( now
)
import Types
( Generator
, Freq
, SeqConf
, Stats
, Vertex
, VTable
)
-- DATA -- DATA
-- Static Machine Configuration: -- Static Machine Configuration:
...@@ -50,7 +28,7 @@ import Types ...@@ -50,7 +28,7 @@ import Types
orbit :: [Generator] -> [Vertex] -> Int -> ([Vertex], [Stats]) orbit :: [Generator] -> [Vertex] -> Int -> ([Vertex], [Stats])
orbit gs xs tableSize = (orbit, [stat]) orbit gs xs tableSize = (orbit, [stat])
-- assemble static configuration -- assemble static configuration
where staticMachConf = mk_static_mach_conf gs tableSize where staticMachConf = mk_static_mach_conf gs tableSize
-- initialise hash table and work queue -- initialise hash table and work queue
table = new tableSize table = new tableSize
queue = fromList xs queue = fromList xs
......
...@@ -22,19 +22,8 @@ module Table( Freq ...@@ -22,19 +22,8 @@ module Table( Freq
, freq_from_stat , freq_from_stat
, fill_deg) where , fill_deg) where
import Data.Array import Data.Array (Array, elems, listArray, (!), (//))
(Array import Types (Freq, Stats, VTable, Vertex)
, elems
, listArray
, (!)
, (//)
)
import Types
( Freq
, Stats
, Vertex
, VTable
)
-- Note: Hash tables have a fixed number of slots but each slot can store -- Note: Hash tables have a fixed number of slots but each slot can store
-- a list of vertices. The functions is_member/3 and insert/3 -- a list of vertices. The functions is_member/3 and insert/3
......
...@@ -12,13 +12,8 @@ module Types ( Ct(..) ...@@ -12,13 +12,8 @@ module Types ( Ct(..)
, Vertex , Vertex
, VTable) where , VTable) where
import Data.Array import Control.Distributed.Process (NodeId, ProcessId)
( Array import Data.Array (Array)
)
import Control.Distributed.Process
( NodeId
, ProcessId
)
type Freq = [Int] type Freq = [Int]
type Vertex = Int type Vertex = Int
...@@ -34,12 +29,12 @@ type ParConf = ([Generator], ProcessId, [ProcessId], Int, Int, Bool) ...@@ -34,12 +29,12 @@ type ParConf = ([Generator], ProcessId, [ProcessId], Int, Int, Bool)
-- counters/timers record -- counters/timers record
data Ct = Ct { data Ct = Ct {
verts_recvd :: Int -- #vertices received by this server so far verts_recvd :: Int -- #vertices received by this server so far
, credit_retd :: Int -- #times server has returned credit to master , credit_retd :: Int -- #times server has returned credit to master
, min_atomic_credit :: Int -- minimal atomic credit received so far , min_atomic_credit :: Int -- minimal atomic credit received so far
, last_event :: Int -- time stamp [ms] of most recent event , last_event :: Int -- time stamp [ms] of most recent event
, init_idle :: Int -- idle time [ms] between init recv first vertex , init_idle :: Int -- idle time [ms] between init recv first vertex
, tail_idle :: Int -- idle time [ms] between send last vertex and dump , tail_idle :: Int -- idle time [ms] between send last vertex and dump
, max_idle :: Int -- max idle [ms] time between vertices , max_idle :: Int -- max idle [ms] time between vertices
} }
-- --
-- orbit-int workeraux -- orbit-int worker
-- --
module Worker ( defaultCt module Worker ( defaultCt
, now , now
...@@ -12,17 +12,9 @@ module Worker ( defaultCt ...@@ -12,17 +12,9 @@ module Worker ( defaultCt
, max_idle_from_stat , max_idle_from_stat
) where ) where
import Control.Distributed.Process import Control.Distributed.Process (NodeId)
( NodeId import Table (freq_to_stat)
) import Types (Ct (..), Freq, Stats)
import Types
( Ct(..)
, Freq
, Stats
)
import Table
( freq_to_stat
)
defaultCt = Ct { defaultCt = Ct {
verts_recvd = 0 verts_recvd = 0
...@@ -51,37 +43,37 @@ worker_stats node frequency statData = ("node", show node) ...@@ -51,37 +43,37 @@ worker_stats node frequency statData = ("node", show node)
: freq_to_stat frequency : freq_to_stat frequency
verts_recvd_from_stat :: Stats -> Int verts_recvd_from_stat :: Stats -> Int
verts_recvd_from_stat stat = verts_recvd_from_stat stat =
case "vertices_recvd" `lookup` stat of case "vertices_recvd" `lookup` stat of
Just val -> read val :: Int Just val -> read val :: Int
Nothing -> 0 -- instead of false Nothing -> 0 -- instead of false
credit_retd_from_stat :: Stats -> Int credit_retd_from_stat :: Stats -> Int
credit_retd_from_stat stat = credit_retd_from_stat stat =
case "credit_retd" `lookup` stat of case "credit_retd" `lookup` stat of
Just val -> read val :: Int Just val -> read val :: Int
Nothing -> 0 -- instead of false Nothing -> 0 -- instead of false
min_atomic_credit_from_stat :: Stats -> Int min_atomic_credit_from_stat :: Stats -> Int
min_atomic_credit_from_stat stat = min_atomic_credit_from_stat stat =
case "min_atomic_credit" `lookup` stat of case "min_atomic_credit" `lookup` stat of
Just val -> read val :: Int Just val -> read val :: Int
Nothing -> 0 -- instead of false Nothing -> 0 -- instead of false
init_idle_from_stat :: Stats -> Int init_idle_from_stat :: Stats -> Int
init_idle_from_stat stat = init_idle_from_stat stat =
case "init_idle_time" `lookup` stat of case "init_idle_time" `lookup` stat of
Just val -> read val :: Int Just val -> read val :: Int
Nothing -> 0 -- instead of false Nothing -> 0 -- instead of false
tail_idle_from_stat :: Stats -> Int tail_idle_from_stat :: Stats -> Int
tail_idle_from_stat stat = tail_idle_from_stat stat =
case "tail_idle_time" `lookup` stat of case "tail_idle_time" `lookup` stat of
Just val -> read val :: Int Just val -> read val :: Int
Nothing -> 0 -- instead of false Nothing -> 0 -- instead of false
max_idle_from_stat :: Stats -> Int max_idle_from_stat :: Stats -> Int
max_idle_from_stat stat = max_idle_from_stat stat =
case "max_idle_time" `lookup` stat of case "max_idle_time" `lookup` stat of
Just val -> read val :: Int Just val -> read val :: Int
Nothing -> 0 -- instead of false Nothing -> 0 -- instead of false
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment