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
- Host: GitHub
- URL: https://github.com/codingvangogh/parallelization3
- Owner: CodingVanGogh
- License: mit
- Created: 2017-04-13T08:46:52.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2017-09-29T05:44:17.000Z (over 7 years ago)
- Last Synced: 2024-09-09T10:59:55.393Z (9 months ago)
- Topics: multithreading, parallel-computing, parallelization, python, python3, thread
- Language: Python
- Size: 10.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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]
# [ , , ..... ]
```