-
Notifications
You must be signed in to change notification settings - Fork 646
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
77 changed files
with
722 additions
and
470 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,7 +29,7 @@ import groovyx.gpars.group.NonDaemonPGroup | |
import groovyx.gpars.group.PGroup | ||
import groovyx.gpars.util.PoolUtils | ||
import jsr166y.Phaser | ||
import nextflow.processor.TaskScheduler | ||
import nextflow.processor.TaskDispatcher | ||
/** | ||
* | ||
* @author Paolo Di Tommaso <[email protected]> | ||
|
@@ -43,9 +43,9 @@ class Session { | |
final List<DataflowProcessor> allProcessors = [] | ||
|
||
/** | ||
* The scheduler monitoring the tasks execution | ||
* Dispatch tasks for executions | ||
*/ | ||
final TaskScheduler scheduler | ||
final TaskDispatcher dispatcher | ||
|
||
/** | ||
* Holds the configuration object | ||
|
@@ -143,7 +143,7 @@ class Session { | |
pgroup = new NonDaemonPGroup( config.poolSize as int ) | ||
Dataflow.activeParallelGroup.set(pgroup) | ||
|
||
scheduler = new TaskScheduler(this) | ||
dispatcher = new TaskDispatcher(this) | ||
|
||
log.debug ">>> phaser register (session)" | ||
phaser.register() | ||
|
@@ -152,10 +152,6 @@ class Session { | |
@PackageScope | ||
def getPhaser() { phaser } | ||
|
||
def void start() { | ||
scheduler.start() | ||
} | ||
|
||
/** | ||
* Await the termination of all processors | ||
*/ | ||
|
@@ -196,6 +192,57 @@ class Session { | |
} | ||
|
||
|
||
public int getQueueSize( String execName, int defValue ) { | ||
// creating the running tasks queue | ||
def size = null | ||
|
||
// make sure that the *executor* is a map object | ||
// it could also be a plain string (when it specifies just the its name) | ||
if( config.executor instanceof Map ){ | ||
if( execName ) { | ||
size = config.executor?."$execName"?.queueSize | ||
} | ||
|
||
if( !size && config.executor?.queueSize ) { | ||
size = config.executor?.queueSize | ||
} | ||
} | ||
|
||
|
||
if( !size ) { | ||
size = defValue | ||
log.debug "Undefined executor queueSize property runnable queue size -- fallback default value: $size" | ||
} | ||
|
||
return size | ||
} | ||
|
||
public long getPollInterval( String execName, long defValue = 1_000 ) { | ||
// creating the running tasks queue | ||
def result = null | ||
|
||
// make sure that the *executor* is a map object | ||
// it could also be a plain string (when it specifies just the its name) | ||
if( config.executor instanceof Map ){ | ||
if( execName ) { | ||
result = config.executor?."$execName"?.pollInterval | ||
} | ||
|
||
if( !result && config.executor?.pollInterval ) { | ||
result = config.executor?.pollInterval | ||
} | ||
} | ||
|
||
|
||
if( !result ) { | ||
result = defValue | ||
log.debug "Undefined executor queueSize property runnable queue size -- fallback on num of available processors-1: $result" | ||
} | ||
|
||
return result | ||
} | ||
|
||
|
||
// /** | ||
// * Create a table report of all executed or running tasks | ||
// * | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.