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

Sleep before qstat() #2

Open
varduefr opened this issue Oct 18, 2018 · 1 comment
Open

Sleep before qstat() #2

varduefr opened this issue Oct 18, 2018 · 1 comment

Comments

@varduefr
Copy link

Hi,
Really like the package! Good work!
Only one tip...I'm calling the qsub using popen but if I'm calling qstat() right after, the package throws an exception as Grid Engine is still doing his job. I needed to add a sleep(2) in between.
I guess I need to check the popen until finished.

gold_auto_call = 'qsub -t 1-4 gold_auto.sh '
process = Popen(shlex.split(gold_auto_call), stdout=PIPE)
(output, err) = process.communicate()
exit_code = process.wait()
time.sleep(2)
queue_info, job_info = qstat()
all_jobs = queue_info + job_info

@relleums
Copy link
Owner

From my experience the qsub call is blocking until the job is in the queue.
What qsub flavor do you use? sun-grid-engine?
As you said, I think waiting until the qsub call returns should prevent you from this race condition.

What exception is raised here?

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