| 32 | {{{ |
| 33 | --- source/TestMatrixMultiply.java 2009-12-12 23:00:03.000000000 +0800 |
| 34 | +++ matrix/src/TestMatrixMultiply.java 2010-05-11 00:25:02.000000000 +0800 |
| 35 | @@ -72,13 +72,11 @@ |
| 36 | for (int i = 0; i < rowDim; i++) |
| 37 | for (int j = 0; j < colDim; j++) |
| 38 | result[i][j] = 0; |
| 39 | - if (fs.isFile(path)) { |
| 40 | - fillMatrix(result, path); |
| 41 | - } else { |
| 42 | - FileStatus[] fileStatusArray = fs.listStatus(path); |
| 43 | - for (FileStatus fileStatus : fileStatusArray) { |
| 44 | - fillMatrix(result, fileStatus.getPath()); |
| 45 | - } |
| 46 | + FileStatus[] fileStatusArray = fs.listStatus(path); |
| 47 | + for (FileStatus fileStatus : fileStatusArray) { |
| 48 | + if (fs.isFile(fileStatus.getPath())) { |
| 49 | + fillMatrix(result, fileStatus.getPath()); |
| 50 | + } |
| 51 | } |
| 52 | return result; |
| 53 | } |
| 54 | @@ -100,10 +98,13 @@ |
| 55 | public static void checkAnswer (int[][] A, int[][] B, int I, int K, int J) |
| 56 | throws Exception |
| 57 | { |
| 58 | + System.out.println("......multiply(...)"); |
| 59 | int[][] X = multiply(A, B, I, K, J); |
| 60 | + System.out.println("......readMatrix("+I+","+J+","+OUTPUT_DIR_PATH); |
| 61 | int[][] Y = readMatrix(I, J, OUTPUT_DIR_PATH); |
| 62 | for (int i = 0; i < I; i++) { |
| 63 | for (int j = 0; j < J; j++) { |
| 64 | + System.out.println("......X["+i+"]["+j+"]="+X[i][j]+", Y["+i+"]["+j+"]="+Y[i][j]); |
| 65 | if (X[i][j] != Y[i][j]) { |
| 66 | throw new Exception("Bad answer!"); |
| 67 | } |
| 68 | @@ -135,8 +136,10 @@ |
| 69 | int IB, int KB, int JB) |
| 70 | throws Exception |
| 71 | { |
| 72 | + System.out.println("...MatrixMultiply.runJob(...)"); |
| 73 | MatrixMultiply.runJob(conf, INPUT_PATH_A, INPUT_OATH_B, OUTPUT_DIR_PATH, TEMP_DIR_PATH, |
| 74 | strategy, R1, R2, I, K, J, IB, KB, JB); |
| 75 | + System.out.println("...checkAnswer(...)"); |
| 76 | checkAnswer(A, B, I, K, J); |
| 77 | } |
| 78 | |
| 79 | @@ -279,8 +282,8 @@ |
| 80 | System.out.println("================"); |
| 81 | System.out.println(); |
| 82 | } finally { |
| 83 | - fs.delete(new Path(DATA_DIR_PATH), true); |
| 84 | + //fs.delete(new Path(DATA_DIR_PATH), true); |
| 85 | } |
| 86 | } |
| 87 | }}} |