Commit aabc1ad0 authored by Yiannis Tsiouris's avatar Yiannis Tsiouris

Set-up all nodes in main

parent d0e50428
...@@ -9,9 +9,8 @@ module Bench( -- sequential benchmarks ...@@ -9,9 +9,8 @@ module Bench( -- sequential benchmarks
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 import MasterWorker
import Utils import Utils
...@@ -62,11 +61,26 @@ sz (mainStats : _) = ...@@ -62,11 +61,26 @@ sz (mainStats : _) =
Nothing -> "false" Nothing -> "false"
Just s -> "{size," ++ s ++ "}" Just s -> "{size," ++ s ++ "}"
rtable :: RemoteTable
rtable = MasterWorker.__remoteTable initRemoteTable
main :: IO () main :: IO ()
main = do 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 <- dist gg13 11 2 [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)
args <- getArgs args <- getArgs
case args of case args of
...@@ -81,7 +95,7 @@ main = do ...@@ -81,7 +95,7 @@ main = do
b <- SLN.initializeBackend host port rtable b <- SLN.initializeBackend host port rtable
print $ "Starting slave @ " ++ host ++ ":" ++ port print $ "Starting slave @ " ++ host ++ ":" ++ port
SLN.startSlave b SLN.startSlave b
-}
-- 1 second wait. Otherwise the main thread can terminate before -- 1 second wait. Otherwise the main thread can terminate before
-- our messages reach the logging process or get flushed to stdio -- our messages reach the logging process or get flushed to stdio
--threadDelay (1 * 1000000) --threadDelay (1 * 1000000)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment