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
1f1b5fd1
Commit
1f1b5fd1
authored
Jan 08, 2015
by
Nikolaos S. Papaspyrou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor refactoring of the tests
parent
c5b5bd5e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
21 deletions
+24
-21
Bench.hs
Bench.hs
+8
-1
Tests.hs
Tests.hs
+16
-20
No files found.
Bench.hs
View file @
1f1b5fd1
...
...
@@ -4,8 +4,9 @@ module Bench( -- sequential benchmarks
,
par
-- distributed benhcmarks
,
dist
-- miscellaneous
,
main
,
sz
,
getAnswer
)
where
import
Control.Distributed.Process
...
...
@@ -21,10 +22,16 @@ import Utils
type
Result
=
([
Vertex
],
[
MasterStats
])
--type Result = String
-- | Gets the result of the calculation
result
::
([
Vertex
],
[
MasterStats
])
->
Result
result
=
id
--result = sz . snd
-- | Gets the size (as a string) from the result
getAnswer
::
Result
->
String
getAnswer
=
sz
.
snd
--getAnswer = id
-----------------------------------------------------------------------------
-- benchmarks, parametrised by
-- * list of Generators
...
...
Tests.hs
View file @
1f1b5fd1
...
...
@@ -13,7 +13,7 @@ import Test.Framework.Providers.HUnit (testCase)
import
Test.HUnit
(
Assertion
)
import
Test.HUnit.Base
(
assertBool
)
import
Bench
(
seq
,
par
,
dist
,
sz
)
import
Bench
(
seq
,
par
,
dist
,
getAnswer
)
import
MasterWorker
(
__remoteTable
)
import
Utils
...
...
@@ -22,81 +22,81 @@ import Utils
testSeqShort
::
TestResult
String
->
Process
()
testSeqShort
result
=
do
x
<-
seq
gg13
11
stash
result
(
get
Res
x
)
stash
result
(
get
Answer
x
)
testSeqIntermediate
::
TestResult
String
->
Process
()
testSeqIntermediate
result
=
do
x
<-
seq
gg124
157
stash
result
(
get
Res
x
)
stash
result
(
get
Answer
x
)
testSeqLong
::
TestResult
String
->
Process
()
testSeqLong
result
=
do
x
<-
seq
gg1245
157
stash
result
(
get
Res
x
)
stash
result
(
get
Answer
x
)
-- Parallel Tests
testParShort
::
TestResult
String
->
Process
()
testParShort
result
=
do
x
<-
par
True
gg13
11
2
stash
result
(
get
Res
x
)
stash
result
(
get
Answer
x
)
testParIntermediate
::
TestResult
String
->
Process
()
testParIntermediate
result
=
do
x
<-
par
True
gg124
157
2
stash
result
(
get
Res
x
)
stash
result
(
get
Answer
x
)
testParLong
::
TestResult
String
->
Process
()
testParLong
result
=
do
x
<-
par
True
gg1245
157
2
stash
result
(
get
Res
x
)
stash
result
(
get
Answer
x
)
testParSeqShort
::
TestResult
String
->
Process
()
testParSeqShort
result
=
do
x
<-
par
False
gg13
11
2
stash
result
(
get
Res
x
)
stash
result
(
get
Answer
x
)
testParSeqIntermediate
::
TestResult
String
->
Process
()
testParSeqIntermediate
result
=
do
x
<-
par
False
gg124
157
2
stash
result
(
get
Res
x
)
stash
result
(
get
Answer
x
)
testParSeqLong
::
TestResult
String
->
Process
()
testParSeqLong
result
=
do
x
<-
par
False
gg1245
157
2
stash
result
(
get
Res
x
)
stash
result
(
get
Answer
x
)
-- Distributed Tests
testDistShort
::
[
NodeId
]
->
TestResult
String
->
Process
()
testDistShort
nodes
result
=
do
x
<-
dist
True
gg13
11
2
nodes
stash
result
(
get
Res
x
)
stash
result
(
get
Answer
x
)
testDistIntermediate
::
[
NodeId
]
->
TestResult
String
->
Process
()
testDistIntermediate
nodes
result
=
do
x
<-
dist
True
gg124
157
2
nodes
stash
result
(
get
Res
x
)
stash
result
(
get
Answer
x
)
testDistLong
::
[
NodeId
]
->
TestResult
String
->
Process
()
testDistLong
nodes
result
=
do
x
<-
dist
True
gg1245
157
2
nodes
stash
result
(
get
Res
x
)
stash
result
(
get
Answer
x
)
testDistSeqShort
::
[
NodeId
]
->
TestResult
String
->
Process
()
testDistSeqShort
nodes
result
=
do
x
<-
dist
False
gg13
11
2
nodes
stash
result
(
get
Res
x
)
stash
result
(
get
Answer
x
)
testDistSeqIntermediate
::
[
NodeId
]
->
TestResult
String
->
Process
()
testDistSeqIntermediate
nodes
result
=
do
x
<-
dist
False
gg124
157
2
nodes
stash
result
(
get
Res
x
)
stash
result
(
get
Answer
x
)
testDistSeqLong
::
[
NodeId
]
->
TestResult
String
->
Process
()
testDistSeqLong
nodes
result
=
do
x
<-
dist
False
gg1245
157
2
nodes
stash
result
(
get
Res
x
)
stash
result
(
get
Answer
x
)
-- Batch the tests
...
...
@@ -165,10 +165,6 @@ main = testMain $ orbitTests
-- Auxiliary functions
-------------------------------------------------------------------
-- | Gets the size from MasterStats.
getRes
=
Result
->
String
getRes
=
sz
.
snd
-- | A mutable cell containing a test result.
type
TestResult
a
=
MVar
a
...
...
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