Skip to content

Commit fb8fac5

Browse files
committed
setting option for nextflow automatically handle parallel jobs
1 parent c3c408b commit fb8fac5

5 files changed

Lines changed: 44 additions & 25 deletions

File tree

configuration_template/bacannot.config

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,10 @@ params {
7676

7777
// Number of jobs to run in parallel. Be aware that each job (in parallel) can consume
7878
// N threads (set above). Be sure to carefully check your resources before augmenting
79-
// this parameter. For example: parallel_jobs = 2 + threads = 5 can consume up until 10
79+
// this parameter. For example: parallel_jobs = 2 + threads = 5 can consume until 10
8080
// threads at once.
81-
parallel_jobs = 1
81+
// If not given, let's nextflow automatically handle it.
82+
parallel_jobs =
8283

8384
// Number of minimum overlapping base pairs required for merging
8485
// Negative values, such as -20, means the number of required overlapping bases for merging.
@@ -212,11 +213,23 @@ report {
212213
profiles {
213214
standard {
214215
// Executor
215-
process.executor = 'local'
216+
process.executor = "local"
216217
// QueueSize limit
217-
qs = (params.parallel_jobs) ? params.parallel_jobs : 1
218+
if (params.parallel_jobs || params.parallel_jobs != '') {
219+
qs = params.parallel_jobs
220+
}
218221
executor {
219-
name = 'local'
220-
queueSize = qs
222+
name = "local"
223+
if (params.parallel_jobs || params.parallel_jobs != '') {
224+
queueSize = qs
225+
}
221226
}
222227
}
228+
229+
awsbatch {
230+
process.executor = 'awsbatch'
231+
process.queue = 'my-batch-queue'
232+
// cpu allocation
233+
process.cpus = params.threads
234+
}
235+
}

docs/config.rst

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,10 @@ Default configuration:
8989
9090
// Number of jobs to run in parallel. Be aware that each job (in parallel) can consume
9191
// N threads (set above). Be sure to carefully check your resources before augmenting
92-
// this parameter. For example: parallel_jobs = 2 + threads = 5 can consume up until 10
92+
// this parameter. For example: parallel_jobs = 2 + threads = 5 can consume until 10
9393
// threads at once.
94-
parallel_jobs = 1
94+
// If not given, let's nextflow automatically handle it.
95+
parallel_jobs =
9596
9697
// Number of minimum overlapping base pairs required for merging
9798
// Negative values, such as -20, means the number of required overlapping bases for merging.
@@ -225,14 +226,16 @@ Default configuration:
225226
profiles {
226227
standard {
227228
// Executor
228-
process.executor = 'local'
229+
process.executor = "local"
229230
// QueueSize limit
230-
qs = (params.parallel_jobs) ? params.parallel_jobs : 1
231+
if (params.parallel_jobs || params.parallel_jobs != '') {
232+
qs = params.parallel_jobs
233+
}
231234
executor {
232-
name = 'local'
233-
queueSize = qs
235+
name = "local"
236+
if (params.parallel_jobs || params.parallel_jobs != '') {
237+
queueSize = qs
238+
}
234239
}
235-
// cpu allocation
236-
process.cpus = params.threads
237240
}
238241
}

nextflow.config

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,10 @@ params {
7676

7777
// Number of jobs to run in parallel. Be aware that each job (in parallel) can consume
7878
// N threads (set above). Be sure to carefully check your resources before augmenting
79-
// this parameter. For example: parallel_jobs = 2 + threads = 5 can consume up until 10
79+
// this parameter. For example: parallel_jobs = 2 + threads = 5 can consume until 10
8080
// threads at once.
81-
parallel_jobs = 1
81+
// If not given, let's nextflow automatically handle it.
82+
parallel_jobs =
8283

8384
// Number of minimum overlapping base pairs required for merging
8485
// Negative values, such as -20, means the number of required overlapping bases for merging.
@@ -212,15 +213,17 @@ report {
212213
profiles {
213214
standard {
214215
// Executor
215-
process.executor = 'local'
216+
process.executor = "local"
216217
// QueueSize limit
217-
qs = (params.parallel_jobs) ? params.parallel_jobs : 1
218+
if (params.parallel_jobs || params.parallel_jobs != '') {
219+
qs = params.parallel_jobs
220+
}
218221
executor {
219-
name = 'local'
220-
queueSize = qs
222+
name = "local"
223+
if (params.parallel_jobs || params.parallel_jobs != '') {
224+
queueSize = qs
225+
}
221226
}
222-
// cpu allocation
223-
process.cpus = params.threads
224227
}
225228

226229
awsbatch {

nextflow_schema.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,8 @@
116116
},
117117
"parallel_jobs": {
118118
"type": "integer",
119-
"default": 1,
120119
"description": "Number of jobs to run in parallel",
121-
"help_text": "Number of jobs to run in parallel. Be aware that each job (in parallel) can consume\nN threads (set above). Be sure to carefully check your resources before augmenting\nthis parameter. For example: parallel_jobs = 2 + threads = 5 can consume until 10\nthreads at once."
120+
"help_text": "Number of jobs to run in parallel. Be aware that each job (in parallel) can consume\nN threads (set above). Be sure to carefully check your resources before augmenting\nthis parameter. For example: parallel_jobs = 2 + threads = 5 can consume until 10\nthreads at once.\nIf not given, let's nextflow automatically handle it"
122121
}
123122
}
124123
},

nf_functions/help.nf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ def helpMessage() {
6464
--threads <int> Number of threads to use
6565
6666
--parallel_jobs <int> Number of jobs to run in parallel. Each job can consume up
67-
to N threads (--threads). Default: 1.
67+
to N threads (--threads). If not given, let's nextflow automatically
68+
handle it. Default: NA.
6869
6970
--bedtools_merge_distance <int> By default, this process is not executed. For execution
7071
one needs to provide a minimum number of overlapping

0 commit comments

Comments
 (0)