# Workflow fails when run without --cachedir

**URL:** <https://cwl.discourse.group/t/workflow-fails-when-run-without-cachedir/942>\
**Category:** CWL Questions\
**Created:** [August 12, 2024, 4:52pm UTC](https://cwl.discourse.group/t/workflow-fails-when-run-without-cachedir/942 "2024-08-12T16:52:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Brilator](https://yyz2.discourse-cdn.com/free1/user_avatar/cwl.discourse.group/brilator/32/565_2.png) [@Brilator](https://cwl.discourse.group/u/Brilator)\
**Post date:** [August 12, 2024, 4:52pm UTC](https://cwl.discourse.group/t/workflow-fails-when-run-without-cachedir/942/1 "2024-08-12T16:52:35Z")

</div>

Hi,

can someone help me understand allocating resources to workflows?

I’m trying to run a rather simple workflow, scattered over an array of inputs (i.e. samples). Per sample the workflow creates ca. 10GB temporary data, which I would not want to pile up for 100 samples. The workflow works fine with the `--cachedir` option. However, it fails in a simple concatenate step due to missing disk space (`cat: write error: No space left on device`).  
Adding `ResourceRequirement: tmpdirMin: 1000000` did not help.

Also, I was wondering about the “ResourceRequirement” overall.  
I would expect a CommandLineTool to fail, if no space is “allowed”.

```auto
class: CommandLineTool
cwlVersion: v1.2
requirements:
  ResourceRequirement:
    tmpdirMin: 0
    tmpdirMax: 0
    outdirMax: 0
    outdirMin: 0
baseCommand: cat
inputs:
    - id: files
      type: File[]
      inputBinding:
        position: 1
outputs:
  concatenatedFasta:
    type: File
    streamable: true
    outputBinding:
      glob: cat.out
stdout: cat.out

```

Thanks!

---

<div class="post-metadata">

**Author:** ![mrc](https://yyz2.discourse-cdn.com/free1/user_avatar/cwl.discourse.group/mrc/32/3_2.png) [@mrc](https://cwl.discourse.group/u/mrc)\
**Post date:** [August 13, 2024, 9:10am UTC](https://cwl.discourse.group/t/workflow-fails-when-run-without-cachedir/942/2 "2024-08-13T09:10:51Z")

</div>

Hello!

> [@Brilator](#):
>
> The workflow works fine with the `--cachedir` option. However, it fails in a simple concatenate step due to missing disk space (`cat: write error: No space left on device`).

`cwltool --cachedir` currently keeps all intermediates files, even those that aren’t `glob`ed up into other outputs.

You can use the CWL v1.1+ hint `WorkReuse` and set `enableReuse: false` ; then cwltool will not cache that `CommandLineTool`.

[https://www.commonwl.org/v1.1/CommandLineTool.html#WorkReuse](https://www.commonwl.org/v1.1/CommandLineTool.html#WorkReuse)

> [@Brilator](#):
>
> Adding `ResourceRequirement: tmpdirMin: 1000000` did not help.
> 
> Also, I was wondering about the “ResourceRequirement” overall.  
> I would expect a CommandLineTool to fail, if no space is “allowed”.

I think `cwltool` ignores resource requirements unless you are running in `--parallel` mode; and even then I think that `cwltool` ignore the disk space reqs.

---

<div class="post-metadata">

**Author:** ![Brilator](https://yyz2.discourse-cdn.com/free1/user_avatar/cwl.discourse.group/brilator/32/565_2.png) [@Brilator](https://cwl.discourse.group/u/Brilator)\
**Post date:** [August 13, 2024, 11:39am UTC](https://cwl.discourse.group/t/workflow-fails-when-run-without-cachedir/942/3 "2024-08-13T11:39:32Z")

</div>

Thanks! Right, it might be outputs not being globed.
