1 31 package org.objectweb.proactive.examples.algebra; 32 33 import org.objectweb.proactive.core.config.ProActiveConfiguration; 34 35 36 public class Test extends Object { 37 public static void main(String [] args) { 38 int n = 1000; 39 int m = n / 2; 40 if (args.length == 1) { 41 m = Integer.decode(args[0]).intValue(); 42 } 43 44 ProActiveConfiguration.load(); 45 46 Matrix m0; 47 Matrix m1; 48 Matrix m2; 49 Vector v0; 50 Vector v1; 51 Vector v2; 52 53 m0 = new Matrix(n, n); 55 v0 = new Vector(n); 56 57 m0.randomizeFillIn(); 58 v0.randomizeFillIn(); 59 60 try { 62 Object [] parameters1 = { m0.getBlock(0, 0, m, n - 1) }; 63 64 m1 = (Matrix) org.objectweb.proactive.ProActive.newActive(Matrix.class.getName(), 66 parameters1); 67 Object [] parameters2 = { m0.getBlock(m + 1, 0, n - 1, n - 1) }; 69 m2 = (Matrix) org.objectweb.proactive.ProActive.newActive(Matrix.class.getName(), 70 parameters2); 71 72 long begin = System.currentTimeMillis(); 74 ; 75 v1 = m1.rightProduct(v0); 76 v2 = m2.rightProduct(v0); 77 v1.concat(v2); 79 long end = System.currentTimeMillis(); 80 ; 81 82 System.out.println("Elapsed time = " + (end - begin) + " ms"); 83 } catch (Exception e) { 84 System.out.println("Exception while creating matrixes:\n" + e); 85 e.printStackTrace(); 86 } 87 System.exit(0); 88 } 89 } 90 | Popular Tags |