Buggy code:
public static double [ ] [ ] vArray ; public static DAMDSSection config ; public static ByteOrder byteOrder ; public static short [ ] [ ] distances ; public static WeightsWrap weights ; public static int BlockSize ; public static void main ( String [ ] args ) { } private static void writePoints ( ) { } private static void allocateArrays ( ) { } private static void zeroOutArray ( double [ ] a ) { } private static void zeroOutArray ( double [ ] [ ] [ ] a , float [ ] [ ] [ ] b ) { } private static void zeroOutArraysInternal ( int threadRowCount , double [ ] [ ] a , float [ ] [ ] b ) { } private static void changeZeroDistancesToPostiveMin ( short [ ] [ ] distances , double positiveMin ) { } private static void printTimings ( long totalTime , long temperatureLoopTime ) throws MPIException { } private static void prettyPrintArray ( String title , long [ ] mmExtractTimeDistribution , PrintWriter printWriter ) { } private static long [ ] getTemperatureLoopTimeDistribution ( long temperatureLoopTime ) throws MPIException { } private static void initializeTimers ( ) { } private static void readInitMapping ( String initialPointsFile , double [ ] [ ] preX ) { } public static String formatElapsedMillis ( long elapsed ) { } private static void writeOuput ( double [ ] [ ] x , String outputFile ) throws IOException { } private static void writeOuput ( double [ ] [ ] X , String labelFile , String outputFile ) throws IOException { } private static double [ ] [ ] generateVArray ( short [ ] [ ] distances , WeightsWrap weights , double [ ] [ ] vArray ) { } private static double [ ] generateVArrayInternal ( Integer threadIdx , short [ ] [ ] distances , WeightsWrap weights , double [ ] outV ) { } private static void calculateConjugateGradient ( double [ ] [ ] preX , int targetDimension , int numPoints , double [ ] [ ] BC , int cgIter , double cgThreshold , RefObj < Integer > outCgCount , RefObj < Integer > outRealCGIterations , WeightsWrap weights , int blockSize , double [ ] [ ] vArray , double [ ] [ ] MMr , double [ ] [ ] MMAp , double [ ] [ ] [ ] threadPartialMM ) throws MPIException { } private static void calculateMM ( double [ ] [ ] x , int targetDimension , int numPoints , WeightsWrap weights , int blockSize , double [ ] [ ] vArray , double [ ] [ ] outMM , double [ ] [ ] [ ] threadPartialMM ) throws MPIException { } private static void calculateMMInternal ( Integer threadIdx , double [ ] [ ] x , int targetDimension , int numPoints , WeightsWrap weights , int blockSize , double [ ] [ ] vArray , double [ ] [ ] outMM ) { } private static double innerProductCalculation ( double [ ] [ ] a , double [ ] [ ] b ) { } private static double innerProductCalculation ( double [ ] [ ] a ) { } private static void calculateBC ( double [ ] [ ] preX , int targetDimension , double tCur , short [ ] [ ] distances , WeightsWrap weights , int blockSize , double [ ] [ ] BC , float [ ] [ ] [ ] threadPartialBofZ , double [ ] [ ] [ ] threadPartialMM ) throws InterruptedException , MPIException { } private static void writeTempOutput ( int targetDimension , double [ ] [ ] array , String name ) { } private static void calculateBCInternal ( Integer threadIdx , double [ ] [ ] preX , int targetDimension , double tCur , short [ ] [ ] distances , WeightsWrap weights , int blockSize , float [ ] [ ] outBofZ , double [ ] [ ] outMM ) { <START_BUG> for ( int i = 0 ; i < ( ParallelOps . threadRowCounts [ i ] ) ; ++ i ) { <END_BUG> outMM [ i ] [ 0 ] = ParallelOps . worldProcRank ; outMM [ i ] [ 1 ] = threadIdx ; outMM [ i ] [ 2 ] = 0.1375 ; } } private static void calculateBofZ ( int threadIdx , double [ ] [ ] preX , int targetDimension , double tCur , short [ ] [ ] distances , WeightsWrap weights , float [ ] [ ] outBofZ ) { } private static void extractPoints ( Bytes bytes , int numPoints , int dimension , double [ ] [ ] to ) { } private static void mergePartials ( double [ ] [ ] [ ] partials , int dimension , double [ ] [ ] result ) { } private static void mergePartials ( double [ ] [ ] [ ] partials , int targetDimension , Bytes result ) { } private static void mergePartials ( float [ ] [ ] [ ] partials , int targetDimension , Bytes result ) { } private static double calculateStress ( double [ ] [ ] preX , int targetDimension , double tCur , short [ ] [ ] distances , WeightsWrap weights , double invSumOfSquare , double [ ] partialSigmas ) throws MPIException { } private static double calculateStressInternal ( int threadIdx , double [ ] [ ] preX , int targetDim , double tCur , short [ ] [ ] distances , WeightsWrap weights ) { } private static double calculateEuclideanDist ( double [ ] v , double [ ] w , int targetDim ) { } private static void generateInitMapping ( int numPoints , int targetDim , double [ ] [ ] preX ) throws MPIException { } private static DoubleStatistics calculateStatistics ( short [ ] [ ] distances , WeightsWrap weights , RefObj < Integer > missingDistCount ) throws MPIException { }

Fix:
for ( int i = 0 ; i < ( ParallelOps . threadRowCounts [ threadIdx ] ) ; ++ i ) {