This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

A common interface to parallel processing pools.

Enables easy switching between serial execution, multiprocessing, and MPI by providing a common interface.

Example

If you can write your code following the MapReduce programming model, you can trivially parallelize it using The Schwimmbad. For example, if you can structure your code so that a ‘worker’ function operates on elements from a list of tasks, like this:

def worker(task):
    # do something with the task!
    return task**2

def main():
    tasks = range(100)
    results = map(worker, tasks)

if __name__ == "__main__":
    main()

with a few added lines of code, you can make it runnable with multiprocessing and MPI at the switch of a command-line flag:

import schwimmbad

def worker(task):
    # do something with the task!
    return task**2

def main(pool):
    tasks = range(100)
    results = pool.map(worker, tasks)
    pool.close()

if __name__ == "__main__":
    from argparse import ArgumentParser
    parser = ArgumentParser(description="")

    group = parser.add_mutually_exclusive_group()
    group.add_argument("--ncores", dest="n_cores", default=1,
                       type=int, help="Number of processes (uses multiprocessing).")
    group.add_argument("--mpi", dest="mpi", default=False,
                       action="store_true", help="Run with MPI.")
    args = parser.parse_args()

    pool = schwimmbad.choose_pool(mpi=args.mpi, processes=args.n_cores)
    main(pool)

Installation

The easiest way to install is via pip:

pip install schwimmbad

The project is also installable by cloning or downloading the source and using the standard:

python setup.py install

Dependencies

  • six
  • mpi4py (optional - needed for MPI pool support)

License

Copyright 2016 Adrian Price-Whelan.

schwimmbad is free software made available under the MIT License. For details see the LICENSE file.

Release History

Release History

0.2.1

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.2.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
schwimmbad-0.2.1.tar.gz (9.5 kB) Copy SHA256 Checksum SHA256 Source Sep 23, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting