From 824a63532cbbbde35b21d0994d03723148d8f570 Mon Sep 17 00:00:00 2001 From: yucais Date: Wed, 6 Nov 2024 16:41:37 -0800 Subject: [PATCH] remap indexes for GenericBastaLikelihoodDelegate; dynamically allocate memories for beast/beagle implementation --- src/beagle/basta/BastaJNIImpl.java | 14 +- src/beagle/basta/BastaJNIWrapper.java | 4 +- src/beagle/basta/BeagleBasta.java | 2 + .../basta/BastaInternalStorage.java | 7 +- .../coalescent/basta/BastaLikelihood.java | 7 +- .../basta/BastaLikelihoodDelegate.java | 27 +++- .../basta/BeagleBastaLikelihoodDelegate.java | 137 ++++++++++++++++-- .../basta/GenericBastaLikelihoodDelegate.java | 43 +++++- .../ProcessOnCoalescentIntervalDelegate.java | 44 +++++- 9 files changed, 251 insertions(+), 34 deletions(-) mode change 100644 => 100755 src/beagle/basta/BastaJNIImpl.java mode change 100644 => 100755 src/beagle/basta/BastaJNIWrapper.java mode change 100644 => 100755 src/beagle/basta/BeagleBasta.java mode change 100755 => 100644 src/dr/evomodel/coalescent/basta/BeagleBastaLikelihoodDelegate.java mode change 100755 => 100644 src/dr/evomodel/coalescent/basta/GenericBastaLikelihoodDelegate.java diff --git a/src/beagle/basta/BastaJNIImpl.java b/src/beagle/basta/BastaJNIImpl.java old mode 100644 new mode 100755 index 117b132e73..bc5315c143 --- a/src/beagle/basta/BastaJNIImpl.java +++ b/src/beagle/basta/BastaJNIImpl.java @@ -22,10 +22,15 @@ public BastaJNIImpl(int tipCount, super(tipCount, partialsBufferCount, compactBufferCount, stateCount, patternCount, eigenBufferCount, matrixBufferCount, categoryCount, scaleBufferCount, resourceList, preferenceFlags, requirementFlags); + allocateCoalescentBuffers(coalescentBufferCount, maxCoalescentIntervalCount, partialsBufferCount,1); + } + + @Override + public void allocateCoalescentBuffers(int coalescentBufferCount, int maxCoalescentIntervalCount, int partialsBufferCount, int initial) { int errCode = BastaJNIWrapper.INSTANCE.allocateCoalescentBuffers(instance, coalescentBufferCount, - maxCoalescentIntervalCount); + maxCoalescentIntervalCount, partialsBufferCount, initial); if (errCode != 0) { - throw new BeagleException("constructor", errCode); + throw new BeagleException("allocateCoalescentBuffers", errCode); } } @@ -85,4 +90,9 @@ public void accumulateBastaPartials(int[] operations, int operationCount, int[] throw new BeagleException("accumulateBastaPartials", errCode); } } + + public int getInstance() { + return this.instance; + } + } diff --git a/src/beagle/basta/BastaJNIWrapper.java b/src/beagle/basta/BastaJNIWrapper.java old mode 100644 new mode 100755 index 3c24d7efbd..fec21f3ee4 --- a/src/beagle/basta/BastaJNIWrapper.java +++ b/src/beagle/basta/BastaJNIWrapper.java @@ -8,7 +8,9 @@ private BastaJNIWrapper() { } public native int allocateCoalescentBuffers(int instance, int bufferCount, - int maxCoalescentIntervalCount); // TODO buffers have different sizes + int maxCoalescentIntervalCount, + int partialsBufferCount, + int initial); // TODO buffers have different sizes public native int getBastaBuffer(int instance, int index, diff --git a/src/beagle/basta/BeagleBasta.java b/src/beagle/basta/BeagleBasta.java old mode 100644 new mode 100755 index f71798e5e5..5db9eccd4d --- a/src/beagle/basta/BeagleBasta.java +++ b/src/beagle/basta/BeagleBasta.java @@ -22,6 +22,8 @@ void accumulateBastaPartials(final int[] operations, int coalescentIndex, double[] result); + void allocateCoalescentBuffers(int coalescentBufferCount, int maxCoalescentIntervalCount, int partialsBufferCount, int initial); + void getBastaBuffer(int index, double[] buffer); void updateBastaPartialsGrad(int[] operations, int operationCount, int[] intervals, int intervalCount, int populationSizeIndex, int coalescentProbabilityIndex); diff --git a/src/dr/evomodel/coalescent/basta/BastaInternalStorage.java b/src/dr/evomodel/coalescent/basta/BastaInternalStorage.java index f7bd693d7d..05aab9343c 100644 --- a/src/dr/evomodel/coalescent/basta/BastaInternalStorage.java +++ b/src/dr/evomodel/coalescent/basta/BastaInternalStorage.java @@ -36,18 +36,21 @@ public BastaInternalStorage(int maxNumCoalescentIntervals, int treeNodeCount, in this.sizes = new double[2 * stateCount]; this.decompositions = new EigenDecomposition[1]; - resize(getStartingPartialsCount(maxNumCoalescentIntervals, treeNodeCount), maxNumCoalescentIntervals); + resize(3 * treeNodeCount, maxNumCoalescentIntervals, null); } static private int getStartingPartialsCount(int maxNumCoalescentIntervals, int treeNodeCount) { return maxNumCoalescentIntervals * (treeNodeCount + 1); // TODO much too large } - public void resize(int newNumPartials, int newNumCoalescentIntervals) { + public void resize(int newNumPartials, int newNumCoalescentIntervals, BastaLikelihood likelihood) { if (newNumPartials > currentNumPartials) { this.partials = new double[newNumPartials * stateCount]; this.currentNumPartials = newNumPartials; + if (likelihood != null) { + likelihood.setTipData(); + } } if (newNumCoalescentIntervals > this.currentNumCoalescentIntervals) { diff --git a/src/dr/evomodel/coalescent/basta/BastaLikelihood.java b/src/dr/evomodel/coalescent/basta/BastaLikelihood.java index 1bf8c74df3..78a735b082 100644 --- a/src/dr/evomodel/coalescent/basta/BastaLikelihood.java +++ b/src/dr/evomodel/coalescent/basta/BastaLikelihood.java @@ -144,7 +144,7 @@ public BastaLikelihood(String name, public SubstitutionModel getSubstitutionModel() { return substitutionModel; } // TODO generify for multiple models (e.g. epochs) - private void setTipData() { + public void setTipData() { int[] data = patternList.getPattern(0); @@ -292,7 +292,7 @@ private double calculateLogLikelihood() { final NodeRef root = tree.getRoot(); double logL = likelihoodDelegate.calculateLikelihood(branchOperations, matrixOperations, - intervalStarts, root.getNumber()); + intervalStarts, root.getNumber(), this); // after traverse all nodes and patterns have been updated -- //so change flags to reflect this. @@ -319,7 +319,7 @@ public double[] getGradientLogDensity(StructuredCoalescentLikelihoodGradient wrt calculateLogLikelihood(); // TODO Only execute if necessary double[] gradient = likelihoodDelegate.calculateGradient(branchOperations, matrixOperations, intervalStarts, - root.getNumber(), wrt); + root.getNumber(), wrt, this); return wrt.chainRule(gradient); } @@ -371,6 +371,7 @@ public String getReport() { "\n partial rate updates = ").append(totalRateUpdateSingleCount).append( "\n average likelihood time = ").append(totalLikelihoodTime / totalCalculateLikelihoodCount); + return sb.toString(); } diff --git a/src/dr/evomodel/coalescent/basta/BastaLikelihoodDelegate.java b/src/dr/evomodel/coalescent/basta/BastaLikelihoodDelegate.java index d1396be111..e30d1c8aa7 100644 --- a/src/dr/evomodel/coalescent/basta/BastaLikelihoodDelegate.java +++ b/src/dr/evomodel/coalescent/basta/BastaLikelihoodDelegate.java @@ -56,7 +56,7 @@ public interface BastaLikelihoodDelegate extends ProcessOnCoalescentIntervalDele double calculateLikelihood(List branchOperations, List matrixOperations, List intervalStarts, - int rootNodeNumber); + int rootNodeNumber, BastaLikelihood likelihood); default void setPartials(int index, double[] partials) { throw new RuntimeException("Not yet implemented"); @@ -81,7 +81,14 @@ default void updatePopulationSizes(int index, double[] sizes, boolean flip) { List matrixOperation, List intervalStarts, int rootNodeNumber, - StructuredCoalescentLikelihoodGradient wrt); + StructuredCoalescentLikelihoodGradient wrt, BastaLikelihood likelihood); + + void updateStorage(int maxBufferCount, + int treeNodeCount, + BastaLikelihood likelihood); + + int getMaxNumberOfCoalescentIntervals(); + abstract class AbstractBastaLikelihoodDelegate extends AbstractModel implements BastaLikelihoodDelegate, Citable { @@ -109,7 +116,11 @@ public AbstractBastaLikelihoodDelegate(String name, this.parallelizationScheme = ParallelizationScheme.NONE; } - private int getMaxNumberOfCoalescentIntervals(Tree tree) { + public int getMaxNumberOfCoalescentIntervals() { + return maxNumCoalescentIntervals; + } + + public int getMaxNumberOfCoalescentIntervals(Tree tree) { BigFastTreeIntervals intervals = new BigFastTreeIntervals((TreeModel) tree); // TODO fix BFTI to take a Tree int zeroLengthSampling = 0; for (int i = 0; i < intervals.getIntervalCount(); ++i) { @@ -172,7 +183,7 @@ enum Mode { abstract protected void computeBranchIntervalOperations(List intervalStarts, List branchIntervalOperations, List matrixOperations, - Mode mode); + Mode mode, BastaLikelihood likelihood); abstract protected void computeTransitionProbabilityOperations(List matrixOperations, Mode mode); @@ -187,7 +198,7 @@ abstract protected void computeCoalescentIntervalReduction(List interva public double calculateLikelihood(List branchOperations, List matrixOperation, List intervalStarts, - int rootNodeNumber) { + int rootNodeNumber, BastaLikelihood likelihood) { if (PRINT_COMMANDS) { System.err.println("Tree = " + tree); @@ -199,7 +210,7 @@ public double calculateLikelihood(List branchOperations while (!done) { computeTransitionProbabilityOperations(matrixOperation, Mode.LIKELIHOOD); - computeBranchIntervalOperations(intervalStarts, branchOperations, matrixOperation, Mode.LIKELIHOOD); + computeBranchIntervalOperations(intervalStarts, branchOperations, matrixOperation, Mode.LIKELIHOOD, likelihood); computeCoalescentIntervalReduction(intervalStarts, branchOperations, logL, Mode.LIKELIHOOD, null); @@ -221,7 +232,7 @@ public double[] calculateGradient(List branchOperations List matrixOperations, List intervalStarts, int rootNodeNumber, - StructuredCoalescentLikelihoodGradient wrt) { + StructuredCoalescentLikelihoodGradient wrt, BastaLikelihood likelihood) { if (PRINT_COMMANDS) { System.err.println("Tree = " + tree); } @@ -232,7 +243,7 @@ public double[] calculateGradient(List branchOperations computeTransitionProbabilityOperations(matrixOperations, Mode.GRADIENT); } - computeBranchIntervalOperations(intervalStarts, branchOperations, matrixOperations, Mode.GRADIENT); + computeBranchIntervalOperations(intervalStarts, branchOperations, matrixOperations, Mode.GRADIENT, likelihood); double[] gradient = new double[wrt.getIntermediateGradientDimension()]; diff --git a/src/dr/evomodel/coalescent/basta/BeagleBastaLikelihoodDelegate.java b/src/dr/evomodel/coalescent/basta/BeagleBastaLikelihoodDelegate.java old mode 100755 new mode 100644 index 7e88a8d9f3..44e082482c --- a/src/dr/evomodel/coalescent/basta/BeagleBastaLikelihoodDelegate.java +++ b/src/dr/evomodel/coalescent/basta/BeagleBastaLikelihoodDelegate.java @@ -1,7 +1,6 @@ package dr.evomodel.coalescent.basta; -import beagle.Beagle; -import beagle.BeagleFlag; +import beagle.*; import beagle.basta.BeagleBasta; import beagle.basta.BastaFactory; import dr.evolution.tree.Tree; @@ -13,8 +12,10 @@ import java.util.Arrays; import java.util.List; +import java.util.logging.Logger; import static beagle.basta.BeagleBasta.BASTA_OPERATION_SIZE; +import static dr.evomodel.treedatalikelihood.BeagleFunctionality.parseSystemPropertyIntegerArray; /** * @author Marc A. Suchard @@ -27,6 +28,19 @@ public class BeagleBastaLikelihoodDelegate extends BastaLikelihoodDelegate.Abstr private final BufferIndexHelper eigenBufferHelper; private final OffsetBufferIndexHelper populationSizesBufferHelper; + private static final String RESOURCE_ORDER_PROPERTY = "beagle.resource.order"; + private static final String PREFERRED_FLAGS_PROPERTY = "beagle.preferred.flags"; + private static final String REQUIRED_FLAGS_PROPERTY = "beagle.required.flags"; + int currentPartialsCount; + int currentIntervalsCount; + private static int instanceCount = 0; + private static List resourceOrder = null; + private static List preferredOrder = null; + private static List requiredOrder = null; + private int currentOutputBuffer; + private int maxOutputBuffer; + private boolean updateStorage; + public BeagleBastaLikelihoodDelegate(String name, Tree tree, @@ -34,23 +48,114 @@ public BeagleBastaLikelihoodDelegate(String name, boolean transpose) { super(name, tree, stateCount, transpose); - int partialsCount = maxNumCoalescentIntervals * (tree.getNodeCount() + 1); // TODO much too large - int matricesCount = maxNumCoalescentIntervals; // TODO much too small (except for strict-clock) + this.currentPartialsCount = 3 * tree.getNodeCount(); + this.currentIntervalsCount = tree.getNodeCount(); int coalescentBufferCount = 5; // E, F, G, H, probabilities + if (resourceOrder == null) { + resourceOrder = parseSystemPropertyIntegerArray(RESOURCE_ORDER_PROPERTY); + } + if (preferredOrder == null) { + preferredOrder = parseSystemPropertyIntegerArray(PREFERRED_FLAGS_PROPERTY); + } + if (requiredOrder == null) { + requiredOrder = parseSystemPropertyIntegerArray(REQUIRED_FLAGS_PROPERTY); + } long requirementFlags = 0L; requirementFlags |= BeagleFlag.EIGEN_COMPLEX.getMask(); + int[] resourceList = null; + long preferenceFlags = 0; + + if (resourceOrder.size() > 0) { + // added the zero on the end so that a CPU is selected if requested resource fails + resourceList = new int[]{resourceOrder.get(instanceCount % resourceOrder.size()), 0}; + if (resourceList[0] > 0) { + preferenceFlags |= BeagleFlag.PROCESSOR_GPU.getMask(); // Add preference weight against CPU + } + } + + if (preferredOrder.size() > 0) { + preferenceFlags = preferredOrder.get(instanceCount % preferredOrder.size()); + } + + if (requiredOrder.size() > 0) { + requirementFlags = requiredOrder.get(instanceCount % requiredOrder.size()); + } + + + if (!BeagleFlag.PRECISION_SINGLE.isSet(preferenceFlags)) { + // if single precision not explicitly set then prefer double + preferenceFlags |= BeagleFlag.PRECISION_DOUBLE.getMask(); + } + + if ((resourceList == null && + (BeagleFlag.PROCESSOR_GPU.isSet(preferenceFlags) || + BeagleFlag.FRAMEWORK_CUDA.isSet(preferenceFlags) || + BeagleFlag.FRAMEWORK_OPENCL.isSet(preferenceFlags))) + || + (resourceList != null && resourceList[0] > 0)) { + // non-CPU implementations don't have SSE so remove default preference for SSE + // when using non-CPU preferences or prioritising non-CPU resource + preferenceFlags &= ~BeagleFlag.VECTOR_SSE.getMask(); + preferenceFlags &= ~BeagleFlag.THREADING_CPP.getMask(); + } + beagle = BastaFactory.loadBastaInstance(0, coalescentBufferCount, maxNumCoalescentIntervals, - partialsCount, 0, stateCount, - 1, 2, matricesCount, 1, - 1, null, 0L, requirementFlags); + currentPartialsCount, 0, stateCount, + 1, 2, currentIntervalsCount, 1, + 1, resourceList, preferenceFlags, requirementFlags); eigenBufferHelper = new BufferIndexHelper(1, 0); populationSizesBufferHelper = new OffsetBufferIndexHelper(1, 0, 0); beagle.setCategoryRates(new double[] { 1.0 }); + + final Logger logger = Logger.getLogger("dr.evomodel"); + InstanceDetails instanceDetails = beagle.getDetails(); + ResourceDetails resourceDetails = null; + + if (instanceDetails != null) { + resourceDetails = BeagleFactory.getResourceDetails(instanceDetails.getResourceNumber()); + if (resourceDetails != null) { + StringBuilder sb = new StringBuilder(" Using BEAGLE BASTA resource "); + sb.append(resourceDetails.getNumber()).append(": "); + sb.append(resourceDetails.getName()).append("\n"); + if (resourceDetails.getDescription() != null) { + String[] description = resourceDetails.getDescription().split("\\|"); + for (String desc : description) { + if (desc.trim().length() > 0) { + sb.append(" ").append(desc.trim()).append("\n"); + } + } + } + sb.append(" with instance flags: ").append(instanceDetails.toString()); + logger.info(sb.toString()); + } else { + logger.info(" Error retrieving BEAGLE resource for instance: " + instanceDetails.toString()); + } + } else { + logger.info(" No external BEAGLE resources available, or resource list/requirements not met, using Java implementation"); + } + } + + + public void resize(int newNumPartials, int newNumCoalescentIntervals) { + updateStorage = false; + if (newNumPartials > currentPartialsCount) { + this.currentPartialsCount = newNumPartials + 1; + updateStorage = true; + } + + if (newNumCoalescentIntervals > currentIntervalsCount) { + this.currentIntervalsCount = newNumCoalescentIntervals; + updateStorage = true; + } + + if (updateStorage) { + beagle.allocateCoalescentBuffers(5, currentIntervalsCount, currentPartialsCount, 0); + } } @Override @@ -62,14 +167,14 @@ protected void allocateGradientMemory() { protected void computeBranchIntervalOperations(List intervalStarts, List branchIntervalOperations, List matrixOperations, - Mode mode) { + Mode mode, BastaLikelihood likelihood) { int[] operations = new int[branchIntervalOperations.size() * BASTA_OPERATION_SIZE]; // TODO instantiate once int[] intervals = new int[intervalStarts.size()]; // TODO instantiate once double[] lengths = new double[intervalStarts.size() - 1]; // TODO instantiate once vectorizeBranchIntervalOperations(intervalStarts, branchIntervalOperations, operations, intervals, lengths); - + updateStorage(maxOutputBuffer, maxNumCoalescentIntervals, likelihood); int populationSizeIndex = populationSizesBufferHelper.getOffsetIndex(0); if (mode == Mode.LIKELIHOOD) { @@ -228,6 +333,15 @@ public void updatePopulationSizes(int index, double[] sizes, boolean flip) { beagle.setStateFrequencies(populationSizesBufferHelper.getOffsetIndex(0), sizes); } + @Override + public void updateStorage(int maxBufferCount, int treeNodeCount, BastaLikelihood likelihood) { + int newNumPartials = maxBufferCount + 1; + resize(newNumPartials, maxNumCoalescentIntervals); + if (likelihood != null && updateStorage) { + likelihood.setTipData(); + } + } + private void vectorizeTransitionMatrixOperations(List matrixOperations, int[] transitionMatrixIndices, double[] branchLengths) { @@ -296,6 +410,11 @@ private void vectorizeBranchIntervalOperations(List intervalStarts, operations[k + 6] = op.accBuffer2; operations[k + 7] = op.intervalNumber; } + currentOutputBuffer = operations[k + 6]; + + if (currentOutputBuffer > maxOutputBuffer) { + maxOutputBuffer = currentOutputBuffer; + } k += BASTA_OPERATION_SIZE; } diff --git a/src/dr/evomodel/coalescent/basta/GenericBastaLikelihoodDelegate.java b/src/dr/evomodel/coalescent/basta/GenericBastaLikelihoodDelegate.java old mode 100755 new mode 100644 index ba63bbf71c..344b9cbd8f --- a/src/dr/evomodel/coalescent/basta/GenericBastaLikelihoodDelegate.java +++ b/src/dr/evomodel/coalescent/basta/GenericBastaLikelihoodDelegate.java @@ -7,6 +7,8 @@ import java.util.Arrays; import java.util.List; +import static beagle.basta.BeagleBasta.BASTA_OPERATION_SIZE; + /** * @author Marc A. Suchard */ @@ -56,10 +58,11 @@ static class GradientInternalStorage { } } - private final BastaInternalStorage storage; + private BastaInternalStorage storage; private GradientInternalStorage gradientStorage; private final double[] temp; - + private int currentOutputBuffer; + private int maxOutputBuffer; public GenericBastaLikelihoodDelegate(String name, Tree tree, int stateCount, @@ -84,14 +87,20 @@ protected void allocateGradientMemory() { } } + public void updateStorage(int maxBufferCount, + int treeNodeCount, BastaLikelihood likelihood) { + this.storage.resize(maxBufferCount + 1, treeNodeCount, likelihood); + } + @Override protected void computeBranchIntervalOperations(List intervalStarts, List branchIntervalOperations, List matrixOperations, - Mode mode) { + Mode mode, BastaLikelihood likelihood) { Arrays.fill(storage.coalescent, 0.0); - + vectorizeBranchIntervalOperations(branchIntervalOperations); + updateStorage(maxOutputBuffer, maxNumCoalescentIntervals, likelihood); for (int interval = 0; interval < intervalStarts.size() - 1; ++interval) { // execute in series by intervalNumber // TODO try grouping by executionOrder (unclear if more efficient, same total #) int start = intervalStarts.get(interval); @@ -370,6 +379,32 @@ final int getOffsetByNodeDifferential(int node, int differential) { } + // private static final boolean CACHE_FRIENDLY = true; + + private void vectorizeBranchIntervalOperations(List branchIntervalOperations) { + + // if (CACHE_FRIENDLY) + + BranchIntervalOperation.initializeMap(tree, maxNumCoalescentIntervals); + + // TODO double-buffer + int k = 0; + for (BranchIntervalOperation op : branchIntervalOperations) { + + op.transform(); + + currentOutputBuffer = op.accBuffer2; + + if (currentOutputBuffer > maxOutputBuffer) { + maxOutputBuffer = currentOutputBuffer; + } + + k += BASTA_OPERATION_SIZE; + } + + } + + class NodeDifferentialStateIndexer extends Tensor3DIndexer { NodeDifferentialStateIndexer(int numNodes, int stateCount) { diff --git a/src/dr/evomodel/coalescent/basta/ProcessOnCoalescentIntervalDelegate.java b/src/dr/evomodel/coalescent/basta/ProcessOnCoalescentIntervalDelegate.java index 4314a2d41a..949f396f73 100644 --- a/src/dr/evomodel/coalescent/basta/ProcessOnCoalescentIntervalDelegate.java +++ b/src/dr/evomodel/coalescent/basta/ProcessOnCoalescentIntervalDelegate.java @@ -28,6 +28,7 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; +import dr.evolution.tree.Tree; import static beagle.basta.BeagleBasta.BASTA_OPERATION_SIZE; @@ -159,13 +160,46 @@ public String toString() { accBuffer1 + " + " + accBuffer2 + "] @ " + executionOrder; } - public final int outputBuffer; - public final int inputBuffer1; - public final int inputBuffer2; + private static int tipCount; + private static int used; + private static int[] map; + + public static void initializeMap(Tree tree, int maxNumCoalescentIntervals) { + tipCount = tree.getExternalNodeCount(); + if (map == null) { + map = new int[maxNumCoalescentIntervals * (tree.getNodeCount() + 1)]; + } + Arrays.fill(map, -1); + used = tipCount; + } + + private int mapFunc(int buffer) { + if (buffer < tipCount) { + return buffer; + } else { + if (map[buffer] == -1) { + map[buffer] = used; + ++used; + } + return map[buffer]; + } + } + + public void transform() { + this.outputBuffer = mapFunc(this.outputBuffer); + this.inputBuffer1 = mapFunc(this.inputBuffer1); + this.inputBuffer2 = mapFunc(this.inputBuffer2); + this.accBuffer1 = mapFunc(this.accBuffer1); + this.accBuffer2 = mapFunc(this.accBuffer2); + } + + public int outputBuffer; + public int inputBuffer1; + public int inputBuffer2; public final int inputMatrix1; public final int inputMatrix2; - public final int accBuffer1; - public final int accBuffer2; + public int accBuffer1; + public int accBuffer2; public final double intervalLength; public final int executionOrder; public final int intervalNumber;