<p>Cromwell already defines the <code>cwd</code>, <code>err</code> and <code>out</code> runtime attributes by itself (it also defines a <code>job_name</code> and <code>script</code>). So when you define these variables in your config it causes a name conflict, since they already exist.</p>
<p>Cromwell will make a directory inside of the &quot;cromwell-executions&quot; directory (created when you run cromwell) for each job it runs. It will write the script, various stdout and stderr files,  and the rc file to this directory. The intend is also for the job to run in that directory. Hence cromwell provides these runtime attributes to point to the appropriate locations within this directory so they can be used in your custom submission command.</p>
<p>You can try just removing these variables in the runtime-attributes section, while keeping them in the submit section.</p>

CC BY-SA 4.0
2022-05-04T18:58:28.600Z
Thank you for your explanation, your solution works. The only issue that I am having is when I run Cromwell with the command above, Cromwell still seems to be running. If I do a CTRL + C, it stops Cromwell and quits the slurm job. Is there a way to simply dispatch the job to slurm and have Cromwell return/exit? Or perhaps have Cromwell run in the background?
Logios James
CC BY-SA 4.0
2022-05-05T09:57:59.500Z
@LogiosJames Cromwell is designed to run multiple consecutive jobs which rely on each other's outputs. So, it needs to keep running in order to check up on the status of the jobs it has dispatched and then submit the next jobs when their inputs have become available. You could just submit the cromwell process to the cluster in the traditional way, though, and have it run on an execution node (eg. `sbatch [...] --wrap cromwell run worklow.wdl`). Or use something like byobu/tmux and run cromwell in one window and do your other work in another.
DavyCats
CC BY-SA 4.0
2022-05-05T19:50:27.600Z
Ok, good to note. I normally access and work with Cromwell on my cluster via an ssh connection, if I am running my workflow as I described above and my ssh connection to my cluster closes, would Cromwell continue executing, or would it exit/stop upon the connection closing?
Logios James
CC BY-SA 4.0
2022-05-06T07:24:15.397Z
@LogiosJames If you just run cromwell directly in your ssh session it will stop when you disconnect. If you submit cromwell to an execution node, it will keep running on that node. If you open a tmux or byobu session, those sessions will stay alive when you disconnect and you can reconnect with those sessions later using `tmux attach-session -t 0` or `byobu` respectively.
DavyCats
CC BY-SA 4.0
2022-05-03T09:38:33.527Z
2022-05-03T09:38:33.527Z
DavyCats
<p>I have a cluster that is set up with slurm and I seek to use Cromwell to dispatch jobs to the slurm scheduler. I followed the description explained on <a href="https://cromwell.readthedocs.io/en/stable/backends/SLURM/" rel="nofollow noreferrer">Cromwells Documentation Website</a>. And created a configuration file called <code>cromwellconfig.conf</code>, however when I run it using the command <code>java -Dconfig.file=/lccs/home/logio9/Configure_Cromwell/cromwellconfig.conf \ -jar cromwell-77.jar run test-workflow.wdl</code> I get an error parsing the config file. I am confused as to where the error is, bellow is the contents of the configuration file:</p>
<pre><code>include required(classpath(&quot;application&quot;))

