git.iko.soy/distributed-process
on master help sign in
Minor changes
c69040bEdsko de Vries
distributed-process-demos/distributed-process-demos.cabal+1−1
@@ -126,7 +126,7 @@ executable distributed-process-simplelocalnet-mapreduce
126 array >= 0.4 && < 0.5,
126 array >= 0.4 && < 0.5,
127 random >= 1.0 && < 1.1
127 random >= 1.0 && < 1.1
128 extensions: BangPatterns, CPP, TemplateHaskell, ScopedTypeVariables
128 extensions: BangPatterns, CPP, TemplateHaskell, ScopedTypeVariables
129− ghc-options: -Wall
129+ ghc-options: -Wall -rtsopts -with-rtsopts=-K64M
130 if flag(use-simplelocalnet)
130 if flag(use-simplelocalnet)
131 build-depends: distributed-process-simplelocalnet
131 build-depends: distributed-process-simplelocalnet
132 cpp-options: -DUSE_SIMPLELOCALNET
132 cpp-options: -DUSE_SIMPLELOCALNET
distributed-process-demos/src/MapReduce/SimpleLocalnet.hs+5−5
@@ -33,7 +33,7 @@ main = do
33 print $ CountWords.localCountWords input
33 print $ CountWords.localCountWords input
34
34
35 -- Distributed word count
35 -- Distributed word count
36− "master" : "count" : host : port : files -> do
36+ "master" : host : port : "count" : files -> do
37 input <- constructInput files
37 input <- constructInput files
38 backend <- initializeBackend host port rtable
38 backend <- initializeBackend host port rtable
39 startMaster backend $ \slaves -> do
39 startMaster backend $ \slaves -> do
@@ -42,16 +42,16 @@ main = do
42
42
43 -- Local k-means
43 -- Local k-means
44 "local" : "kmeans" : [] -> do
44 "local" : "kmeans" : [] -> do
45− points <- replicateM 1000 randomPoint
45+ points <- replicateM 50000 randomPoint
46 withFile "plot.data" WriteMode $ KMeans.createGnuPlot $
46 withFile "plot.data" WriteMode $ KMeans.createGnuPlot $
47 KMeans.localKMeans (arrayFromList points) (take 5 points) 5
47 KMeans.localKMeans (arrayFromList points) (take 5 points) 5
48
48
49 -- Distributed k-means
49 -- Distributed k-means
50− "master" : "kmeans" : host : port : [] -> do
50+ "master" : host : port : "kmeans" : [] -> do
51− points <- replicateM 1000 randomPoint
51+ points <- replicateM 50000 randomPoint
52 backend <- initializeBackend host port rtable
52 backend <- initializeBackend host port rtable
53 startMaster backend $ \slaves -> do
53 startMaster backend $ \slaves -> do
54− result <- KMeans.distrKMeans (arrayFromList points) (take 5 points) slaves 5
54+ result <- KMeans.distrKMeans (arrayFromList points) (take 5 points) slaves 5
55 liftIO $ withFile "plot.data" WriteMode $ KMeans.createGnuPlot result
55 liftIO $ withFile "plot.data" WriteMode $ KMeans.createGnuPlot result
56
56
57 -- Generic slave for distributed examples
57 -- Generic slave for distributed examples