Search in sources :

Example 1 with TaskPool

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);
}
Also used : TaskPool(dr.util.TaskPool) GradientWrtParameterProvider(dr.inference.hmc.GradientWrtParameterProvider) Tree(dr.evolution.tree.Tree)

Aggregations

Tree (dr.evolution.tree.Tree)1 GradientWrtParameterProvider (dr.inference.hmc.GradientWrtParameterProvider)1 TaskPool (dr.util.TaskPool)1