Skip to main content

Lsf Hydra Launcher plugin

Project description

hydra-lsf-launcher

This is a simple launcher for launching Hydra jobs on LSF clusters. It is a simple wrapper around the bsub command that allows you to launch Hydra jobs with a single command.

WARNING: expect bugs and run at your own risk. This is not an official Hydra project.

Installation

Install the package with pip:

pip install hydra-lsf-launcher

Usage

Here is an example using hydra-zen to launch a job on an LSF cluster:

from hydra_zen import store, zen
import time


def main_func(sentence):
    time.sleep(120)
    print(sentence)


store(
    main_func,
    hydra_defaults=[
            "_self_",
    ]
)


if __name__ == "__main__":
    store.add_to_hydra_store()
    zen(main_func).hydra_main(
        config_name="main_func", version_base="1.1", config_path=None
    )

Then you can run it with:

python myscript.py hydra/launcher=lsf sentence="Hello World!" -m 

Job groups

To limit the number of concurrent jobs, as for now job arrays are not supported, the user can set job groups:

bgadd /myJobGroup
bgmod -L 4 /myJobGroup  # limit to 4 concurrent jobs

Then you can run it with:

python myscript.py hydra/launcher=lsf hydra.launcher.bsub_args="-g /myJobGroup" sentence="Hello World!" -m 

Some useful commands. To change the limit of a job group:

bgmod -L <new_limit> /myJobGroup

To delete a job group:

bgdel /myJobGroup

More complex examples

Run 5 jobs (4 parallel), each with 2GB of memory, and 4 cores from 2 different nodes.

python myscript.py hydra/launcher=lsf hydra.launcher.verbose=False hydra.launcher.n=4 'hydra.launcher.bsub_args= -g /myJobGroup -R span\[ptile\=2\]' hydra.launcher.M="2GB" sentence="Hello World!,Hello World!,Hello World!,Hello World!,Hello World!" -m

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

hydra_lsf_launcher-0.1.2.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

hydra_lsf_launcher-0.1.2-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

Details for the file hydra_lsf_launcher-0.1.2.tar.gz.

File metadata

  • Download URL: hydra_lsf_launcher-0.1.2.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.20

File hashes

Hashes for hydra_lsf_launcher-0.1.2.tar.gz
Algorithm Hash digest
SHA256 98191670be92da729c1bb7a79abfc97b275b903e5752f03e6bc0bc9fd3b02a1e
MD5 960147d6aceba89d3717b62ea68133fa
BLAKE2b-256 277570cf18c57574661faed6d35d464bf348eab10bdb2b9e3e6053009758073b

See more details on using hashes here.

File details

Details for the file hydra_lsf_launcher-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for hydra_lsf_launcher-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 31690ac53a28db65618e9969cd45685920daf19f1fe4847b232170f622450b43
MD5 d36d9d84462f0c6abbe00b72887029f6
BLAKE2b-256 b8ed9d822f6d6a47c374be2765cd50e8b5c6518c74b91c6ee39643055fab7bfa

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