use of dr.util.TaskPool in project beast-mcmc by beast-dev.
the class TaskPoolParser method parseXMLObject.
@Override
public Object parseXMLObject(XMLObject xo) throws XMLParseException {
Tree tree = (Tree) xo.getChild(Tree.class);
GradientWrtParameterProvider gradient = (GradientWrtParameterProvider) xo.getChild(GradientWrtParameterProvider.class);
int taskCount = (tree != null) ? tree.getExternalNodeCount() : gradient.getDimension();
int threadCount = xo.getAttribute(THREAD_COUNT, 1);
return new TaskPool(taskCount, threadCount);
}
Aggregations