Skip to content

Commit

Permalink
fix: fixed bug in missing input file handling for cluster jobs (#1544)
Browse files Browse the repository at this point in the history
  • Loading branch information
johanneskoester committed Mar 31, 2022
1 parent e820f97 commit 40e2eb2
Show file tree
Hide file tree
Showing 25 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion snakemake/executors/__init__.py
Expand Up @@ -767,7 +767,7 @@ def get_job_args(self, job):
if len(wait_for_files) > 20:
wait_for_files_file = self.get_jobscript(job) + ".waitforfilesfile.txt"
with open(wait_for_files_file, "w") as fd:
print(wait_for_files, sep="\n", file=fd)
print(*wait_for_files, sep="\n", file=fd)

waitfiles_parameter = format_cli_arg(
"--wait-for-files-file", wait_for_files_file
Expand Down
3 changes: 2 additions & 1 deletion snakemake/io.py
Expand Up @@ -821,7 +821,8 @@ def get_missing():
"Waiting at most {} seconds for missing files.".format(latency_wait)
)
for _ in range(latency_wait):
if not get_missing():
missing = get_missing()
if not missing:
return
time.sleep(1)
missing = "\n".join(get_missing())
Expand Down
4 changes: 3 additions & 1 deletion tests/test14/Snakefile.nonstandard
Expand Up @@ -12,7 +12,9 @@ rule all:
input: 'test.predictions', 'test.2.inter2'

rule compute1:
input: '{name}.in'
input:
'{name}.in',
expand("raw.{i}.txt", i=range(22))
output: ['{name}.%s.inter'%c for c in chromosomes]
params: prefix="{name}"
run:
Expand Down
Empty file added tests/test14/raw.0.txt
Empty file.
Empty file added tests/test14/raw.1.txt
Empty file.
Empty file added tests/test14/raw.10.txt
Empty file.
Empty file added tests/test14/raw.11.txt
Empty file.
Empty file added tests/test14/raw.12.txt
Empty file.
Empty file added tests/test14/raw.13.txt
Empty file.
Empty file added tests/test14/raw.14.txt
Empty file.
Empty file added tests/test14/raw.15.txt
Empty file.
Empty file added tests/test14/raw.16.txt
Empty file.
Empty file added tests/test14/raw.17.txt
Empty file.
Empty file added tests/test14/raw.18.txt
Empty file.
Empty file added tests/test14/raw.19.txt
Empty file.
Empty file added tests/test14/raw.2.txt
Empty file.
Empty file added tests/test14/raw.20.txt
Empty file.
Empty file added tests/test14/raw.21.txt
Empty file.
Empty file added tests/test14/raw.3.txt
Empty file.
Empty file added tests/test14/raw.4.txt
Empty file.
Empty file added tests/test14/raw.5.txt
Empty file.
Empty file added tests/test14/raw.6.txt
Empty file.
Empty file added tests/test14/raw.7.txt
Empty file.
Empty file added tests/test14/raw.8.txt
Empty file.
Empty file added tests/test14/raw.9.txt
Empty file.

0 comments on commit 40e2eb2

Please sign in to comment.