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) # single process for loop over tasks - tasks stored in memory
results = pysge.mp_submit(tasks, ncores=3) # multiple processes with a queue for the tasks - tasks stored in memory
results = pysge.sge_submit(tasks, "name", "/tmp/pysge-temporaries", options="-q hep.q") # SGE batch pool queue for the tasks - tasks stored on disk
# WIP: results = pysge.condor_submit(tasks, "name", "/tmp/pysge-temporaries") # Condor batch pool queue for the tasks - tasks stored on disk
print(results) # [3, 7, 11]

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.5.tar.gz (8.7 kB view details)

Uploaded Source

Built Distributions

pysge-0.2.5-py3-none-any.whl (10.8 kB view details)

Uploaded Python 3

pysge-0.2.5-py2-none-any.whl (10.8 kB view details)

Uploaded Python 2

File details

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

File metadata

  • Download URL: pysge-0.2.5.tar.gz
  • Upload date:
  • Size: 8.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.1.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.8.1

File hashes

Hashes for pysge-0.2.5.tar.gz
Algorithm Hash digest
SHA256 4f34384125cf6ae6bfcadf125996b3464bbea1e9ef81e81e7b39d26d585c2f47
MD5 6150625135cc7cbf460217cfbadb139a
BLAKE2b-256 12e3528474ff6fc64cc9f0bcdccf5427885dc2c374382304569096422fa61f6c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pysge-0.2.5-py3-none-any.whl
  • Upload date:
  • Size: 10.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.1.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.8.1

File hashes

Hashes for pysge-0.2.5-py3-none-any.whl
Algorithm Hash digest
SHA256 61bcf016b81ed15921fbe492ac85d2634603aad7c1a00c43f85011273f8044b1
MD5 9fb78cbb170f00de88fb203d1b22b83e
BLAKE2b-256 480dae1ce275636b216ebbea52c1e114a34922cbc87356dd7e2a63f6287b18b8

See more details on using hashes here.

File details

Details for the file pysge-0.2.5-py2-none-any.whl.

File metadata

  • Download URL: pysge-0.2.5-py2-none-any.whl
  • Upload date:
  • Size: 10.8 kB
  • Tags: Python 2
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/2.7.17

File hashes

Hashes for pysge-0.2.5-py2-none-any.whl
Algorithm Hash digest
SHA256 adee55692f2bc1080c2d812218a8a180ff38db7b84eedb0887e7631ad5134950
MD5 873edde2a625623abb83be2a4ad4bfc8
BLAKE2b-256 2eb4cdc7224ba31f1ebed7042da6f5ba922b42b13d4243b2de30a72883d25927

See more details on using hashes here.

Supported by

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