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

qsub -sync throws an error. #1

Open
gilmorera opened this issue Dec 19, 2023 · 1 comment
Open

qsub -sync throws an error. #1

gilmorera opened this issue Dec 19, 2023 · 1 comment

Comments

@gilmorera
Copy link

Hi @anjos et. al,

I'm using gridtk with UGE and it seems to work. The only problem I've had is when using qsub -sync it circumvents the -terse functionality (see below). I was also unable to make any comments or issues in the GitLab instance where this repo is mirrored, so sorry if I missed something (?).

from gridtk.tools import qsub
qsub([jobscript],
     sge_extra_args='-sync y -V')

The following has output like this:

123456
Job 123456 exited with exit code 0.

I tested the output in my python console with the code from the original traceback which pointed me here:
https://github.com/bioidiap/gridtk/blob/82d328d5f9de18ac569a6856175ed071d20ba998/src/gridtk/tools.py#L258C12-L258C55

# my test
>>> jobid = '123456\nJob 123456 exited with exit code 0.'
>>> int(jobid.split("\n")[-1].split(".", 1)[0])

Traceback (most recent call last):
  File "/Users/gilmorera/Library/Caches/pypoetry/virtualenvs/gris-seqr-vcf-processing-3KNk8Ldu-py3.10/lib/python3.10/site-packages/IPython/core/interactiveshell.py", line 3548, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)
  File "<ipython-input-31-408eaadb10e5>", line 1, in <module>
    int(jobid.split("\n")[-1].split(".", 1)[0])
ValueError: invalid literal for int() with base 10: 'Job 123456 exited with exit code 0'
@gilmorera
Copy link
Author

Here's the solution I've put in my local (https://github.com/bioidiap/gridtk/blob/82d328d5f9de18ac569a6856175ed071d20ba998/src/gridtk/tools.py#L258C12-L258C55)

#def qsub(......
#....
    if '-sync' in scmd:
        return int(jobid.split("\n")[-2].split(".", 1)[0])
    else:
        return int(jobid.split("\n")[-1].split(".", 1)[0])

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

1 participant