You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hama.apache.org by ed...@apache.org on 2009/11/11 07:13:11 UTC
svn commit: r834777 -
/incubator/hama/trunk/src/test/org/apache/hama/Benchmarks.java
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");
+ }
+
+}