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

Use SLURM dependencies to wait for jobs before getting output #2

Merged
merged 6 commits into from
Mar 7, 2017

Conversation

itcarroll
Copy link
Contributor

@msmorul After you mentioned today that srun blocks until the job is done, I realized this provides a mechanism to block the R process too via system('srun ...'). Just had to make a slurm_job's output collection function execute a dummy job with srun that has the parent job as a dependency. I don’t believe it locks up a cluster node, but let me know what you think of this solution.

R/slurm_utils.R Outdated
# Submit a dummy job with dependency to block R script
wait_for_job <- function(slr_job) {
srun <- sprintf(
'srun -n1 -t0:1 -o/dev/null -Q -dafterany:%d /bin/hostname',
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will work, however may want to use --dependency= as there is a discrepency between the llnl docs say (-P) https://computing.llnl.gov/tutorials/linux_clusters/man/srun.txt and what srun on our cluster accepts (-d).

@itcarroll itcarroll merged commit 19f5e71 into master Mar 7, 2017
@itcarroll itcarroll deleted the wait branch March 7, 2017 19:20
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

Successfully merging this pull request may close these issues.

2 participants