nextflow-io / nextflow

A DSL for data-driven computational pipelines
http://nextflow.io
Apache License 2.0
2.73k stars 624 forks source link

Specify accelerator in config #1617

Closed r0f1 closed 4 years ago

r0f1 commented 4 years ago

Hi, I'd like to move the accelerator specification from the process definition in my .nf file to the config file. Is that possible? I would like to write something like this in my nextflow.config file:

// nextflow.config
process {
    executor = 'google-lifesciences'
    container = '...'
    accelerator 1, type: 'nvidia-tesla-t4'
}
pditommaso commented 4 years ago

Hi,

You need to express it as Map, therefore

process {
    executor = 'google-lifesciences'
    container = '...'
    accelerator  = [request: 1, type: 'nvidia-tesla-t4']
}

Have a look at the code for details

https://github.com/nextflow-io/nextflow/blob/624c8e83bb110dce1a210f2c5a1c4c563e9e477f/modules/nextflow/src/main/groovy/nextflow/executor/res/AcceleratorResource.groovy#L31-L62

r0f1 commented 4 years ago

Thank you, perfect :)

xhejtman commented 1 year ago

It should be fixed in documentation then. https://www.nextflow.io/docs/latest/process.html#accelerator