Skip to content

Simple fork/join parallelism with Python's for loop

Notifications You must be signed in to change notification settings

IncubatorShokuhou/python-parallelize

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

python-parallelize

人肉闭包好!

Simple fork/join parallelism with Python's for loop

Quick Start

Installation

pip install git+https://github.com/IncubatorShokuhou/python-parallelize.git

Parallel iteration with a process/CPU:

import os
from parallelize import parallelize
    
for i in parallelize(range(100),n_jobs = "half"):   
#n_jobs can be "all","half","quarter" or any integer not more than the number of cpus( which can be caculated by multiprocessing.cpu_count())
    print(os.getpid(), i)

About

Simple fork/join parallelism with Python's for loop

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 98.3%
  • Makefile 1.7%