Skip to content

--quiet settings not intuitive #2882

@pdimens

Description

@pdimens

Snakemake version
8.11.3

Describe the bug

There is inconsistent and non-intuitive behavior using (or omitting) the --quiet option. Here are examples of the behaviors using a simple snakefile:

rule all:
    input: collect("file.{val}.txt", val = [1,2])
    message: "Checking file outputs"

rule createfile:
    output: touch("file.{val}.txt")
    message: "creating {wildcards.val}"

When called without --quiet, it prints everything, which is expected:

$ snakemake --cores 1
Assuming unrestricted shared filesystem usage.
Building DAG of jobs...
Using shell: /usr/bin/bash
Provided cores: 1 (use --cores to define parallelism)
Rules claiming more threads will be scaled down.
Job stats:
job           count
----------  -------
all               1
createfile        2
total             3

Select jobs to execute...
Execute 1 jobs...

[Fri May 17 14:21:38 2024]
Job 2: creating 2
Reason: Missing output files: file.2.txt

Touching output file file.2.txt.
[Fri May 17 14:21:38 2024]
Finished job 2.
1 of 3 steps (33%) done
Select jobs to execute...
Execute 1 jobs...

[Fri May 17 14:21:38 2024]
Job 1: creating 1
Reason: Missing output files: file.1.txt

Touching output file file.1.txt.
[Fri May 17 14:21:38 2024]
Finished job 1.
2 of 3 steps (67%) done
Select jobs to execute...
Execute 1 jobs...

[Fri May 17 14:21:38 2024]
Job 0: Checking file outputs
Reason: Rules with a run or shell declaration but no output are always executed.

[Fri May 17 14:21:38 2024]
Finished job 0.
3 of 3 steps (100%) done
Complete log: .snakemake/log/2024-05-17T142138.066438.snakemake.log

When using --quiet or --quiet all, it prints nothing (expected):

$ snakemake --cores 1 --quiet

When using --quiet progress, it only prints rule information, but does not print the final line with the path to the Completed log, which seems like something that should be present, as it's neither progress or rule related.

$ snakemake --cores 1 --quiet progress

[Fri May 17 14:23:53 2024]
Job 2: creating 2
Reason: Missing output files: file.2.txt


[Fri May 17 14:23:53 2024]
Job 1: creating 1
Reason: Missing output files: file.1.txt


[Fri May 17 14:23:53 2024]
Job 0: Checking file outputs
Reason: Rules with a run or shell declaration but no output are always executed.

when running with --quiet rules, it only outputs vague progress information, but noticeably does not print the actual progress percentage information, which is only present when --quiet isn't invoked at all. Additionally, it's debatable whether Touching output file _____ should be classified as a progress message rather than a rules message. Nor does it print the Job X: information.

$ snakemake --cores 1 --quiet rules   
Assuming unrestricted shared filesystem usage.
Building DAG of jobs...
Using shell: /usr/bin/bash
Provided cores: 1 (use --cores to define parallelism)
Rules claiming more threads will be scaled down.
Job stats:
job           count
----------  -------
all               1
createfile        2
total             3

Select jobs to execute...
Execute 1 jobs...
Touching output file file.2.txt.
Select jobs to execute...
Execute 1 jobs...
Touching output file file.1.txt.
Select jobs to execute...
Execute 1 jobs...
Complete log: .snakemake/log/2024-05-17T142610.871679.snakemake.log

In summary:

  • the classification of messages as progress or rules is debatable
  • suppressing rules by using --quiet rules also suppresses printing of the percent completion messages like 1 of 3 steps (33%) done
  • suppressing progress by using --quiet progress also suppresses printing the path to the completed log file

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingstale

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions