Skip to content

Dynamic task resources docs => input directory size #6232

Closed
@nick-youngblut

Description

@nick-youngblut

New feature

The Dynamics task resources states:

Task resources can also be defined in terms of task inputs. For example:

process hello {
    memory { 8.GB + 1.GB * Math.ceil(input_file.size() / 1024 ** 3) }

    input:
    path input_file

    script:
    """
    your_command --here
    """
}

In this example, each task requests 8 GB of memory, plus the size of the input file rounded up to the next GB. This way, each task requests only as much memory as it needs based on the size of the inputs. The specific function that you use should be tuned for each process

However, the case of input directories is not covered. As far as I can tell, one cannot simply using input_dir.size() to get the total size of all files in the input directory. input_dir.listFiles().sum{ it.size() } also does not work.

If there is no way to get the total size of an input directory, then this limitation should be explicitly stated, given that the current docs state "Task resources can also be defined in terms of task inputs.", and not "task input files".

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions