plmap

Parallel map using multi-threading and multi-processing


Keywords
parallelization, plmap, plmapp, plmapt, pmapp, multi-threading, multi-processing, parallel, map
License
MIT
Install
pip install plmap==2.0.0

Documentation

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> , ..... ]