Commit eda5fcc6 authored by Aggelos Giantsios's avatar Aggelos Giantsios

Add module to define all the types we use

parent c598399b
...@@ -4,12 +4,32 @@ ...@@ -4,12 +4,32 @@
module Sequential(Generator module Sequential(Generator
, orbit) where , orbit) where
import Table (Freq, Stats, VTable, Vertex, get_freq, freq_to_stat, is_member, insert, new, to_list) import Data.Hashable
import Data.Hashable (hash) ( hash
import Data.Dequeue (BankersDequeue, fromList, popFront, pushBack) )
import Data.Dequeue
( BankersDequeue
, fromList
, popFront
, pushBack
)
import Table
( get_freq
, freq_to_stat
, is_member
, insert
, new
, to_list
)
import OrbitUtils (now) import OrbitUtils (now)
import Types
( Generator
, Freq
, Stats
, Vertex
, VTable
)
type Generator = Vertex -> Vertex
type Conf = ([Generator], Int) type Conf = ([Generator], Int)
-- DATA -- DATA
......
...@@ -22,12 +22,19 @@ module Table( Freq ...@@ -22,12 +22,19 @@ module Table( Freq
, freq_from_stat , freq_from_stat
, fill_deg) where , fill_deg) where
import Data.Array (Array, elems, listArray, (!), (//)) import Data.Array
(Array
type Freq = [Int] , elems
type Vertex = Int , listArray
type VTable = Array Int [Vertex] , (!)
type Stats = [(String, String)] , (//)
)
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
......
--
-- orbit-int types
--
module Types ( Generator
, Freq
, Host
, MaybeHosts(..)
, Stats
, Vertex
, VTable) where
import Data.Array
( Array
)
import Control.Distributed.Process
( NodeId
)
type Freq = [Int]
type Vertex = Int
type VTable = Array Int [Vertex]
type Stats = [(String, String)]
type Generator = Vertex -> Vertex
type Host = (NodeId, Int, Int, Int) -- Node, Procs, TableSize, IdleTimeout
data MaybeHosts = Seq Int
| Par [Host]
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