Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • BackTrack 5 R2
  • Wine 1.4 / 1.5.5
  • Mozilla Firefox 12...
  • Ubuntu 11.04
  • Angry Birds 1.1.2.1
  • Ubuntu 10.04.4 LTS
  • Linux Kernel 3.4
  • Ubuntu Manual 10.10
  • Adobe Flash Player...
  • Pidgin 2.10.4
  • Home > Linux > Programming > Libraries

    PyMapReduce 0.3

    Download button

    No screenshots available
    Downloads: 58  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Florian Douetteau | More programs
    MIT/X Consortium Lic... / FREE
    March 6th, 2012, 09:15 GMT
    ROOT / Programming / Libraries

     Read user reviews (0)  Refer to a friend  Subscribe

    PyMapReduce description

    Simple MapReduce implementation in Python, for text file parallel processing

    PyMapReduce is a simple Python implementation of MapReduce, using the multiprocessing module. It can be use for instance for quick parallelization of file processing task, e.g. performing operations on each line of a large file.

    Simple operations (regexp matching etc..) are hard to multithread in python because of the Global Interpreter Lock (http://wiki.python.org/moin/GlobalInterpreterLock). Here multiprocessing can help

    Sample job (Word Count)

    class WC(Job):
     "Sample Word count parallel implementation"
     lc = 0
     wc = 0
     bc = 0
     def __init__(self, f):
     self.file = f

     def reduce_start(self):
     self.lc = 0
     self.wc = 0
     self.bc = 0

     def enumerate(self):
     return enumerate(open(self.file))

     def map(self, pos, item):
     return (pos, (1, len(item.split()), len(item)))

     def reduce(self, pos, r):
     (lc, wc, bc) = r
     self.lc = self.lc + lc
     self.wc = self.wc + wc
     self.bc = self.bc + bc

     def reduce_stop(self):
     return (self.lc, self.wc, self.bc)



    Product's homepage

    Requirements:

    · Python

      


    TAGS:

    MapReduce implementation | Python library | Python | MapReduce | implementation



    HTML code for linking to this page:


    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM