Difference between revisions of "CSC352 Game of Life in Map-Reduce"

From dftwiki3
Jump to: navigation, search
Line 53: Line 53:
 
     isRawLife = line.find( "\"" ) != -1
 
     isRawLife = line.find( "\"" ) != -1
  
 +
    # are we reading the original array of cells from a file?
 
     if isRawLife:
 
     if isRawLife:
 
       lineNo = int( words[0] )
 
       lineNo = int( words[0] )
Line 68: Line 69:
 
                       if row == lineNo and col == j: continue
 
                       if row == lineNo and col == j: continue
 
                       print( "%03d%03d\t%s" % ( row, col, "OneMoreNeighbor" ) )
 
                       print( "%03d%03d\t%s" % ( row, col, "OneMoreNeighbor" ) )
                       
+
   
 +
    # or are we reading tuples output by the reducer?                   
 
     else:
 
     else:
 
       lineNo = int( words[0] )
 
       lineNo = int( words[0] )
Line 177: Line 179:
  
 
</source>
 
</source>
 +
<br />
 +
==Output of ShuffleSort==
 +
<br />
 +
'''cat life0.txt | ./mapper.py | ./shuffleSort.py '''
 +
000004 OneMoreNeighbor
 +
000005 OneMoreNeighbor
 +
000006 OneMoreNeighbor
 +
001004 OneMoreNeighbor
 +
001004 OneMoreNeighbor
 +
001005 OneMoreNeighbor
 +
001005 alive
 +
001006 OneMoreNeighbor
 +
001006 OneMoreNeighbor
 +
002004 OneMoreNeighbor
 +
002004 OneMoreNeighbor
 +
002004 OneMoreNeighbor
 +
002005 OneMoreNeighbor
 +
002005 OneMoreNeighbor
 +
002005 alive
 +
002006 OneMoreNeighbor
 +
002006 OneMoreNeighbor
 +
002006 OneMoreNeighbor
 +
003004 OneMoreNeighbor
 +
003004 OneMoreNeighbor
 +
003005 OneMoreNeighbor
 +
003005 alive
 +
003006 OneMoreNeighbor
 +
003006 OneMoreNeighbor
 +
004004 OneMoreNeighbor
 +
004005 OneMoreNeighbor
 +
004006 OneMoreNeighbor
 +
 
 
<br />
 
<br />
 
=Reducer.py=
 
=Reducer.py=

Revision as of 16:56, 2 April 2017

--D. Thiebaut (talk) 16:47, 2 April 2017 (EDT)



...