Skip to main content

python interface to submit functions to an SGE batch cluster

Project description

          pysge      +     +
    /\         /\     \   O \
   / \\  /\   /\\\     \_/|\_\
  /   \\/ \\ /  \\\       \\
       /   \/    \\\     \/'
      /    /      \\\     \\_
     /    /        \\\     -

Call python functions on (IC) SGE batch cluster - with tqdm progress bars. Designed to work inside a jupyter notebook.

How to use

Docs.

High-level interface use:

import pysge

def myfunc(a, b):
    return a + b

tasks = [
    {"task": myfunc, "args": (1, 2), "kwargs": {}},
    {"task": myfunc, "args": (3, 4), "kwargs": {}},
    {"task": myfunc, "args": (5, 6), "kwargs": {}},
]

results = pysge.local_submit(tasks)
results = pysge.mp_submit(tasks, ncores=3)
results = pysge.sge_submit(tasks, "name", "/tmp/pysge-temporaries", options="-q hep.q")

The return value is a list of results for each task, in order of tasks.

How it works

For SGE batch system a working area is created and the functions + args + kwargs are dilled. A submitter then submits each dilled file to the batch using subprocess. A monitor checks the status of these jobs, waits until all are finished and returns the results.

For multiprocessing no working area is needed and the submitter uses multiprocessing.

For local no submitter is needed. It just loops over the tasks.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pysge-0.2.4.tar.gz (7.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pysge-0.2.4-py3-none-any.whl (10.7 kB view details)

Uploaded Python 3

File details

Details for the file pysge-0.2.4.tar.gz.

File metadata

  • Download URL: pysge-0.2.4.tar.gz
  • Upload date:
  • Size: 7.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.33.0 CPython/3.7.3

File hashes

Hashes for pysge-0.2.4.tar.gz
Algorithm Hash digest
SHA256 991d831583e9df088a9e5e1422b7b47e773b9a8734d1c007aea8c9fcdc9c569d
MD5 979e6c0b2e6b8c0f5cbdca7ef80e60e2
BLAKE2b-256 0c84f2e83727aacc684bbf9ee8b3f5bb5633c54bf4ffac292139e5630cc6ebb4

See more details on using hashes here.

File details

Details for the file pysge-0.2.4-py3-none-any.whl.

File metadata

  • Download URL: pysge-0.2.4-py3-none-any.whl
  • Upload date:
  • Size: 10.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.33.0 CPython/3.7.3

File hashes

Hashes for pysge-0.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 a8ce76d76bbe98f82b7d9e3e24dfabe77c6ef70993be34ba5afeea856b3b88ef
MD5 af0bb6445f5f8461880d89f2771d313e
BLAKE2b-256 c92866515d254d476ae04d0a6f1c47d94380a8c2816adc82848dcb69b01cbba1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page