Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
C
cloud-orbit
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Katerina Roukounaki
cloud-orbit
Commits
f02a8490
Commit
f02a8490
authored
Nov 19, 2014
by
Yiannis Tsiouris
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix types in Bench module
parent
9e6903ee
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
12 deletions
+26
-12
Bench.hs
Bench.hs
+25
-12
MasterWorker.hs
MasterWorker.hs
+1
-0
No files found.
Bench.hs
View file @
f02a8490
...
@@ -6,11 +6,14 @@ module Bench( -- sequential benchmarks
...
@@ -6,11 +6,14 @@ module Bench( -- sequential benchmarks
,
dist
,
dist_seq
,
dist
,
dist_seq
)
where
)
where
import
Control.Distributed.Process
(
Process
,
NodeId
)
import
Data.List
(
lookup
)
import
Data.List
(
lookup
)
import
Data.Maybe
(
fromMaybe
)
import
Data.Maybe
(
fromMaybe
)
import
Prelude
hiding
(
seq
)
import
Prelude
hiding
(
seq
)
import
MasterWorker
(
HostInfo
(
..
),
MaybeHosts
(
..
),
orbit
)
import
MasterWorker
(
HostInfo
(
..
),
MaybeHosts
(
..
),
GenClos
,
MasterStats
,
orbit
)
import
Table
(
Vertex
)
import
Utils
import
Utils
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
...
@@ -20,30 +23,40 @@ import Utils
...
@@ -20,30 +23,40 @@ import Utils
-- * number of processors P > 0 (per node)
-- * number of processors P > 0 (per node)
-- * list of Workers (in short node name format 'name@host')
-- * list of Workers (in short node name format 'name@host')
-- sequential orbit computation
-- sequential orbit computation
seq
::
(
Int
->
GenClos
)
->
Int
->
Process
String
seq
generators
n
=
seq
generators
n
=
sz
$
orbit
(
generators
n
)
[
0
]
(
Seq
(
2
*
n
))
orbit
(
generators
n
)
[
0
]
(
Seq
(
2
*
n
))
>>=
return
.
sz
.
snd
-- parallel orbit computation (par_seq/3 does not spawn image computation)
-- parallel orbit computation (par_seq/3 does not spawn image computation)
par
::
(
Int
->
GenClos
)
->
Int
->
Int
->
Process
String
par
generators
n
p
=
par
generators
n
p
=
sz
$
orbit
(
generators
n
)
[
0
]
orbit
(
generators
n
)
[
0
]
(
Par
(
JustOne
(
p
,
((
2
*
n
)
`
div
`
p
)
+
1
,
0
,
True
)))
(
Par
(
JustOne
(
p
,
((
2
*
n
)
`
div
`
p
)
+
1
,
0
,
True
)))
>>=
return
.
sz
.
snd
par_seq
::
(
Int
->
GenClos
)
->
Int
->
Int
->
Process
String
par_seq
generators
n
p
=
par_seq
generators
n
p
=
sz
$
orbit
(
generators
n
)
[
0
]
orbit
(
generators
n
)
[
0
]
(
Par
(
JustOne
(
p
,
((
2
*
n
)
`
div
`
p
)
+
1
,
0
,
False
)))
(
Par
(
JustOne
(
p
,
((
2
*
n
)
`
div
`
p
)
+
1
,
0
,
False
)))
>>=
return
.
sz
.
snd
-- distributed orbit computation (dist_seq/4 does not spawn image computation)
-- distributed orbit computation (dist_seq/4 does not spawn image computation)
dist
::
(
Int
->
GenClos
)
->
Int
->
Int
->
[
NodeId
]
->
Process
String
dist
generators
n
p
workers
=
dist
generators
n
p
workers
=
sz
$
orbit
(
generators
n
)
[
0
]
orbit
(
generators
n
)
[
0
]
(
Par
(
Many
[(
h
,
p
,
(
2
*
n
)
`
div
`
(
w
*
p
)
+
1
,
1
,
True
)
|
h
<-
workers
]))
(
Par
(
Many
[(
h
,
p
,
(
2
*
n
)
`
div
`
(
w
*
p
)
+
1
,
1
,
True
)
|
h
<-
workers
]))
>>=
return
.
sz
.
snd
where
w
=
length
workers
where
w
=
length
workers
dist_seq
::
(
Int
->
GenClos
)
->
Int
->
Int
->
[
NodeId
]
->
Process
String
dist_seq
generators
n
p
workers
=
dist_seq
generators
n
p
workers
=
sz
$
orbit
(
generators
n
)
[
0
]
orbit
(
generators
n
)
[
0
]
(
Par
(
Many
[(
h
,
p
,
(
2
*
n
)
`
div
`
(
w
*
p
)
+
1
,
1
,
False
)
|
h
<-
workers
]))
(
Par
(
Many
[(
h
,
p
,
(
2
*
n
)
`
div
`
(
w
*
p
)
+
1
,
1
,
False
)
|
h
<-
workers
]))
>>=
return
.
sz
.
snd
where
w
=
length
workers
where
w
=
length
workers
sz
(
_
,
mainStats
:
_
)
=
sz
::
[
MasterStats
]
->
String
sz
(
mainStats
:
_
)
=
case
"size"
`
lookup
`
mainStats
of
case
"size"
`
lookup
`
mainStats
of
Nothing
->
"false"
Nothing
->
"false"
Just
s
->
"{size,"
++
s
++
"}"
Just
s
->
"{size,"
++
s
++
"}"
MasterWorker.hs
View file @
f02a8490
...
@@ -5,6 +5,7 @@
...
@@ -5,6 +5,7 @@
module
MasterWorker
(
-- Master
module
MasterWorker
(
-- Master
GenClos
GenClos
,
HostInfo
(
..
)
,
HostInfo
(
..
)
,
MasterStats
,
MaybeHosts
(
..
)
,
MaybeHosts
(
..
)
,
orbit
,
orbit
,
get_gens
,
get_master
,
get_workers
,
get_spawn_img_comp
,
get_gens
,
get_master
,
get_workers
,
get_spawn_img_comp
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment