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
0c21388a
Commit
0c21388a
authored
Dec 05, 2014
by
Aggelos Giantsios
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Invoke distributed version with appropriate command line arguments
parent
6c360403
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
1 deletion
+24
-1
Bench.hs
Bench.hs
+24
-1
No files found.
Bench.hs
View file @
0c21388a
...
@@ -8,7 +8,7 @@ module Bench( -- sequential benchmarks
...
@@ -8,7 +8,7 @@ module Bench( -- sequential benchmarks
)
where
)
where
import
Control.Distributed.Process
import
Control.Distributed.Process
--
import qualified Control.Distributed.Process.Backend.SimpleLocalnet as SLN
import
qualified
Control.Distributed.Process.Backend.SimpleLocalnet
as
SLN
import
Control.Distributed.Process.Node
import
Control.Distributed.Process.Node
import
Prelude
hiding
(
seq
)
import
Prelude
hiding
(
seq
)
import
Network.Transport.TCP
import
Network.Transport.TCP
...
@@ -68,6 +68,11 @@ select_par_bench "True" = par
...
@@ -68,6 +68,11 @@ select_par_bench "True" = par
select_par_bench
"False"
=
par_seq
select_par_bench
"False"
=
par_seq
select_par_bench
_
=
error
"Invalid IWP Flag"
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
_
=
error
"Invalid IWP Flag"
bench_args
::
String
->
(
Vertex
->
GenClos
,
Int
)
bench_args
::
String
->
(
Vertex
->
GenClos
,
Int
)
bench_args
"short"
=
(
gg13
,
11
)
bench_args
"short"
=
(
gg13
,
11
)
bench_args
"intermediate"
=
(
gg124
,
157
)
bench_args
"intermediate"
=
(
gg124
,
157
)
...
@@ -87,10 +92,28 @@ main = do
...
@@ -87,10 +92,28 @@ main = do
let
bench
=
select_par_bench
iwp
let
bench
=
select_par_bench
iwp
res
<-
bench
gnrt
n
(
read
w
::
Int
)
res
<-
bench
gnrt
n
(
read
w
::
Int
)
liftIO
$
print
res
liftIO
$
print
res
-- Distributed Orbit
[
"dist"
,
"master"
,
iwp
,
version
,
w
,
host
,
port
]
->
do
let
(
gnrt
,
n
)
=
bench_args
version
b
<-
SLN
.
initializeBackend
host
port
rtable
print
$
"Starting master @ "
++
host
++
":"
++
port
++
" with slaves:"
SLN
.
startMaster
b
$
\
slaves
->
do
let
bench
=
select_dist_bench
iwp
liftIO
$
print
$
" "
++
show
slaves
res
<-
bench
gnrt
n
(
read
w
::
Int
)
slaves
liftIO
$
print
res
[
"dist"
,
"slave"
,
host
,
port
]
->
do
b
<-
SLN
.
initializeBackend
host
port
rtable
print
$
"Starting slave @ "
++
host
++
":"
++
port
SLN
.
startSlave
b
-- Invalid configuration
-- Invalid configuration
_
->
do
_
->
do
putStrLn
"Paraller Version"
putStrLn
"Paraller Version"
putStrLn
"Usage: ./orbit par [True|False] [short|intermediat|long] nWorkers host port"
putStrLn
"Usage: ./orbit par [True|False] [short|intermediat|long] nWorkers host port"
putStrLn
"Distributed Version [Master Node]"
putStrLn
"Usage: ./orbit dist master [True|False] [short|intermediat|long] nWorkers host port"
putStrLn
"Distributed Version [Slave Node]"
putStrLn
"Usage: ./orbit dist slave host port"
where
rtable
::
RemoteTable
where
rtable
::
RemoteTable
rtable
=
MasterWorker
.
__remoteTable
initRemoteTable
rtable
=
MasterWorker
.
__remoteTable
initRemoteTable
...
...
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