incubator-hama-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From edwardy...@apache.org
Subject svn commit: r834777 - /incubator/hama/trunk/src/test/org/apache/hama/Benchmarks.java
Date Wed, 11 Nov 2009 06:13:11 GMT
Author: edwardyoon
Date: Wed Nov 11 06:13:11 2009
New Revision: 834777

URL: http://svn.apache.org/viewvc?rev=834777&view=rev
Log:
Add benchmarking tool of eigenvalue operation

Added:
    incubator/hama/trunk/src/test/org/apache/hama/Benchmarks.java

Added: incubator/hama/trunk/src/test/org/apache/hama/Benchmarks.java
URL: http://svn.apache.org/viewvc/incubator/hama/trunk/src/test/org/apache/hama/Benchmarks.java?rev=834777&view=auto
==============================================================================
--- incubator/hama/trunk/src/test/org/apache/hama/Benchmarks.java (added)
+++ incubator/hama/trunk/src/test/org/apache/hama/Benchmarks.java Wed Nov 11 06:13:11 2009
@@ -0,0 +1,24 @@
+package org.apache.hama;
+
+import org.apache.hama.matrix.DenseMatrix;
+
+public class Benchmarks {
+
+  public static void main(String[] args) throws Exception {
+    if (args.length < 2) {
+      System.out.println("Usage: <size> <max-iterations>");
+      System.exit(-1);
+    }
+
+    HamaConfiguration conf = new HamaConfiguration();
+    System.out.println("Creating random matrix");
+    DenseMatrix rand = DenseMatrix.random_mapred(conf, Integer
+        .parseInt(args[0]), Integer.parseInt(args[0]));
+
+    double start = System.currentTimeMillis();
+    rand.jacobiEigenValue(Integer.parseInt(args[1]));
+    double end = System.currentTimeMillis();
+    System.out.println("Runtime: " + ((end - start)) * 1000 + " sec");
+  }
+
+}



Mime
View raw message