How to modify execution orders for Snakemake? My goal is to process two samples, S1 and S2, using two rules, step1, step2.
The Snakemake file is like:

SAMPLES = ['S1', 'S2']

rule all:
  input: expand("{sample}.done", sample = SAMPLES)

rule step1:
  input: "{sample}"
  output: "{sample}.step1.done"
  shell: "touch {output}"

rule step2:
  input: "{sample}.step1.done"
  output: "{sample}.done"
  shell: "touch {output}"


The current execution order is: 

step1 on S1
step1 on S2
step2 on S1
step2 on S2


Is there a way to change the order to:

step1 on S1
step2 on S1
step1 on S2
step2 on S2


Basically, I want to complete S1, then S2. 
Is there a way to specify the order of executions in Snakemake?
I think you should use the priority directive to give precedence to downstream rule(s).

Here below I give higher priority to step2 so when the first sample has completed step1 snakemake will run step2 on that sample rather than submitting another sample to step1. 

SAMPLES = ['S1', 'S2', 'S3']

wildcard_constraints:
    sample= '|'.join([re.escape(x) for x in SAMPLES])

rule all:
    input: expand("{sample}.done", sample = SAMPLES)

rule step1:
    priority: 1
    output: "{sample}.step1.done"
    shell: 
        r"""
        sleep 5
        touch {output}
        """

rule step2:
    priority: 10
    input: "{sample}.step1.done"
    output: "{sample}.done"
    shell: 
        r"""
        sleep 5
        touch {output}
        """


(Note that without wildcard_constraints your/this code throws AmbiguousRuleException)