Modifier and Type | Field and Description |
---|---|
protected static String |
CLUSTER_BATCH_COMMAND
Config String property: "cluster.batchCommand"Terminal command used to submit jobs on the cluster. |
protected static String |
CLUSTER_MODULES
Config List property: "cluster.modules"List of cluster modules to load at start of worker scripts. |
protected static List<String> |
CLUSTER_NUM_PROCESSORS
One parameter of the
Config String property "cluster.jobHeader" to set number of cores. |
protected static String |
CLUSTER_PROLOGUE
Config String property: "cluster.prologue"To run at the start of every script after loading cluster modules (if any) |
protected static String |
CLUSTER_VALIDATE_PARAMS
Config Boolean property: "cluster.validateParams"If set to "Y", validate "cluster.jobHeader" param cluster number of processors = "script.numThreads" or ScriptModule.SCRIPT_NUM_THREADS |
protected static String |
FUNCTION_EXECUTE
Worker script function to execute 1 line of a worker script.
|
protected static String |
FUNCTION_RUN_JOB
Main script function to submit jobs on the cluster
|
protected static String |
SCRIPT_JOB_HEADER
Config String property: "cluster.jobHeader"Header written at top of worker scripts |
Modifier and Type | Method and Description |
---|---|
protected static List<String> |
buildExecuteFunction(String script)
Create bash worker script function: "execute".
Failure details written to the failure script file if any occur. |
static void |
buildMainScript(ScriptModule module)
Build the MIAN script.
|
static void |
buildScripts(ScriptModule module,
List<List<String>> data)
This method builds the bash scripts required for the given module.
Standard local/cluster pipelines include: 1 MAIN script, 1+ worker-scripts. Docker R_Modules include: 1 MAIN scirpt, 0 worker-scripts - MAIN.R run by MAIN.sh Docker *non-R_Modules* include: 1 MAIN scirpt, 1+ worker-scripts - MAIN.sh runs workers AWS Docker R_Modules include: 0 MAIN scirpts, 0 worker-scripts - MAIN.R run by nextflow AWS Docker *non-R_Modules* include: 0 MAIN scirpts, 1+ worker-scripts MAIN.sh runs workers |
protected static File |
createScript(String scriptPath,
List<String> lines)
Create the script.
|
protected static String |
getMainScriptExecuteWorkerLine(ScriptModule module,
String workerScriptPath,
String workerId)
Call "execute" on the worker script
|
protected static List<String> |
getWorkerScriptLines(List<String> lines)
Pass each line and the current line number to "execute"
|
protected static String |
getWorkerScriptPath(ScriptModule module,
String workerId)
Build the file path for the numbered worker script.
|
protected static List<String> |
initMainScript(ScriptModule module)
Create the ScriptModule main script that calls all worker scripts.
|
protected static List<String> |
initWorkerScript(ScriptModule module,
String scriptPath)
Create the numbered worker scripts.
|
protected static void |
verifyConfig(ScriptModule module)
If property "pipeline.env" = cluster, require property "cluster.batchCommand",
otherwise exit this method.
|
protected static void |
writeScript(BufferedWriter writer,
List<String> lines)
This method formats the bash script to indent if statement code blocks
|
protected static final String CLUSTER_BATCH_COMMAND
Config
String property: "cluster.batchCommand"protected static final String CLUSTER_MODULES
Config
List property: "cluster.modules"protected static final List<String> CLUSTER_NUM_PROCESSORS
Config
String property "cluster.jobHeader" to set number of cores.protected static final String CLUSTER_PROLOGUE
Config
String property: "cluster.prologue"protected static final String CLUSTER_VALIDATE_PARAMS
Config
Boolean property: "cluster.validateParams"ScriptModule.SCRIPT_NUM_THREADS
protected static final String FUNCTION_EXECUTE
protected static final String FUNCTION_RUN_JOB
protected static final String SCRIPT_JOB_HEADER
Config
String property: "cluster.jobHeader"public static void buildMainScript(ScriptModule module) throws Exception
module
- ScriptModuleException
- if any error occurspublic static void buildScripts(ScriptModule module, List<List<String>> data) throws Exception
module
- ScriptModuledata
- Bash script linesException
- if any error occursprotected static List<String> buildExecuteFunction(String script)
script
- Execute scriptprotected static File createScript(String scriptPath, List<String> lines) throws Exception
scriptPath
- Worker script pathlines
- Ordered bash script lines to write to the scriptPathException
- if I/O errors occurprotected static String getMainScriptExecuteWorkerLine(ScriptModule module, String workerScriptPath, String workerId)
module
- ScriptModuleworkerScriptPath
- Worker script pathworkerId
- Worker script IDprotected static List<String> getWorkerScriptLines(List<String> lines)
lines
- Basic script lines generated by a BioModule.protected static String getWorkerScriptPath(ScriptModule module, String workerId) throws Exception
module
- ScriptModule is the module that owns the scriptsworkerId
- Worker IDException
- if I/O errors occurprotected static List<String> initMainScript(ScriptModule module) throws Exception
module
- ScriptModule script directory is where main script is writtenException
- if error occurs writing the fileprotected static List<String> initWorkerScript(ScriptModule module, String scriptPath) throws Exception
module
- ScriptModule script directory is where main script is writtenscriptPath
- Worker script absolute file pathException
- if required properties are undefinedprotected static void verifyConfig(ScriptModule module) throws Exception
If running on the cluster and property "cluster.validateParams" = "Y":
ScriptModule.SCRIPT_NUM_THREADS
or
Current format #1 (2018) for UNCC HPC Cluster: #PBS -l procs=1,mem=8GB,walltime=8:00:00
Current format #2 (2018) for UNCC HPC Cluster: #PBS -l ppn=1,mem=8GB,walltime=8:00:00
module
- ScriptModuelException
- if any validation failsprotected static void writeScript(BufferedWriter writer, List<String> lines) throws Exception
writer
- BufferedWriter writes to the filelines
- List or shell script linesException
- if I/O errors occur