项目作者: MerlinEmris

项目描述 :
Multiprocessing in python
高级语言: Python
项目地址: git://github.com/MerlinEmris/multiprocessing_in_python.git
创建时间: 2021-08-17T11:14:26Z
项目社区:https://github.com/MerlinEmris/multiprocessing_in_python

开源协议:

下载


Multiprocessing In Python

Calculating Fibonachi sequence siries and parallel; time comparizon!

Roadmap


  1. Roadmap


  2. Installation


  3. Usage/Examples

  4. Running Tests

  5. Acknowledgements



Installation

requires python >=3.6

  1. git clone https://github.com/MerlinEmris/multiprocessing_in_python.git
  1. python multiproces\multiprocess.py

Usage/Examples

App gets 2 variables from num to num2
Application calculates Fibonachi secuence siries as normal python app and in parallel where task is seperated between cpu cores.

  1. python multiproces\multiprocess.py 12 22

  1. python multiproces\multiprocess.py 1 40
  1. cpu core count:16
  2. values are 1 - 40
  3. parallel: [[1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584, 4181, 6765, 10946, 17711, 28657, 46368, 75025,
  4. 121393, 196418, 317811, 514229, 832040, 1346269, 2178309, 3524578, 5702887, 9227465, 14930352, 24157817, 39088169, 63245986, 102334155]]
  5. parallel time:15.866930961608887
  6. series: [1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584, 4181, 6765, 10946, 17711, 28657, 46368, 75025, 121393, 196418, 317811, 514229, 832040, 1346269, 2178309, 3524578, 5702887, 9227465, 14930352, 24157817, 39088169, 63245986, 102334155]
  7. series time:36.89705181121826
  8. delta time (series/parallel):2.325405707032644

Running Tests

To run tests, run the following command

  1. python multiproces\test.py

Acknowledgements