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
6c360403
Commit
6c360403
authored
Dec 05, 2014
by
Aggelos Giantsios
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Invoke parallel version with appropriate command line arguments
parent
50937192
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
3 deletions
+39
-3
Bench.hs
Bench.hs
+39
-3
No files found.
Bench.hs
View file @
6c360403
...
...
@@ -8,9 +8,11 @@ module Bench( -- sequential benchmarks
)
where
import
Control.Distributed.Process
--import qualified Control.Distributed.Process.Backend.SimpleLocalnet as SLN
import
Control.Distributed.Process.Node
import
Prelude
hiding
(
seq
)
import
Prelude
hiding
(
seq
)
import
Network.Transport.TCP
import
System.Environment
(
getArgs
)
import
MasterWorker
import
Utils
...
...
@@ -61,22 +63,56 @@ 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
_
=
error
"Invalid IWP Flag"
bench_args
::
String
->
(
Vertex
->
GenClos
,
Int
)
bench_args
"short"
=
(
gg13
,
11
)
bench_args
"intermediate"
=
(
gg124
,
157
)
bench_args
"long"
=
(
gg1245
,
157
)
bench_args
_
=
error
"Invalid Version"
main
::
IO
()
main
=
do
args
<-
getArgs
case
args
of
-- Parallel Orbit
[
"par"
,
iwp
,
version
,
w
,
host
,
port
]
->
do
let
(
gnrt
,
n
)
=
bench_args
version
Right
t
<-
createTransport
host
port
defaultTCPParameters
node
<-
newLocalNode
t
rtable
runProcess
node
$
do
let
bench
=
select_par_bench
iwp
res
<-
bench
gnrt
n
(
read
w
::
Int
)
liftIO
$
print
res
-- Invalid configuration
_
->
do
putStrLn
"Paraller Version"
putStrLn
"Usage: ./orbit par [True|False] [short|intermediat|long] nWorkers host port"
where
rtable
::
RemoteTable
rtable
=
MasterWorker
.
__remoteTable
initRemoteTable
{-
main :: IO ()
main = do
Right t1 <- createTransport "127.0.0.1" "5050" defaultTCPParameters
node1 <- newLocalNode t1 rtable
{-
Right t2 <- createTransport "127.0.0.1" "5051" defaultTCPParameters
node2 <- newLocalNode t2 rtable
Right t3 <- createTransport "127.0.0.1" "5052" defaultTCPParameters
node3 <- newLocalNode t3 rtable
-}
runProcess node1 $ do
res <- par_seq gg1245 2512 32 --[localNodeId node1, localNodeId node2, localNodeId node3]
liftIO $ print res
where rtable :: RemoteTable
rtable = MasterWorker.__remoteTable initRemoteTable
-}
{-
import qualified Control.Distributed.Process.Backend.SimpleLocalnet as SLN
import System.Environment (getArgs)
...
...
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