Python
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
dist
plmap
.gitignore
LICENSE
MANIFEST
README.md
requirements.txt
setup.py

README.md

Parallelization for python2.7

This is a generic package for parallelization using Threads and Processes

Install using pip
  • pip install plmap
Install from the source

Example Usage

def add(a, b):     # Function to be called parallely
    return a + b
input = [ [2, 3], [4, 5], [10, 11] ]  # Set of inputs to the add function
  • Parallelization using Multi-Threading
        from plmap import plmapt
        errors, outputs = plmapt(add, input, [], 3, None) 
        errors :  [('0', 'None'), ('0', 'None'), ('0', 'None')]
        # [ ('<error_code>', '<error_description>') ..... ]
        
        outputs : [5, 9, 21]
        # [ <output for the first set of inputs>, <output for the second set of inputs> , ..... ]
  • Parallelization using Multi-Processing
        from plmap import plmapp
        errors, outputs = plmapp(add, input, [], 3, None) 
        errors :  [('0', 'None'), ('0', 'None'), ('0', 'None')]
        # [ ('<error_code>', '<error_description>') ..... ]
        
        outputs : [5, 9, 21]
        # [ <output for the first set of inputs>, <output for the second set of inputs> , ..... ]