run¶
The bgqmap run
command is aimed to be use to execute a single command in a cluster
with extended resources.
In certain cluster managers, you can ask for job resources to have a interactive console running on a worker node. Typically, the resources of such a job are quite limited, so few resources are taken even if people leave that console open.
bgqmap run
allows users to run one specific command as another job and then return
so that resources are optimized and only taken for the time that the job requires them.
Note
bgqmap run
keeps your working directory and environment variables for the execution.
Once the job finishes, bgqmap run
will try to provide the user with
some job statistics (if available) like the memory consumed or the elapsed time.
Usage¶
bgqmap run -m <memory> -c <cores> "<command>"
Usage: bgqmap run [OPTIONS] CMD
Execute CMD in shell with new resources
- Options:
-c, --cores INTEGER Number of cores to use. Default: 4 -m, --memory TEXT Max memory. Default: 16G. Units: K|M|G|T. Default units: G -h, --help Show this message and exit.
Examples¶
Usage example:
$ bgqmap run -c 6 -m 12G "sleep 5 && echo 'hello world'"
Executing sleep 5 && echo 'hello world'
salloc: Granted job allocation 31707
hello world
salloc: Relinquishing job allocation 31707
Elapsed time: 00:00:05
Memory 0G
Jobs that require more resources can be easily re-run:
$ python test/python_scripts/memory.py 10
1 Gb
2 Gb
...
8 Gb
Killed
$ bgqmap run -m 12 "python test/python_scripts/memory.py 10"
Executing python test/python_scripts/memory.py 10
salloc: Granted job allocation 36015
1 Gb
...
10 Gb
salloc: Relinquishing job allocation 36015
Elapsed time: 00:00:36
Memory 10G