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

Uploaded Source

Built Distribution

hydra_lsf_launcher-0.1.1-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: hydra_lsf_launcher-0.1.1.tar.gz
  • Upload date:
  • Size: 4.4 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.1.tar.gz
Algorithm Hash digest
SHA256 d703bf20a398d81f351ff13aaf78b97f43131f4da6a7245e667b7bb68af4ceb7
MD5 9e8b934a1d1413660e4a961a35d32c3f
BLAKE2b-256 01990bde92d0ffcaf616c5c3a3d584ace7d3d7821695542e4d5c0228b4727d37

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for hydra_lsf_launcher-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 43f74186b7daa0415b771977251ca036e6ca971551bbb04c640ee53090a8b6b0
MD5 40d7a606b4dda20297c7039ca58585da
BLAKE2b-256 a51c51fbbf9e9a1d793feaca7fe17d7ed1fba4298fed363b7fbb96604c3fc328

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