Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
fslpy
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Analyze
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
FSL
fslpy
Commits
e138ecd2
Commit
e138ecd2
authored
4 years ago
by
Michiel Cottaar
Browse files
Options
Downloads
Patches
Plain Diff
DOC: add hold function to documentation
parent
15e66320
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
fsl/utils/fslsub.py
+2
-1
2 additions, 1 deletion
fsl/utils/fslsub.py
fsl/utils/run.py
+14
-0
14 additions, 0 deletions
fsl/utils/run.py
with
16 additions
and
1 deletion
fsl/utils/fslsub.py
+
2
−
1
View file @
e138ecd2
...
...
@@ -33,6 +33,7 @@ Example usage, building a short pipeline::
info
output
func_to_cmd
hold
"""
...
...
@@ -426,7 +427,7 @@ def hold(job_ids, hold_filename=None):
elif
not
op
.
isdir
(
op
.
split
(
op
.
abspath
(
hold_filename
))[
0
]):
raise
IOError
(
f
"
Hold file (
{
hold_filename
}
) can not be created in non-existent directory
"
)
submit
(
f
'
touch
{
hold_filename
}
'
,
wait_for
=
job_ids
,
minutes
=
1
,
job_name
=
'
.hold
'
)
submit
(
(
'
touch
'
,
hold_filename
)
,
wait_for
=
job_ids
,
minutes
=
1
,
job_name
=
'
.hold
'
)
while
not
op
.
exists
(
hold_filename
):
time
.
sleep
(
10
)
...
...
This diff is collapsed.
Click to expand it.
fsl/utils/run.py
+
14
−
0
View file @
e138ecd2
...
...
@@ -16,6 +16,7 @@
run
runfsl
dryrun
hold
"""
...
...
@@ -422,3 +423,16 @@ def wslcmd(cmdpath, *args):
else
:
# Command was not found in WSL with this path
return
None
def
hold
(
job_ids
,
hold_filename
=
None
):
"""
Waits until all jobs have finished
:param job_ids: possibly nested sequence of job ids. The job ids themselves should be strings.
:param hold_filename: filename to use as a hold file.
The containing directory should exist, but the file itself should not.
Defaults to a ./.<random characters>.hold in the current directory.
:return: only returns when all the jobs have finished
"""
fslsub
.
hold
(
job_ids
,
hold_filename
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment