Giter Site home page Giter Site logo

bsparallel's Introduction

Copy-paste:

wget https://raw.githubusercontent.com/jpivarski/bsparallel/main/bsparallel.py

Reminder of how to use it:

import time

import bsparallel

def task(i):
    print(i)
    time.sleep(1)
    if i == 8:
        raise Exception

bsparallel.run(5, task, range(20))

And what it does:

18:34 BEGIN WORKER-0
18:34 WORKER-0: 0
18:34 BEGIN WORKER-1
18:34 WORKER-1: 1
18:34 BEGIN WORKER-2
18:34 WORKER-2: 2
18:34 BEGIN WORKER-3
18:34 WORKER-3: 3
18:34 BEGIN WORKER-4
18:34 WORKER-4: 4
18:34 WORKER-0: 5
18:34 WORKER-1: 6
18:34 WORKER-2: 7
18:34 WORKER-3: 8
18:34 WORKER-4: 9
18:34 WORKER-0: 10
18:34 WORKER-1: 11
18:34 WORKER-2: 12
18:34 WORKER-4: 13
18:34 WORKER-3: Traceback (most recent call last):
18:34 WORKER-3:   File "/home/jpivarski/irishep/bsparallel/bsparallel.py", line 34, in work
18:34 WORKER-3:     task(*args)
18:34 WORKER-3:   File "<stdin>", line 5, in task
18:34 WORKER-3: Exception
18:34 WORKER-3: 
18:34 END WITH ERROR WORKER-3
18:34 END BECAUSE DEAD WORKER-0
18:34 END BECAUSE DEAD WORKER-1
18:34 END BECAUSE DEAD WORKER-2
18:34 END BECAUSE DEAD WORKER-4

Why?

Too many fresh, unconfigured VMs; no time to set up and use a proper parallel framework.

bsparallel's People

Contributors

jpivarski avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.