backend {
  default = SLURM
  providers {
    SLURM {
      actor-factory = &quot;cromwell.backend.impl.sfs.config.ConfigBackendLifecycleActorFactory&quot;
      config {
        runtime-attributes = &quot;&quot;&quot;
        Int runtime_minutes = 600
        Int cpus = 2
        Int requested_memory_mb_per_core = 8000
        String queue = &quot;short&quot;
        String jobname = &quot;testwork&quot;
        String cwd = &quot;/lccs/home/logio9/Configure_Cromwell&quot;
        String err = &quot;errors.output&quot;
        String out = &quot;ouput.out&quot;
        &quot;&quot;&quot;
        
      
        submit = &quot;&quot;&quot;
            sbatch -J <span class="math-container">${jobname} -D $</span>{cwd} -o <span class="math-container">${out} -e $</span>{err} -t <span class="math-container">${runtime_minutes} -p $</span>{queue} \
            <span class="math-container">${"-c " + cpus} \
        --mem-per-cpu $</span>{requested_memory_mb_per_core} \
            --wrap &quot;/bin/bash <span class="math-container">${script}"
    """  
    kill = "scancel $</span>{job_id}&quot;
        check-alive = &quot;squeue -j ${job_id}&quot;
        job-id-regex = &quot;Submitted batch job (\\d+).*&quot;
      }
    }
  }
}
  
</code></pre>
<p>This is the test wdl script I made, it copies a very large directory into another directory.</p>
<pre><code>version 1.0

workflow Greetings {
    call SayHello {
    }
}

task SayHello {
    command &lt;&lt;&lt;
        cp -R /lccs/home/logio9/Configure_Cromwell/tf1 /lccs/home/logio9/Configure_Cromwell/tf2

    &gt;&gt;&gt;
    output {
        Array[String] out = read_lines(stdout())
    }
}
</code></pre>
<p>If anyone has had experience with this, please do share a bit on how exactly this configuration works.</p>

CC BY-SA 4.0
2022-05-01T18:31:30.710Z
Could you provide what is exactly the error that you are getting?
user324810
CC BY-SA 4.0
2022-05-02T01:07:10.660Z
It says: java.lang.RuntimeException: Error parsing generated wdl: and 

Caused by: wdl.draft2.parser.WdlParser$SyntaxError: ERROR: Sibling nodes have conflicting names:

Declaration defined here (line 5, col 1):

String cwd
^
Logios James
<wdl>
How to configure Cromwell to work with slurm?
# How to configure Cromwell to work with slurm?

(Asked by: username_0 on 2022-05-01)

I have a cluster that is set up with slurm and I seek to use Cromwell to dispatch jobs to the slurm scheduler. I followed the description explained on Cromwells Documentation Website. And created a configuration file called cromwellconfig.conf, however when I run it using the command java -Dconfig.file=/lccs/home/logio9/Configure_Cromwell/cromwellconfig.conf \ -jar cromwell-77.jar run test-workflow.wdl I get an error parsing the config file. I am confused as to where the error is, bellow is the contents of the configuration file:
include required(classpath("application"))

backend {
  default = SLURM
  providers {
    SLURM {
      actor-factory = "cromwell.backend.impl.sfs.config.ConfigBackendLifecycleActorFactory"
      config {
        runtime-attributes = """
        Int runtime_minutes = 600
        Int cpus = 2
        Int requested_memory_mb_per_core = 8000
        String queue = "short"
        String jobname = "testwork"
        String cwd = "/lccs/home/logio9/Configure_Cromwell"
        String err = "errors.output"
        String out = "ouput.out"
        """
        
      
        submit = """
            sbatch -J ${jobname} -D ${cwd} -o ${out} -e ${err} -t ${runtime_minutes} -p ${queue} \
            ${"-c " + cpus} \
        --mem-per-cpu ${requested_memory_mb_per_core} \
            --wrap "/bin/bash ${script}"
    """  
    kill = "scancel ${job_id}"
        check-alive = "squeue -j ${job_id}"
        job-id-regex = "Submitted batch job (\\d+).*"
      }
    }
  }
}
  

This is the test wdl script I made, it copies a very large directory into another directory.
version 1.0

workflow Greetings {
    call SayHello {
    }
}

task SayHello {
    command <<<
        cp -R /lccs/home/logio9/Configure_Cromwell/tf1 /lccs/home/logio9/Configure_Cromwell/tf2

    >>>
    output {
        Array[String] out = read_lines(stdout())
    }
}

If anyone has had experience with this, please do share a bit on how exactly this configuration works.

**Tags:** wdl
> **Comments:**
> **username_1**: Could you provide what is exactly the error that you are getting?  
> **username_0**: It says: java.lang.RuntimeException: Error parsing generated wdl: and   Caused by: wdl.draft2.parser.WdlParser$SyntaxError: ERROR: Sibling nodes have conflicting names:  Declaration defined here (line 5, col 1):  String cwd ^  

---

## 1 answers

### Answer by username_2 on 2022-05-03. Score: 1 | Accepted answer

Cromwell already defines the `cwd`, `err` and `out` runtime attributes by itself (it also defines a `job_name` and `script`). So when you define these variables in your config it causes a name conflict, since they already exist.

Cromwell will make a directory inside of the "cromwell-executions" directory (created when you run cromwell) for each job it runs. It will write the script, various stdout and stderr files, and the rc file to this directory. The intend is also for the job to run in that directory. Hence cromwell provides these runtime attributes to point to the appropriate locations within this directory so they can be used in your custom submission command.

You can try just removing these variables in the runtime-attributes section, while keeping them in the submit section.

> **Comments:**
> **username_0**: Thank you for your explanation, your solution works. The only issue that I am having is when I run Cromwell with the command above, Cromwell still seems to be running. If I do a CTRL + C, it stops Cromwell and quits the slurm job. Is there a way to simply dispatch the job to slurm and have Cromwell return/exit? Or perhaps have Cromwell run in the background?  
> **username_2**: @LogiosJames Cromwell is designed to run multiple consecutive jobs which rely on each other's outputs. So, it needs to keep running in order to check up on the status of the jobs it has dispatched and then submit the next jobs when their inputs have become available. You could just submit the cromwell process to the cluster in the traditional way, though, and have it run on an execution node (eg. `sbatch [...] --wrap cromwell run worklow.wdl`). Or use something like byobu/tmux and run cromwell in one window and do your other work in another.  
> **username_0**: Ok, good to note. I normally access and work with Cromwell on my cluster via an ssh connection, if I am running my workflow as I described above and my ssh connection to my cluster closes, would Cromwell continue executing, or would it exit/stop upon the connection closing?  
> **username_2**: @LogiosJames If you just run cromwell directly in your ssh session it will stop when you disconnect. If you submit cromwell to an execution node, it will keep running on that node. If you open a tmux or byobu session, those sessions will stay alive when you disconnect and you can reconnect with those sessions later using `tmux attach-session -t 0` or `byobu` respectively.  

---

