Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add dynamic resource (disk size) allocation based on input file size #51

Open
cgpu opened this issue May 25, 2021 · 0 comments
Open

Add dynamic resource (disk size) allocation based on input file size #51

cgpu opened this issue May 25, 2021 · 0 comments
Assignees

Comments

@cgpu
Copy link
Collaborator

cgpu commented May 25, 2021

#!/usr/bin/env nextflow 

Channel
     .fromPath('hello.txt')
     .map { [it, it.size()] }
     .set { input_ch }

process foo {
  disk { $x.size() < 600.GB ? 400.GB : 700.GB }
  input:
  set file(x), val(sz) from input_ch
  """
  you_command --input $x
  """
}

In human words:

disk { $x.size() < 600.GB ? 400.GB : 700.GB }
"Is the input file size < 600GB?|

  • If true, allocate disk of size 400.GB in the task
  • If false, allocate disk of size 700.GB in the task
@cgpu cgpu self-assigned this May 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant