An open API service indexing awesome lists of open source software.

https://github.com/codingvangogh/parallelization3

Parallelization library for python3
https://github.com/codingvangogh/parallelization3

multithreading parallel-computing parallelization python python3 thread

Last synced: 2 months ago
JSON representation

Parallelization library for python3

Awesome Lists containing this project

README

        

# Parallelization for python3

This is a generic package for parallelization using Threads and Processes

##### Install using pip

* pip install plmap3

##### Install from the source
* Download the source : git clone https://github.com/CodingVanGogh/parallelization3
* cd parallelization
* python setup.py install

#### Example Usage

```python
def add(a, b): # Function to be called parallely
return a + b
```

```python
input = [ [2, 3], [4, 5], [10, 11] ] # Set of inputs to the add function
```

* Parallelization using Multi-Threading
``` python
from plmap import plmapt
errors, outputs = plmapt(add, input, [], 3, None)
```
``` python
errors : [('0', 'None'), ('0', 'None'), ('0', 'None')]
# [ ('', '') ..... ]

outputs : [5, 9, 21]
# [ , , ..... ]
```
* Parallelization using Multi-Processing
``` python
from plmap import plmapp
errors, outputs = plmapp(add, input, [], 3, None)
```
``` python
errors : [('0', 'None'), ('0', 'None'), ('0', 'None')]
# [ ('', '') ..... ]

outputs : [5, 9, 21]
# [ , , ..... ]
```