Skip to content
New issue

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

How to kill array jobs using lsb_forcekilljob? #38

Open
rajathpatil opened this issue May 17, 2021 · 4 comments
Open

How to kill array jobs using lsb_forcekilljob? #38

rajathpatil opened this issue May 17, 2021 · 4 comments

Comments

@rajathpatil
Copy link

How do i pass an array jobs to the function lsb_forcekilljob to be killed?

Passing an array job, lsf.lsb_forcekilljob(337400[4]) throws the following error:
Traceback (most recent call last):
File "/data/cmetrics/lsf_test.py", line 64, in
lsf.lsb_forcekilljob(337400[4])
TypeError: 'int' object has no attribute 'getitem'

Also how do i pass a group of jobs to be killed at once?

@adamsla
Copy link
Contributor

adamsla commented May 17, 2021

Have you ever downloaded the LSF command line source code from FixCentral? It's available. Since the API is based upon SWIG, you can translate almost directly.

@adamsla
Copy link
Contributor

adamsla commented May 17, 2021

You should be able to order and download the sample code from here. Look forward to your pull request. https://www.ibm.com/support/fixcentral/swg/doSelectFixes?options.selectedFixes=lsf-10.1-build427553&continue=1

@rajathpatil
Copy link
Author

adamsla,
Yes I have used LSF command line. The array jobs can be killed by enclosing it in quotes. However lsb_forcekilljob only takes parameters in LONG_INT so cannot pass it array jobs within quotes, it errors out.

@adamsla
Copy link
Contributor

adamsla commented May 20, 2021

Sure, I think the bulk kill is using a unsigned long long that includes both the jobid and the indexid as a single integer. So, there is a macro you can find in the lsbatch.h I think that is something to the affect of the following, which I just clipped out of the code (removing stuff that looks proprietary):

#define LSB_JOBID(array_jobId, array_idx) { blah }
#define LSB_JOBID2(array_jobId, array_idx) { blah blah }
#define LSB_ARRAY_IDX(jobId) { blah blah blah }

It would be nice to see a pull request from someone who can detect the bracketed notation and convert it into something that the API recognizes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants