Skip to content

Commit 0d9350d

Browse files
committed
fix null gpuSlots in LocalTaskHandler
gpuSlots for the LocalTaskHandler need to be set before calling `submit()` Signed-off-by: Alan J Correa <ajcorrea.1996@gmail.com>
1 parent 4f7b7ab commit 0d9350d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

modules/nextflow/src/main/groovy/nextflow/processor/LocalPollingMonitor.groovy

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,10 +225,13 @@ class LocalPollingMonitor extends TaskPollingMonitor {
225225
*/
226226
@Override
227227
protected void submit(TaskHandler handler) {
228+
final taskGpus = gpus(handler)
229+
if ( taskGpus > 0 ) {
230+
((LocalTaskHandler) handler).gpuSlots = availGpus.acquire(taskGpus)
231+
}
228232
super.submit(handler)
229233
availCpus -= cpus(handler)
230234
availMemory -= mem(handler)
231-
((LocalTaskHandler) handler).gpuSlots = availGpus.acquire(gpus(handler))
232235
}
233236

234237
/**

0 commit comments

Comments
 (0)