Skip to content

Commit

Permalink
add max cores function for local runs
Browse files Browse the repository at this point in the history
  • Loading branch information
hoelzer committed Sep 11, 2020
1 parent 3a30170 commit 8a1476e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
2 changes: 0 additions & 2 deletions configs/local.config
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
process.executor = 'local'

process {
withLabel: altair { cpus = 1 }
withLabel: chromomap { cpus = params.cores }
Expand Down
5 changes: 5 additions & 0 deletions nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ manifest {

params {
// default parameters
max_cores = Runtime.runtime.availableProcessors()
cores = "8"
mem = "12"
help = false
Expand Down Expand Up @@ -73,6 +74,10 @@ profiles {

//executer
local {
executor {
name = "local"
cpus = params.max_cores
}
workDir = params.workdir
params.cloudProcess = false
includeConfig 'configs/local.config'
Expand Down
7 changes: 4 additions & 3 deletions phage.nf
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ println " Manually remove faulty images in $params.cachedir for a rebuild\u001B
if (params.annotate) { println "\u001B[33mSkipping phage identification for fasta files\u001B[0m" }
if (params.identify) { println "\u001B[33mSkipping phage annotation\u001B[0m" }
println " "
println "\033[2mCPUs to use: $params.cores\033[0m"
println "\033[2mCPUs to use: $params.cores, maximal CPUs to use: $params.max_cores\033[0m"
println " "

/*************
Expand Down Expand Up @@ -740,7 +740,7 @@ def helpMSG() {
log.info """
.
${c_yellow}Usage examples:${c_reset}
nextflow run replikation/What_the_Phage --fasta '*/*.fasta' --cores 20 \\
nextflow run replikation/What_the_Phage --fasta '*/*.fasta' --cores 20 --max_cores 40 \\
--output results -profile local,docker
nextflow run phage.nf --fasta '*/*.fasta' --cores 20 \\
Expand Down Expand Up @@ -773,7 +773,8 @@ def helpMSG() {
${c_yellow}Options:${c_reset}
--filter min contig size [bp] to analyse [default: $params.filter]
--cores max cores for local use [default: $params.cores]
--cores max cores per process for local use [default: $params.cores]
--max_cores max cores used on the machine for local use [default: $params.max_cores]
--output name of the result folder [default: $params.output]
${c_yellow}Tool control:${c_reset}
Expand Down

0 comments on commit 8a1476e

Please sign in to comment.