We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue
I would like to use the lsf-python-api to submit a LSF job which requests exclusive use of hardware resources.
For example, here's how I request 4 cores, 1 GPU, and 1000 MB of RAM with a 1h walltime:
import pythonlsf.lsf as lsf import os if lsf.lsb_init("test") > 0: raise ValueError("Unable to initialise LSF environment") submitreq = lsf.submit() submitreq.options = 0 submitreq.options2 = 0 submitreq.options3 = 0 submitreq.options4 = 0 submitreq.beginTime = 0 submitreq.termTime = 0 submitreq.resReq = "rusage[mem=1000:ngpus_physical=1.00] span[ptile=1] affinity[core(4,exclusive=(core,alljobs))*1]" submitreq.outFile = os.path.join(os.getcwd(), "my-stdout.txt") submitreq.queue = "x86_1h" submitreq.options = lsf.SUB_OUT_FILE | lsf.SUB_QUEUE | lsf.SUB_RES_REQ submitreq.options2 = lsf.SUB2_OVERWRITE_OUT_FILE submitreq.cwd = os.getcwd() submitreq.options3 = lsf.SUB3_CWD submitreq.command = "nvidia-smi" submitreply = lsf.submitReply() job_id = lsf.lsb_submit(submitreq, submitreply) print("Job id is", job_id)
Observed behaviour
Running the above prints a job id and when I use bjobs -l <id> I see this at the bottom of the printout:
bjobs -l <id>
GPU REQUIREMENT DETAILS: Combined: mode=shared:mps=no:j_exclusive=no:gvendor=nvidia Effective: mode=shared:mps=no:j_exclusive=no:gvendor=nvidia
Expected behaviour
If I run an equivalent bsub command I have the option of setting the gpu mode like so:
bsub
gpu mode
bsub <other fields....> -gpu num=1:mode=exclusive_process
Then when I look at the bjobs -l <id> information I see this printout:
Combined: num=1:mode=exclusive_process:mps=no:j_exclusive=yes:gvendor=nvidia Effective: num=1:mode=exclusive_process:mps=no:j_exclusive=yes:gvendor=nvidia
Question
How can I get my python code to ask for exclusive use of the requested GPUs ?
The text was updated successfully, but these errors were encountered:
#54
Sorry, something went wrong.
Hi @liyancn I just tested the example you provided and after making a small change (#58) it worked, thank you!
liyancn
No branches or pull requests
Issue
I would like to use the lsf-python-api to submit a LSF job which requests exclusive use of hardware resources.
For example, here's how I request 4 cores, 1 GPU, and 1000 MB of RAM with a 1h walltime:
Observed behaviour
Running the above prints a job id and when I use
bjobs -l <id>
I see this at the bottom of the printout:Expected behaviour
If I run an equivalent
bsub
command I have the option of setting thegpu mode
like so:bsub <other fields....> -gpu num=1:mode=exclusive_process
Then when I look at the
bjobs -l <id>
information I see this printout:Question
How can I get my python code to ask for exclusive use of the requested GPUs ?
The text was updated successfully, but these errors were encountered: