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
39aaad5c
Commit
39aaad5c
authored
Nov 20, 2014
by
Yiannis Tsiouris
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add proper main for setting-up the nodes
parent
5a9af884
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
17 deletions
+32
-17
Bench.hs
Bench.hs
+31
-17
MasterWorker.hs
MasterWorker.hs
+1
-0
No files found.
Bench.hs
View file @
39aaad5c
...
@@ -4,17 +4,16 @@ module Bench( -- sequential benchmarks
...
@@ -4,17 +4,16 @@ module Bench( -- sequential benchmarks
,
par
,
par_seq
,
par
,
par_seq
-- distributed benhcmarks
-- distributed benhcmarks
,
dist
,
dist_seq
,
dist
,
dist_seq
,
seqTest
,
main
)
where
)
where
import
Control.Concurrent
(
threadDelay
)
import
Control.Distributed.Process
import
Control.Distributed.Process
import
Control.Distributed.Process.Node
import
Control.Distributed.Process.Node
import
qualified
Control.Distributed.Process.Backend.SimpleLocalnet
as
SLN
import
Prelude
hiding
(
seq
)
import
Prelude
hiding
(
seq
)
import
Network.Transport.TCP
import
System.Environment
(
getArgs
)
import
MasterWorker
(
HostInfo
(
..
),
MaybeHosts
(
..
),
import
MasterWorker
MasterStats
,
orbit
)
import
Utils
import
Utils
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
...
@@ -63,11 +62,26 @@ sz (mainStats : _) =
...
@@ -63,11 +62,26 @@ sz (mainStats : _) =
Nothing
->
"false"
Nothing
->
"false"
Just
s
->
"{size,"
++
s
++
"}"
Just
s
->
"{size,"
++
s
++
"}"
seqTest
::
IO
()
rtable
::
RemoteTable
seqTest
=
do
rtable
=
MasterWorker
.
__remoteTable
initRemoteTable
Right
t
<-
createTransport
"127.0.0.1"
"10504"
defaultTCPParameters
node
<-
newLocalNode
t
initRemoteTable
main
::
IO
()
runProcess
node
$
do
main
=
do
res
<-
par
gg13
11
2
args
<-
getArgs
case
args
of
[
"master"
,
host
,
port
]
->
do
b
<-
SLN
.
initializeBackend
host
port
rtable
print
$
"Starting master @ "
++
host
++
":"
++
port
++
" with slaves:"
SLN
.
startMaster
b
$
\
slaves
->
do
liftIO
$
print
$
" "
++
show
slaves
res
<-
dist
gg13
11
2
slaves
liftIO
$
print
res
liftIO
$
print
res
threadDelay
(
1
*
1000000
)
[
"slave"
,
host
,
port
]
->
do
b
<-
SLN
.
initializeBackend
host
port
rtable
print
$
"Starting slave @ "
++
host
++
":"
++
port
SLN
.
startSlave
b
-- 1 second wait. Otherwise the main thread can terminate before
-- our messages reach the logging process or get flushed to stdio
--threadDelay (1 * 1000000)
MasterWorker.hs
View file @
39aaad5c
...
@@ -21,6 +21,7 @@ module MasterWorker( -- Master
...
@@ -21,6 +21,7 @@ module MasterWorker( -- Master
,
tail_idle_from_stat
,
tail_idle_from_stat
,
max_idle_from_stat
,
max_idle_from_stat
,
WorkerStats
,
WorkerStats
,
__remoteTable
)
where
)
where
import
Control.Distributed.Process
import
Control.Distributed.Process
...
...
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