T
- input-object typeS
- shared-state typepublic class ParallelProcessor<T extends InputFromManager,S> extends JobProcessor<T,S>
Each input is processed in a separate thread on an available core.
Constructor and Description |
---|
ParallelProcessor() |
Modifier and Type | Method and Description |
---|---|
protected TaskStatistics |
execute(Outputter rootOutputter,
List<T> inputs,
ParametersExperiment parametersExperiment)
Executes the task on all
inputs . |
int |
getKeepProcessorsFree()
How many processors to avoid using for the tasks.
|
int |
getMaxNumberProcessors()
Theoretical maximum number of (CPU) processors to use in parallel.
|
int |
getNumberGPUProcessors()
How many GPU processors to use when this is possible as a substitute for a CPU processor
|
int |
getShowOngoingJobsLessThan()
When the number of ongoing jobs is less than this threshold, they are shown in event logs.
|
void |
setKeepProcessorsFree(int keepProcessorsFree)
How many processors to avoid using for the tasks.
|
void |
setMaxNumberProcessors(int maxNumberProcessors)
Theoretical maximum number of (CPU) processors to use in parallel.
|
void |
setNumberGPUProcessors(int numberGPUProcessors)
How many GPU processors to use when this is possible as a substitute for a CPU processor
|
void |
setShowOngoingJobsLessThan(int showOngoingJobsLessThan)
When the number of ongoing jobs is less than this threshold, they are shown in event logs.
|
executeLogStatistics, getTask, hasVeryQuickPerInputExecution, isInputCompatibleWith, isSuppressExceptions, replaceTask, setSuppressExceptions, setTask
checkMisconfigured, describeBean, describeChildren, duplicateBean, fields, findFieldsOfClass, getBeanName, getLocalPath, localise, toString
protected TaskStatistics execute(Outputter rootOutputter, List<T> inputs, ParametersExperiment parametersExperiment) throws ExperimentExecutionException
JobProcessor
inputs
.
It is expected that elements are removed from inputs
as they are consumed so as to
allow garbage-collection of these items before all jobs are processed (as the list might be
quite large).
execute
in class JobProcessor<T extends InputFromManager,S>
rootOutputter
- an outputter, bound to the base (root) output directory into which
outputted files are written.inputs
- the inputs to apply task
on.parametersExperiment
- parameters that exist pertaining to the experiment that is
underway.ExperimentExecutionException
- if anything goes wrong executing the experiment (but not
necessarily if a processing a particular input fails when suppressExceptions ==
true
.public int getMaxNumberProcessors()
In practice, the effective maximum is min(maxNumberProcessors,numberAvailableProcessors)
, usually lower.
public void setMaxNumberProcessors(int maxNumberProcessors)
In practice, the effective maximum is min(maxNumberProcessors,numberAvailableProcessors)
, usually lower.
public int getShowOngoingJobsLessThan()
public void setShowOngoingJobsLessThan(int showOngoingJobsLessThan)
public int getKeepProcessorsFree()
When using the maximum available number of processors, a certain amount are deliberately not used, to save them for other tasks on the operating system. This is particularly valuable on a desktop PC where other tasks (e.g web browsing) may be ongoing during processing.
public void setKeepProcessorsFree(int keepProcessorsFree)
When using the maximum available number of processors, a certain amount are deliberately not used, to save them for other tasks on the operating system. This is particularly valuable on a desktop PC where other tasks (e.g web browsing) may be ongoing during processing.
public int getNumberGPUProcessors()
public void setNumberGPUProcessors(int numberGPUProcessors)
Copyright © 2010–2023 Owen Feehan, ETH Zurich, University of Zurich, Hoffmann-La Roche. All rights reserved.