Is there a way to set a directive like the acceler...
# nostupidquestions
f
Is there a way to set a directive like the accelerator based on the computing environment? I my case I want to add the directive to a specific task if its run on AWS and not add it in any other case.
m
profiles?
f
yes thats what I thought - so you would not add it to the pipeline config at all?
m
To me that is part of the pipeline config. Do you mean as dynamic directive in a module?
Can check if
task.executor
returns something in that case
f
no as a dynamic directive in the pipeline config
specifically I want to add
Copy code
withName: 'PARABRICKS_FQ2BAM' {
        accelerator = 4
    }
to the base.config but only when running on AWS.
m
I probably would add it there if the dynamic directive worked
f
according to this https://www.nextflow.io/docs/latest/executor.html maybe something like this?
Copy code
withName: 'PARABRICKS_FQ2BAM' {
        process.executor == 'awsbatch' ? accelerator = 4 : ''
    }
m
Copy code
withName: 'PARABRICKS_FQ2BAM' {
        accelerator = { task.executor in ['awsbatch'] ? 4 : null }
    }
👍 1
f
I'll try that - thank you!