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
bcd47c37
Commit
bcd47c37
authored
Jan 08, 2015
by
Nikolaos S. Papaspyrou
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor refactoring
parent
8dc12860
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
32 additions
and
35 deletions
+32
-35
.gitignore
.gitignore
+2
-0
Bench.hs
Bench.hs
+28
-33
Makefile
Makefile
+1
-1
MasterWorker.hs
MasterWorker.hs
+1
-1
No files found.
.gitignore
View file @
bcd47c37
...
...
@@ -2,5 +2,7 @@
*~
*.o
*.hi
*.dyn_o
*.dyn_hi
orbit
OrbitTests
Bench.hs
View file @
bcd47c37
module
Bench
(
-- sequential benchmarks
seq
-- parallel benchmarks
,
par
,
par_seq
,
par
-- distributed benhcmarks
,
dist
,
dist_seq
,
dist
,
main
)
where
...
...
@@ -17,6 +17,13 @@ import System.Environment
import
MasterWorker
import
Utils
type
Result
=
([
Vertex
],
[
MasterStats
])
--type Result = String
result
::
([
Vertex
],
[
MasterStats
])
->
Result
result
=
id
--result = sz . snd
-----------------------------------------------------------------------------
-- benchmarks, parametrised by
-- * list of Generators
...
...
@@ -24,36 +31,24 @@ import Utils
-- * number of processors P > 0 (per node)
-- * list of Workers (in short node name format 'name@host')
-- sequential orbit computation
seq
::
(
Vertex
->
GenClos
)
->
Vertex
->
Process
String
seq
::
(
Vertex
->
GenClos
)
->
Vertex
->
Process
Result
seq
generators
n
=
orbit
(
generators
n
)
[
0
]
(
Seq
(
2
*
n
))
>>=
return
.
sz
.
snd
orbit
(
generators
n
)
[
0
]
(
Seq
(
2
*
n
))
>>=
return
.
result
-- parallel orbit computation (
par_seq/3
does not spawn image computation)
par
::
(
Vertex
->
GenClos
)
->
Vertex
->
Int
->
Process
String
par
generators
n
p
=
-- parallel orbit computation (
w/ False
does not spawn image computation)
par
::
Bool
->
(
Vertex
->
GenClos
)
->
Vertex
->
Int
->
Process
Result
par
iwp
generators
n
p
=
orbit
(
generators
n
)
[
0
]
(
Par
(
JustOne
(
p
,
((
2
*
n
)
`
div
`
p
)
+
1
,
0
,
True
)))
>>=
return
.
sz
.
snd
par_seq
::
(
Vertex
->
GenClos
)
->
Vertex
->
Int
->
Process
String
par_seq
generators
n
p
=
orbit
(
generators
n
)
[
0
]
(
Par
(
JustOne
(
p
,
((
2
*
n
)
`
div
`
p
)
+
1
,
0
,
False
)))
>>=
return
.
sz
.
snd
-- distributed orbit computation (dist_seq/4 does not spawn image computation)
dist
::
(
Vertex
->
GenClos
)
->
Vertex
->
Int
->
[
NodeId
]
->
Process
String
dist
generators
n
p
workers
=
orbit
(
generators
n
)
[
0
]
(
Par
(
Many
[(
h
,
p
,
(
2
*
n
)
`
div
`
(
w
*
p
)
+
1
,
0
,
True
)
|
h
<-
workers
]))
>>=
return
.
sz
.
snd
where
w
=
length
workers
(
Par
(
JustOne
(
p
,
((
2
*
n
)
`
div
`
p
)
+
1
,
0
,
iwp
)))
>>=
return
.
result
dist_seq
::
(
Vertex
->
GenClos
)
->
Vertex
->
Int
->
[
NodeId
]
->
Process
String
dist_seq
generators
n
p
workers
=
-- distributed orbit computation (w/ False does not spawn image computation)
dist
::
Bool
->
(
Vertex
->
GenClos
)
->
Vertex
->
Int
->
[
NodeId
]
->
Process
Result
dist
iwp
generators
n
p
workers
=
orbit
(
generators
n
)
[
0
]
(
Par
(
Many
[(
h
,
p
,
(
2
*
n
)
`
div
`
(
w
*
p
)
+
1
,
0
,
False
)
|
h
<-
workers
]))
>>=
return
.
sz
.
snd
(
Par
(
Many
[(
h
,
p
,
(
2
*
n
)
`
div
`
(
w
*
p
)
+
1
,
0
,
iwp
)
|
h
<-
workers
]))
>>=
return
.
result
where
w
=
length
workers
sz
::
[
MasterStats
]
->
String
...
...
@@ -63,14 +58,14 @@ sz (mainStats : _) =
Nothing
->
"false"
Just
s
->
"{size,"
++
s
++
"}"
select_par_bench
::
String
->
(
Vertex
->
GenClos
)
->
Vertex
->
Int
->
Process
String
select_par_bench
"True"
=
par
select_par_bench
"False"
=
par
_seq
select_par_bench
::
String
->
(
Vertex
->
GenClos
)
->
Vertex
->
Int
->
Process
Result
select_par_bench
"True"
=
par
True
select_par_bench
"False"
=
par
False
select_par_bench
_
=
error
"Invalid IWP Flag"
select_dist_bench
::
String
->
(
Vertex
->
GenClos
)
->
Vertex
->
Int
->
[
NodeId
]
->
Process
String
select_dist_bench
"True"
=
dist
select_dist_bench
"False"
=
dist
_seq
select_dist_bench
::
String
->
(
Vertex
->
GenClos
)
->
Vertex
->
Int
->
[
NodeId
]
->
Process
Result
select_dist_bench
"True"
=
dist
True
select_dist_bench
"False"
=
dist
False
select_dist_bench
_
=
error
"Invalid IWP Flag"
bench_args
::
String
->
(
Vertex
->
GenClos
,
Int
)
...
...
Makefile
View file @
bcd47c37
...
...
@@ -9,7 +9,7 @@ tests:
ghc
$(COMPILE_OPTS)
Tests.hs
-o
OrbitTests
clean
:
$(RM)
*
.swp
*
~
*
.hi
*
.o
$(RM)
*
.swp
*
~
*
.hi
*
.o
*
.dyn_hi
*
.dyn_o
distclean
:
clean
$(RM)
orbit OrbitTests
MasterWorker.hs
View file @
bcd47c37
...
...
@@ -179,7 +179,7 @@ vertex_server staticMachConf crdt table statData = do
else
newStatData0
{
max_idle
=
max
maxIdle
(
nowTime
-
lastEvent
)}
newStatData
=
newStatData1
{
last_event
=
now
}
vertex_server
staticMachConf
newCredit
newTable
newStatData
,
match
$
\
"dump"
->
do
,
match
$
\
(
"dump"
)
->
do
let
nowTime
=
now
lastEvent
=
last_event
statData
newStatData
=
statData
{
tail_idle
=
nowTime
-
lastEvent
,
...
...
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