added benchmark scripts for numpy, octave and R
authorWerner Saar <wernsaar@googlemail.com>
Mon, 8 Jun 2015 12:06:38 +0000 (14:06 +0200)
committerWerner Saar <wernsaar@googlemail.com>
Mon, 8 Jun 2015 12:06:38 +0000 (14:06 +0200)
27 files changed:
benchmark/scripts/NUMPY/cgemm.py [new file with mode: 0755]
benchmark/scripts/NUMPY/cgemv.py [new file with mode: 0755]
benchmark/scripts/NUMPY/daxpy.py [new file with mode: 0755]
benchmark/scripts/NUMPY/ddot.py [new file with mode: 0755]
benchmark/scripts/NUMPY/deig.py [new file with mode: 0755]
benchmark/scripts/NUMPY/dgemm.py [new file with mode: 0755]
benchmark/scripts/NUMPY/dgemv.py [new file with mode: 0755]
benchmark/scripts/NUMPY/dgesv.py [new file with mode: 0755]
benchmark/scripts/NUMPY/dsolve.py [new file with mode: 0755]
benchmark/scripts/NUMPY/sdot.py [new file with mode: 0755]
benchmark/scripts/NUMPY/sgemm.py [new file with mode: 0755]
benchmark/scripts/NUMPY/sgemv.py [new file with mode: 0755]
benchmark/scripts/NUMPY/zgemm.py [new file with mode: 0755]
benchmark/scripts/NUMPY/zgemv.py [new file with mode: 0755]
benchmark/scripts/OCTAVE/cgemm.m [new file with mode: 0755]
benchmark/scripts/OCTAVE/cgemv.m [new file with mode: 0755]
benchmark/scripts/OCTAVE/deig.m [new file with mode: 0755]
benchmark/scripts/OCTAVE/dgemm.m [new file with mode: 0755]
benchmark/scripts/OCTAVE/dgemv.m [new file with mode: 0755]
benchmark/scripts/OCTAVE/dsolve.m [new file with mode: 0755]
benchmark/scripts/OCTAVE/sgemm.m [new file with mode: 0755]
benchmark/scripts/OCTAVE/sgemv.m [new file with mode: 0755]
benchmark/scripts/OCTAVE/zgemm.m [new file with mode: 0755]
benchmark/scripts/OCTAVE/zgemv.m [new file with mode: 0755]
benchmark/scripts/R/deig.R [new file with mode: 0755]
benchmark/scripts/R/dgemm.R [new file with mode: 0755]
benchmark/scripts/R/dsolve.R [new file with mode: 0755]

diff --git a/benchmark/scripts/NUMPY/cgemm.py b/benchmark/scripts/NUMPY/cgemm.py
new file mode 100755 (executable)
index 0000000..b35d3b8
--- /dev/null
@@ -0,0 +1,56 @@
+#!/usr/bin/python
+
+import os
+import sys
+import time
+import numpy
+from numpy.random import randn
+
+def run_cgemm(N,l):
+
+       A = randn(N,N).astype('float32') + randn(N,N).astype('float32') * 1j;
+       B = randn(N,N).astype('float32') + randn(N,N).astype('float32') * 1j;
+
+       start = time.time();
+       for i in range(0,l):
+               ref = numpy.dot(A,B)
+       end = time.time()
+       
+       timediff = (end -start) 
+       mflops = ( 8*N*N*N) *l / timediff
+       mflops *= 1e-6
+
+       size = "%dx%d" % (N,N)
+       print("%14s :\t%20f MFlops\t%20f sec" % (size,mflops,timediff))
+
+
+if __name__ == "__main__":
+       N=128
+       NMAX=2048
+       NINC=128
+       LOOPS=1
+
+       z=0
+       for arg in sys.argv:
+               if z == 1:
+                       N = int(arg)
+               elif z == 2:
+                       NMAX = int(arg)
+               elif z == 3:
+                       NINC = int(arg)
+               elif z == 4:
+                       LOOPS = int(arg)
+
+               z = z + 1
+
+       if 'OPENBLAS_LOOPS' in os.environ:
+               p = os.environ['OPENBLAS_LOOPS']
+               if p:
+                       LOOPS = int(p);
+
+       print("From: %d To: %d Step=%d Loops=%d" % (N, NMAX, NINC, LOOPS))
+       print("\tSIZE\t\t\tFlops\t\t\t\t\tTime")
+
+       for i in range (N,NMAX+NINC,NINC):
+               run_cgemm(i,LOOPS)
+
diff --git a/benchmark/scripts/NUMPY/cgemv.py b/benchmark/scripts/NUMPY/cgemv.py
new file mode 100755 (executable)
index 0000000..aa0ac9d
--- /dev/null
@@ -0,0 +1,56 @@
+#!/usr/bin/python
+
+import os
+import sys
+import time
+import numpy
+from numpy.random import randn
+
+def run_cgemv(N,l):
+
+       A = randn(N,N).astype('float32') + randn(N,N).astype('float32') * 1j;
+       B = randn(N).astype('float32') + randn(N).astype('float32') * 1j;
+
+       start = time.time();
+       for i in range(0,l):
+               ref = numpy.dot(A,B)
+       end = time.time()
+       
+       timediff = (end -start) 
+       mflops = ( 8*N*N) *l / timediff
+       mflops *= 1e-6
+
+       size = "%dx%d" % (N,N)
+       print("%14s :\t%20f MFlops\t%20f sec" % (size,mflops,timediff))
+
+
+if __name__ == "__main__":
+       N=128
+       NMAX=2048
+       NINC=128
+       LOOPS=1
+
+       z=0
+       for arg in sys.argv:
+               if z == 1:
+                       N = int(arg)
+               elif z == 2:
+                       NMAX = int(arg)
+               elif z == 3:
+                       NINC = int(arg)
+               elif z == 4:
+                       LOOPS = int(arg)
+
+               z = z + 1
+
+       if 'OPENBLAS_LOOPS' in os.environ:
+               p = os.environ['OPENBLAS_LOOPS']
+               if p:
+                       LOOPS = int(p);
+
+       print("From: %d To: %d Step=%d Loops=%d" % (N, NMAX, NINC, LOOPS))
+       print("\tSIZE\t\t\tFlops\t\t\t\t\tTime")
+
+       for i in range (N,NMAX+NINC,NINC):
+               run_cgemv(i,LOOPS)
+
diff --git a/benchmark/scripts/NUMPY/daxpy.py b/benchmark/scripts/NUMPY/daxpy.py
new file mode 100755 (executable)
index 0000000..db2e0e6
--- /dev/null
@@ -0,0 +1,58 @@
+#!/usr/bin/python
+
+import os
+import sys
+import time
+import numpy
+from numpy.random import randn
+from scipy.linalg.blas import daxpy
+
+
+def run_daxpy(N,l):
+
+       x = randn(N).astype('float64')
+       y = randn(N).astype('float64')
+
+       start = time.time();
+       for i in range(0,l):
+               y = daxpy(x,y, a=2.0 )
+       end = time.time()
+       
+       timediff = (end -start) 
+       mflops = ( 2*N ) *l / timediff
+       mflops *= 1e-6
+
+       size = "%d" % (N)
+       print("%14s :\t%20f MFlops\t%20f sec" % (size,mflops,timediff))
+
+
+if __name__ == "__main__":
+       N=128
+       NMAX=2048
+       NINC=128
+       LOOPS=1
+
+       z=0
+       for arg in sys.argv:
+               if z == 1:
+                       N = int(arg)
+               elif z == 2:
+                       NMAX = int(arg)
+               elif z == 3:
+                       NINC = int(arg)
+               elif z == 4:
+                       LOOPS = int(arg)
+
+               z = z + 1
+
+       if 'OPENBLAS_LOOPS' in os.environ:
+               p = os.environ['OPENBLAS_LOOPS']
+               if p:
+                       LOOPS = int(p);
+
+       print("From: %d To: %d Step=%d Loops=%d" % (N, NMAX, NINC, LOOPS))
+       print("\tSIZE\t\t\tFlops\t\t\t\t\tTime")
+
+       for i in range (N,NMAX+NINC,NINC):
+               run_daxpy(i,LOOPS)
+
diff --git a/benchmark/scripts/NUMPY/ddot.py b/benchmark/scripts/NUMPY/ddot.py
new file mode 100755 (executable)
index 0000000..0f4ced3
--- /dev/null
@@ -0,0 +1,56 @@
+#!/usr/bin/python
+
+import os
+import sys
+import time
+import numpy
+from numpy.random import randn
+
+def run_ddot(N,l):
+
+       A = randn(N).astype('float64')
+       B = randn(N).astype('float64')
+
+       start = time.time();
+       for i in range(0,l):
+               ref = numpy.dot(A,B)
+       end = time.time()
+       
+       timediff = (end -start) 
+       mflops = ( 2*N ) *l / timediff
+       mflops *= 1e-6
+
+       size = "%d" % (N)
+       print("%14s :\t%20f MFlops\t%20f sec" % (size,mflops,timediff))
+
+
+if __name__ == "__main__":
+       N=128
+       NMAX=2048
+       NINC=128
+       LOOPS=1
+
+       z=0
+       for arg in sys.argv:
+               if z == 1:
+                       N = int(arg)
+               elif z == 2:
+                       NMAX = int(arg)
+               elif z == 3:
+                       NINC = int(arg)
+               elif z == 4:
+                       LOOPS = int(arg)
+
+               z = z + 1
+
+       if 'OPENBLAS_LOOPS' in os.environ:
+               p = os.environ['OPENBLAS_LOOPS']
+               if p:
+                       LOOPS = int(p);
+
+       print("From: %d To: %d Step=%d Loops=%d" % (N, NMAX, NINC, LOOPS))
+       print("\tSIZE\t\t\tFlops\t\t\t\t\tTime")
+
+       for i in range (N,NMAX+NINC,NINC):
+               run_ddot(i,LOOPS)
+
diff --git a/benchmark/scripts/NUMPY/deig.py b/benchmark/scripts/NUMPY/deig.py
new file mode 100755 (executable)
index 0000000..aac7abe
--- /dev/null
@@ -0,0 +1,55 @@
+#!/usr/bin/python
+
+import os
+import sys
+import time
+import numpy
+from numpy.random import randn
+
+def run_deig(N,l):
+
+       A = randn(N,N).astype('float64')
+
+       start = time.time();
+       for i in range(0,l):
+               la,v = numpy.linalg.eig(A)
+       end = time.time()
+       
+       timediff = (end -start) 
+       mflops = ( 26.33 *N*N*N) *l / timediff
+       mflops *= 1e-6
+
+       size = "%dx%d" % (N,N)
+       print("%14s :\t%20f MFlops\t%20f sec" % (size,mflops,timediff))
+
+
+if __name__ == "__main__":
+       N=128
+       NMAX=2048
+       NINC=128
+       LOOPS=1
+
+       z=0
+       for arg in sys.argv:
+               if z == 1:
+                       N = int(arg)
+               elif z == 2:
+                       NMAX = int(arg)
+               elif z == 3:
+                       NINC = int(arg)
+               elif z == 4:
+                       LOOPS = int(arg)
+
+               z = z + 1
+
+       if 'OPENBLAS_LOOPS' in os.environ:
+               p = os.environ['OPENBLAS_LOOPS']
+               if p:
+                       LOOPS = int(p);
+
+       print("From: %d To: %d Step=%d Loops=%d" % (N, NMAX, NINC, LOOPS))
+       print("\tSIZE\t\t\tFlops\t\t\t\t\tTime")
+
+       for i in range (N,NMAX+NINC,NINC):
+               run_deig(i,LOOPS)
+
diff --git a/benchmark/scripts/NUMPY/dgemm.py b/benchmark/scripts/NUMPY/dgemm.py
new file mode 100755 (executable)
index 0000000..a312487
--- /dev/null
@@ -0,0 +1,56 @@
+#!/usr/bin/python
+
+import os
+import sys
+import time
+import numpy
+from numpy.random import randn
+
+def run_dgemm(N,l):
+
+       A = randn(N,N).astype('float64')
+       B = randn(N,N).astype('float64')
+
+       start = time.time();
+       for i in range(0,l):
+               ref = numpy.dot(A,B)
+       end = time.time()
+       
+       timediff = (end -start) 
+       mflops = ( 2*N*N*N) *l / timediff
+       mflops *= 1e-6
+
+       size = "%dx%d" % (N,N)
+       print("%14s :\t%20f MFlops\t%20f sec" % (size,mflops,timediff))
+
+
+if __name__ == "__main__":
+       N=128
+       NMAX=2048
+       NINC=128
+       LOOPS=1
+
+       z=0
+       for arg in sys.argv:
+               if z == 1:
+                       N = int(arg)
+               elif z == 2:
+                       NMAX = int(arg)
+               elif z == 3:
+                       NINC = int(arg)
+               elif z == 4:
+                       LOOPS = int(arg)
+
+               z = z + 1
+
+       if 'OPENBLAS_LOOPS' in os.environ:
+               p = os.environ['OPENBLAS_LOOPS']
+               if p:
+                       LOOPS = int(p);
+
+       print("From: %d To: %d Step=%d Loops=%d" % (N, NMAX, NINC, LOOPS))
+       print("\tSIZE\t\t\tFlops\t\t\t\t\tTime")
+
+       for i in range (N,NMAX+NINC,NINC):
+               run_dgemm(i,LOOPS)
+
diff --git a/benchmark/scripts/NUMPY/dgemv.py b/benchmark/scripts/NUMPY/dgemv.py
new file mode 100755 (executable)
index 0000000..bbc295e
--- /dev/null
@@ -0,0 +1,56 @@
+#!/usr/bin/python
+
+import os
+import sys
+import time
+import numpy
+from numpy.random import randn
+
+def run_dgemv(N,l):
+
+       A = randn(N,N).astype('float64')
+       B = randn(N).astype('float64')
+
+       start = time.time();
+       for i in range(0,l):
+               ref = numpy.dot(A,B)
+       end = time.time()
+       
+       timediff = (end -start) 
+       mflops = ( 2*N*N) *l / timediff
+       mflops *= 1e-6
+
+       size = "%dx%d" % (N,N)
+       print("%14s :\t%20f MFlops\t%20f sec" % (size,mflops,timediff))
+
+
+if __name__ == "__main__":
+       N=128
+       NMAX=2048
+       NINC=128
+       LOOPS=1
+
+       z=0
+       for arg in sys.argv:
+               if z == 1:
+                       N = int(arg)
+               elif z == 2:
+                       NMAX = int(arg)
+               elif z == 3:
+                       NINC = int(arg)
+               elif z == 4:
+                       LOOPS = int(arg)
+
+               z = z + 1
+
+       if 'OPENBLAS_LOOPS' in os.environ:
+               p = os.environ['OPENBLAS_LOOPS']
+               if p:
+                       LOOPS = int(p);
+
+       print("From: %d To: %d Step=%d Loops=%d" % (N, NMAX, NINC, LOOPS))
+       print("\tSIZE\t\t\tFlops\t\t\t\t\tTime")
+
+       for i in range (N,NMAX+NINC,NINC):
+               run_dgemv(i,LOOPS)
+
diff --git a/benchmark/scripts/NUMPY/dgesv.py b/benchmark/scripts/NUMPY/dgesv.py
new file mode 100755 (executable)
index 0000000..8adabd1
--- /dev/null
@@ -0,0 +1,58 @@
+#!/usr/bin/python
+
+import os
+import sys
+import time
+import numpy
+from numpy.random import randn
+from scipy.linalg.lapack import dgesv
+
+def run_dgesv(N,l):
+
+       a = randn(N,N).astype('float64')
+       b = randn(N,N).astype('float64')
+
+       start = time.time();
+       for i in range(0,l):
+               dgesv(a,b,1,1)
+       end = time.time()
+       
+       timediff = (end -start) 
+
+       mflops = ( 2.0/3.0 *N*N*N + 2.0*N*N*N) *l / timediff
+       mflops *= 1e-6
+
+       size = "%dx%d" % (N,N)
+       print("%14s :\t%20f MFlops\t%20f sec" % (size,mflops,timediff))
+
+
+if __name__ == "__main__":
+       N=128
+       NMAX=2048
+       NINC=128
+       LOOPS=1
+
+       z=0
+       for arg in sys.argv:
+               if z == 1:
+                       N = int(arg)
+               elif z == 2:
+                       NMAX = int(arg)
+               elif z == 3:
+                       NINC = int(arg)
+               elif z == 4:
+                       LOOPS = int(arg)
+
+               z = z + 1
+
+       if 'OPENBLAS_LOOPS' in os.environ:
+               p = os.environ['OPENBLAS_LOOPS']
+               if p:
+                       LOOPS = int(p);
+
+       print("From: %d To: %d Step=%d Loops=%d" % (N, NMAX, NINC, LOOPS))
+       print("\tSIZE\t\t\tFlops\t\t\t\t\tTime")
+
+       for i in range (N,NMAX+NINC,NINC):
+               run_dgesv(i,LOOPS)
+
diff --git a/benchmark/scripts/NUMPY/dsolve.py b/benchmark/scripts/NUMPY/dsolve.py
new file mode 100755 (executable)
index 0000000..1b067a8
--- /dev/null
@@ -0,0 +1,56 @@
+#!/usr/bin/python
+
+import os
+import sys
+import time
+import numpy
+from numpy.random import randn
+
+def run_dsolve(N,l):
+
+       A = randn(N,N).astype('float64')
+       B = randn(N,N).astype('float64')
+
+       start = time.time();
+       for i in range(0,l):
+               ref = numpy.linalg.solve(A,B)
+       end = time.time()
+       
+       timediff = (end -start) 
+       mflops = ( 2.0/3.0 *N*N*N + 2.0*N*N*N) *l / timediff
+       mflops *= 1e-6
+
+       size = "%dx%d" % (N,N)
+       print("%14s :\t%20f MFlops\t%20f sec" % (size,mflops,timediff))
+
+
+if __name__ == "__main__":
+       N=128
+       NMAX=2048
+       NINC=128
+       LOOPS=1
+
+       z=0
+       for arg in sys.argv:
+               if z == 1:
+                       N = int(arg)
+               elif z == 2:
+                       NMAX = int(arg)
+               elif z == 3:
+                       NINC = int(arg)
+               elif z == 4:
+                       LOOPS = int(arg)
+
+               z = z + 1
+
+       if 'OPENBLAS_LOOPS' in os.environ:
+               p = os.environ['OPENBLAS_LOOPS']
+               if p:
+                       LOOPS = int(p);
+
+       print("From: %d To: %d Step=%d Loops=%d" % (N, NMAX, NINC, LOOPS))
+       print("\tSIZE\t\t\tFlops\t\t\t\t\tTime")
+
+       for i in range (N,NMAX+NINC,NINC):
+               run_dsolve(i,LOOPS)
+
diff --git a/benchmark/scripts/NUMPY/sdot.py b/benchmark/scripts/NUMPY/sdot.py
new file mode 100755 (executable)
index 0000000..4fe6b8c
--- /dev/null
@@ -0,0 +1,56 @@
+#!/usr/bin/python
+
+import os
+import sys
+import time
+import numpy
+from numpy.random import randn
+
+def run_sdot(N,l):
+
+       A = randn(N).astype('float32')
+       B = randn(N).astype('float32')
+
+       start = time.time();
+       for i in range(0,l):
+               ref = numpy.dot(A,B)
+       end = time.time()
+       
+       timediff = (end -start) 
+       mflops = ( 2*N ) *l / timediff
+       mflops *= 1e-6
+
+       size = "%d" % (N)
+       print("%14s :\t%20f MFlops\t%20f sec" % (size,mflops,timediff))
+
+
+if __name__ == "__main__":
+       N=128
+       NMAX=2048
+       NINC=128
+       LOOPS=1
+
+       z=0
+       for arg in sys.argv:
+               if z == 1:
+                       N = int(arg)
+               elif z == 2:
+                       NMAX = int(arg)
+               elif z == 3:
+                       NINC = int(arg)
+               elif z == 4:
+                       LOOPS = int(arg)
+
+               z = z + 1
+
+       if 'OPENBLAS_LOOPS' in os.environ:
+               p = os.environ['OPENBLAS_LOOPS']
+               if p:
+                       LOOPS = int(p);
+
+       print("From: %d To: %d Step=%d Loops=%d" % (N, NMAX, NINC, LOOPS))
+       print("\tSIZE\t\t\tFlops\t\t\t\t\tTime")
+
+       for i in range (N,NMAX+NINC,NINC):
+               run_sdot(i,LOOPS)
+
diff --git a/benchmark/scripts/NUMPY/sgemm.py b/benchmark/scripts/NUMPY/sgemm.py
new file mode 100755 (executable)
index 0000000..1680ec2
--- /dev/null
@@ -0,0 +1,56 @@
+#!/usr/bin/python
+
+import os
+import sys
+import time
+import numpy
+from numpy.random import randn
+
+def run_sgemm(N,l):
+
+       A = randn(N,N).astype('float32')
+       B = randn(N,N).astype('float32')
+
+       start = time.time();
+       for i in range(0,l):
+               ref = numpy.dot(A,B)
+       end = time.time()
+       
+       timediff = (end -start) 
+       mflops = ( 2*N*N*N) *l / timediff
+       mflops *= 1e-6
+
+       size = "%dx%d" % (N,N)
+       print("%14s :\t%20f MFlops\t%20f sec" % (size,mflops,timediff))
+
+
+if __name__ == "__main__":
+       N=128
+       NMAX=2048
+       NINC=128
+       LOOPS=1
+
+       z=0
+       for arg in sys.argv:
+               if z == 1:
+                       N = int(arg)
+               elif z == 2:
+                       NMAX = int(arg)
+               elif z == 3:
+                       NINC = int(arg)
+               elif z == 4:
+                       LOOPS = int(arg)
+
+               z = z + 1
+
+       if 'OPENBLAS_LOOPS' in os.environ:
+               p = os.environ['OPENBLAS_LOOPS']
+               if p:
+                       LOOPS = int(p);
+
+       print("From: %d To: %d Step=%d Loops=%d" % (N, NMAX, NINC, LOOPS))
+       print("\tSIZE\t\t\tFlops\t\t\t\t\tTime")
+
+       for i in range (N,NMAX+NINC,NINC):
+               run_sgemm(i,LOOPS)
+
diff --git a/benchmark/scripts/NUMPY/sgemv.py b/benchmark/scripts/NUMPY/sgemv.py
new file mode 100755 (executable)
index 0000000..3fe6add
--- /dev/null
@@ -0,0 +1,56 @@
+#!/usr/bin/python
+
+import os
+import sys
+import time
+import numpy
+from numpy.random import randn
+
+def run_sgemv(N,l):
+
+       A = randn(N,N).astype('float32')
+       B = randn(N).astype('float32')
+
+       start = time.time();
+       for i in range(0,l):
+               ref = numpy.dot(A,B)
+       end = time.time()
+       
+       timediff = (end -start) 
+       mflops = ( 2*N*N) *l / timediff
+       mflops *= 1e-6
+
+       size = "%dx%d" % (N,N)
+       print("%14s :\t%20f MFlops\t%20f sec" % (size,mflops,timediff))
+
+
+if __name__ == "__main__":
+       N=128
+       NMAX=2048
+       NINC=128
+       LOOPS=1
+
+       z=0
+       for arg in sys.argv:
+               if z == 1:
+                       N = int(arg)
+               elif z == 2:
+                       NMAX = int(arg)
+               elif z == 3:
+                       NINC = int(arg)
+               elif z == 4:
+                       LOOPS = int(arg)
+
+               z = z + 1
+
+       if 'OPENBLAS_LOOPS' in os.environ:
+               p = os.environ['OPENBLAS_LOOPS']
+               if p:
+                       LOOPS = int(p);
+
+       print("From: %d To: %d Step=%d Loops=%d" % (N, NMAX, NINC, LOOPS))
+       print("\tSIZE\t\t\tFlops\t\t\t\t\tTime")
+
+       for i in range (N,NMAX+NINC,NINC):
+               run_sgemv(i,LOOPS)
+
diff --git a/benchmark/scripts/NUMPY/zgemm.py b/benchmark/scripts/NUMPY/zgemm.py
new file mode 100755 (executable)
index 0000000..4556d4f
--- /dev/null
@@ -0,0 +1,56 @@
+#!/usr/bin/python
+
+import os
+import sys
+import time
+import numpy
+from numpy.random import randn
+
+def run_zgemm(N,l):
+
+       A = randn(N,N).astype('float64') + randn(N,N).astype('float64') * 1j;
+       B = randn(N,N).astype('float64') + randn(N,N).astype('float64') * 1j;
+
+       start = time.time();
+       for i in range(0,l):
+               ref = numpy.dot(A,B)
+       end = time.time()
+       
+       timediff = (end -start) 
+       mflops = ( 8*N*N*N) *l / timediff
+       mflops *= 1e-6
+
+       size = "%dx%d" % (N,N)
+       print("%14s :\t%20f MFlops\t%20f sec" % (size,mflops,timediff))
+
+
+if __name__ == "__main__":
+       N=128
+       NMAX=2048
+       NINC=128
+       LOOPS=1
+
+       z=0
+       for arg in sys.argv:
+               if z == 1:
+                       N = int(arg)
+               elif z == 2:
+                       NMAX = int(arg)
+               elif z == 3:
+                       NINC = int(arg)
+               elif z == 4:
+                       LOOPS = int(arg)
+
+               z = z + 1
+
+       if 'OPENBLAS_LOOPS' in os.environ:
+               p = os.environ['OPENBLAS_LOOPS']
+               if p:
+                       LOOPS = int(p);
+
+       print("From: %d To: %d Step=%d Loops=%d" % (N, NMAX, NINC, LOOPS))
+       print("\tSIZE\t\t\tFlops\t\t\t\t\tTime")
+
+       for i in range (N,NMAX+NINC,NINC):
+               run_zgemm(i,LOOPS)
+
diff --git a/benchmark/scripts/NUMPY/zgemv.py b/benchmark/scripts/NUMPY/zgemv.py
new file mode 100755 (executable)
index 0000000..ea69a19
--- /dev/null
@@ -0,0 +1,56 @@
+#!/usr/bin/python
+
+import os
+import sys
+import time
+import numpy
+from numpy.random import randn
+
+def run_zgemv(N,l):
+
+       A = randn(N,N).astype('float64') + randn(N,N).astype('float64') * 1j;
+       B = randn(N).astype('float64') + randn(N).astype('float64') * 1j;
+
+       start = time.time();
+       for i in range(0,l):
+               ref = numpy.dot(A,B)
+       end = time.time()
+       
+       timediff = (end -start) 
+       mflops = ( 8*N*N) *l / timediff
+       mflops *= 1e-6
+
+       size = "%dx%d" % (N,N)
+       print("%14s :\t%20f MFlops\t%20f sec" % (size,mflops,timediff))
+
+
+if __name__ == "__main__":
+       N=128
+       NMAX=2048
+       NINC=128
+       LOOPS=1
+
+       z=0
+       for arg in sys.argv:
+               if z == 1:
+                       N = int(arg)
+               elif z == 2:
+                       NMAX = int(arg)
+               elif z == 3:
+                       NINC = int(arg)
+               elif z == 4:
+                       LOOPS = int(arg)
+
+               z = z + 1
+
+       if 'OPENBLAS_LOOPS' in os.environ:
+               p = os.environ['OPENBLAS_LOOPS']
+               if p:
+                       LOOPS = int(p);
+
+       print("From: %d To: %d Step=%d Loops=%d" % (N, NMAX, NINC, LOOPS))
+       print("\tSIZE\t\t\tFlops\t\t\t\t\tTime")
+
+       for i in range (N,NMAX+NINC,NINC):
+               run_zgemv(i,LOOPS)
+
diff --git a/benchmark/scripts/OCTAVE/cgemm.m b/benchmark/scripts/OCTAVE/cgemm.m
new file mode 100755 (executable)
index 0000000..0e79e71
--- /dev/null
@@ -0,0 +1,56 @@
+#!/usr/bin/octave --silent 
+
+nfrom = 128 ;
+nto   = 2048;
+nstep = 128;
+loops = 1;
+
+
+arg_list = argv();
+for i = 1:nargin
+
+       switch(i)
+               case 1
+                       nfrom = str2num(arg_list{i});
+               case 2
+                       nto   = str2num(arg_list{i});
+               case 3
+                       nstep = str2num(arg_list{i});
+               case 4
+                       loops = str2num(arg_list{i});
+
+       endswitch
+
+endfor
+
+p = getenv("OPENBLAS_LOOPS");
+if p 
+       loops = str2num(p);
+endif
+
+printf("From %d To %d Step=%d Loops=%d\n",nfrom, nto, nstep, loops);
+printf("        SIZE             FLOPS             TIME\n");
+
+n = nfrom;
+while n <= nto
+
+       A = single(rand(n,n)) + single(rand(n,n)) * 1i;
+       B = single(rand(n,n)) + single(rand(n,n)) * 1i;
+       start = clock();
+
+       l=0;
+       while l < loops
+
+               C = A * B;
+               l = l + 1;
+
+       endwhile
+
+       timeg = etime(clock(), start);
+       mflops = ( 4.0 * 2.0*n*n*n *loops ) / ( timeg * 1.0e6 );
+
+       st1 = sprintf("%dx%d : ", n,n);
+       printf("%20s %10.2f MFlops %10.6f sec\n", st1, mflops, timeg);
+       n = n + nstep;
+
+endwhile
diff --git a/benchmark/scripts/OCTAVE/cgemv.m b/benchmark/scripts/OCTAVE/cgemv.m
new file mode 100755 (executable)
index 0000000..7237983
--- /dev/null
@@ -0,0 +1,56 @@
+#!/usr/bin/octave --silent 
+
+nfrom = 128 ;
+nto   = 2048;
+nstep = 128;
+loops = 1;
+
+
+arg_list = argv();
+for i = 1:nargin
+
+       switch(i)
+               case 1
+                       nfrom = str2num(arg_list{i});
+               case 2
+                       nto   = str2num(arg_list{i});
+               case 3
+                       nstep = str2num(arg_list{i});
+               case 4
+                       loops = str2num(arg_list{i});
+
+       endswitch
+
+endfor
+
+p = getenv("OPENBLAS_LOOPS");
+if p 
+       loops = str2num(p);
+endif
+
+printf("From %d To %d Step=%d Loops=%d\n",nfrom, nto, nstep, loops);
+printf("        SIZE             FLOPS             TIME\n");
+
+n = nfrom;
+while n <= nto
+
+       A = single(rand(n,n)) + single(rand(n,n)) * 1i;
+       B = single(rand(n,1)) + single(rand(n,1)) * 1i;
+       start = clock();
+
+       l=0;
+       while l < loops
+
+               C = A * B;
+               l = l + 1;
+
+       endwhile
+
+       timeg = etime(clock(), start);
+       mflops = ( 4.0 * 2.0*n*n *loops ) / ( timeg * 1.0e6 );
+
+       st1 = sprintf("%dx%d : ", n,n);
+       printf("%20s %10.2f MFlops %10.6f sec\n", st1, mflops, timeg);
+       n = n + nstep;
+
+endwhile
diff --git a/benchmark/scripts/OCTAVE/deig.m b/benchmark/scripts/OCTAVE/deig.m
new file mode 100755 (executable)
index 0000000..15c85af
--- /dev/null
@@ -0,0 +1,56 @@
+#!/usr/bin/octave --silent 
+
+nfrom = 128 ;
+nto   = 2048;
+nstep = 128;
+loops = 1;
+
+
+arg_list = argv();
+for i = 1:nargin
+
+       switch(i)
+               case 1
+                       nfrom = str2num(arg_list{i});
+               case 2
+                       nto   = str2num(arg_list{i});
+               case 3
+                       nstep = str2num(arg_list{i});
+               case 4
+                       loops = str2num(arg_list{i});
+
+       endswitch
+
+endfor
+
+p = getenv("OPENBLAS_LOOPS");
+if p 
+       loops = str2num(p);
+endif
+
+printf("From %d To %d Step=%d Loops=%d\n",nfrom, nto, nstep, loops);
+printf("        SIZE             FLOPS             TIME\n");
+
+n = nfrom;
+while n <= nto
+
+       A = double(rand(n,n));
+       start = clock();
+
+       l=0;
+       while l < loops
+
+               [V,lambda] = eig(A);
+               l = l + 1;
+
+       endwhile
+
+
+       timeg = etime(clock(), start);
+       mflops = ( 26.33 *n*n*n ) *loops / ( timeg * 1.0e6 );
+
+       st1 = sprintf("%dx%d : ", n,n);
+       printf("%20s %10.2f MFlops %10.6f sec\n", st1, mflops, timeg );
+       n = n + nstep;
+
+endwhile
diff --git a/benchmark/scripts/OCTAVE/dgemm.m b/benchmark/scripts/OCTAVE/dgemm.m
new file mode 100755 (executable)
index 0000000..da4f127
--- /dev/null
@@ -0,0 +1,56 @@
+#!/usr/bin/octave --silent 
+
+nfrom = 128 ;
+nto   = 2048;
+nstep = 128;
+loops = 1;
+
+
+arg_list = argv();
+for i = 1:nargin
+
+       switch(i)
+               case 1
+                       nfrom = str2num(arg_list{i});
+               case 2
+                       nto   = str2num(arg_list{i});
+               case 3
+                       nstep = str2num(arg_list{i});
+               case 4
+                       loops = str2num(arg_list{i});
+
+       endswitch
+
+endfor
+
+p = getenv("OPENBLAS_LOOPS");
+if p 
+       loops = str2num(p);
+endif
+
+printf("From %d To %d Step=%d Loops=%d\n",nfrom, nto, nstep, loops);
+printf("        SIZE             FLOPS             TIME\n");
+
+n = nfrom;
+while n <= nto
+
+       A = double(rand(n,n));
+       B = double(rand(n,n));
+       start = clock();
+
+       l=0;
+       while l < loops
+
+               C = A * B;
+               l = l + 1;
+
+       endwhile
+
+       timeg = etime(clock(), start);
+       mflops = ( 2.0*n*n*n *loops ) / ( timeg * 1.0e6 );
+
+       st1 = sprintf("%dx%d : ", n,n);
+       printf("%20s %10.2f MFlops %10.6f sec\n", st1, mflops, timeg);
+       n = n + nstep;
+
+endwhile
diff --git a/benchmark/scripts/OCTAVE/dgemv.m b/benchmark/scripts/OCTAVE/dgemv.m
new file mode 100755 (executable)
index 0000000..139b141
--- /dev/null
@@ -0,0 +1,56 @@
+#!/usr/bin/octave --silent 
+
+nfrom = 128 ;
+nto   = 2048;
+nstep = 128;
+loops = 1;
+
+
+arg_list = argv();
+for i = 1:nargin
+
+       switch(i)
+               case 1
+                       nfrom = str2num(arg_list{i});
+               case 2
+                       nto   = str2num(arg_list{i});
+               case 3
+                       nstep = str2num(arg_list{i});
+               case 4
+                       loops = str2num(arg_list{i});
+
+       endswitch
+
+endfor
+
+p = getenv("OPENBLAS_LOOPS");
+if p 
+       loops = str2num(p);
+endif
+
+printf("From %d To %d Step=%d Loops=%d\n",nfrom, nto, nstep, loops);
+printf("        SIZE             FLOPS             TIME\n");
+
+n = nfrom;
+while n <= nto
+
+       A = double(rand(n,n));
+       B = double(rand(n,1));
+       start = clock();
+
+       l=0;
+       while l < loops
+
+               C = A * B;
+               l = l + 1;
+
+       endwhile
+
+       timeg = etime(clock(), start);
+       mflops = ( 2.0*n*n *loops ) / ( timeg * 1.0e6 );
+
+       st1 = sprintf("%dx%d : ", n,n);
+       printf("%20s %10.2f MFlops %10.6f sec\n", st1, mflops, timeg);
+       n = n + nstep;
+
+endwhile
diff --git a/benchmark/scripts/OCTAVE/dsolve.m b/benchmark/scripts/OCTAVE/dsolve.m
new file mode 100755 (executable)
index 0000000..fff4b08
--- /dev/null
@@ -0,0 +1,59 @@
+#!/usr/bin/octave --silent 
+
+nfrom = 128 ;
+nto   = 2048;
+nstep = 128;
+loops = 1;
+
+
+arg_list = argv();
+for i = 1:nargin
+
+       switch(i)
+               case 1
+                       nfrom = str2num(arg_list{i});
+               case 2
+                       nto   = str2num(arg_list{i});
+               case 3
+                       nstep = str2num(arg_list{i});
+               case 4
+                       loops = str2num(arg_list{i});
+
+       endswitch
+
+endfor
+
+p = getenv("OPENBLAS_LOOPS");
+if p 
+       loops = str2num(p);
+endif
+
+printf("From %d To %d Step=%d Loops=%d\n",nfrom, nto, nstep, loops);
+printf("        SIZE             FLOPS             TIME\n");
+
+n = nfrom;
+while n <= nto
+
+       A = double(rand(n,n));
+       B = double(rand(n,n));
+       start = clock();
+
+       l=0;
+       while l < loops
+
+               x = linsolve(A,B);
+               #x = A / B;
+               l = l + 1;
+
+       endwhile
+
+
+       timeg = etime(clock(), start);
+       #r = norm(A*x - B)/norm(B)
+       mflops = ( 2.0/3.0 *n*n*n + 2.0*n*n*n ) *loops / ( timeg * 1.0e6 );
+
+       st1 = sprintf("%dx%d : ", n,n);
+       printf("%20s %10.2f MFlops %10.6f sec\n", st1, mflops, timeg );
+       n = n + nstep;
+
+endwhile
diff --git a/benchmark/scripts/OCTAVE/sgemm.m b/benchmark/scripts/OCTAVE/sgemm.m
new file mode 100755 (executable)
index 0000000..b79548b
--- /dev/null
@@ -0,0 +1,56 @@
+#!/usr/bin/octave --silent 
+
+nfrom = 128 ;
+nto   = 2048;
+nstep = 128;
+loops = 1;
+
+
+arg_list = argv();
+for i = 1:nargin
+
+       switch(i)
+               case 1
+                       nfrom = str2num(arg_list{i});
+               case 2
+                       nto   = str2num(arg_list{i});
+               case 3
+                       nstep = str2num(arg_list{i});
+               case 4
+                       loops = str2num(arg_list{i});
+
+       endswitch
+
+endfor
+
+p = getenv("OPENBLAS_LOOPS");
+if p 
+       loops = str2num(p);
+endif
+
+printf("From %d To %d Step=%d Loops=%d\n",nfrom, nto, nstep, loops);
+printf("        SIZE             FLOPS             TIME\n");
+
+n = nfrom;
+while n <= nto
+
+       A = single(rand(n,n));
+       B = single(rand(n,n));
+       start = clock();
+
+       l=0;
+       while l < loops
+
+               C = A * B;
+               l = l + 1;
+
+       endwhile
+
+       timeg = etime(clock(), start);
+       mflops = ( 2.0*n*n*n *loops ) / ( timeg * 1.0e6 );
+
+       st1 = sprintf("%dx%d : ", n,n);
+       printf("%20s %10.2f MFlops %10.6f sec\n", st1, mflops, timeg);
+       n = n + nstep;
+
+endwhile
diff --git a/benchmark/scripts/OCTAVE/sgemv.m b/benchmark/scripts/OCTAVE/sgemv.m
new file mode 100755 (executable)
index 0000000..1315288
--- /dev/null
@@ -0,0 +1,56 @@
+#!/usr/bin/octave --silent 
+
+nfrom = 128 ;
+nto   = 2048;
+nstep = 128;
+loops = 1;
+
+
+arg_list = argv();
+for i = 1:nargin
+
+       switch(i)
+               case 1
+                       nfrom = str2num(arg_list{i});
+               case 2
+                       nto   = str2num(arg_list{i});
+               case 3
+                       nstep = str2num(arg_list{i});
+               case 4
+                       loops = str2num(arg_list{i});
+
+       endswitch
+
+endfor
+
+p = getenv("OPENBLAS_LOOPS");
+if p 
+       loops = str2num(p);
+endif
+
+printf("From %d To %d Step=%d Loops=%d\n",nfrom, nto, nstep, loops);
+printf("        SIZE             FLOPS             TIME\n");
+
+n = nfrom;
+while n <= nto
+
+       A = single(rand(n,n));
+       B = single(rand(n,1));
+       start = clock();
+
+       l=0;
+       while l < loops
+
+               C = A * B;
+               l = l + 1;
+
+       endwhile
+
+       timeg = etime(clock(), start);
+       mflops = ( 2.0*n*n *loops ) / ( timeg * 1.0e6 );
+
+       st1 = sprintf("%dx%d : ", n,n);
+       printf("%20s %10.2f MFlops %10.6f sec\n", st1, mflops, timeg);
+       n = n + nstep;
+
+endwhile
diff --git a/benchmark/scripts/OCTAVE/zgemm.m b/benchmark/scripts/OCTAVE/zgemm.m
new file mode 100755 (executable)
index 0000000..a748437
--- /dev/null
@@ -0,0 +1,56 @@
+#!/usr/bin/octave --silent 
+
+nfrom = 128 ;
+nto   = 2048;
+nstep = 128;
+loops = 1;
+
+
+arg_list = argv();
+for i = 1:nargin
+
+       switch(i)
+               case 1
+                       nfrom = str2num(arg_list{i});
+               case 2
+                       nto   = str2num(arg_list{i});
+               case 3
+                       nstep = str2num(arg_list{i});
+               case 4
+                       loops = str2num(arg_list{i});
+
+       endswitch
+
+endfor
+
+p = getenv("OPENBLAS_LOOPS");
+if p 
+       loops = str2num(p);
+endif
+
+printf("From %d To %d Step=%d Loops=%d\n",nfrom, nto, nstep, loops);
+printf("        SIZE             FLOPS             TIME\n");
+
+n = nfrom;
+while n <= nto
+
+       A = double(rand(n,n)) + double(rand(n,n)) * 1i;
+       B = double(rand(n,n)) + double(rand(n,n)) * 1i;
+       start = clock();
+
+       l=0;
+       while l < loops
+
+               C = A * B;
+               l = l + 1;
+
+       endwhile
+
+       timeg = etime(clock(), start);
+       mflops = ( 4.0 * 2.0*n*n*n *loops ) / ( timeg * 1.0e6 );
+
+       st1 = sprintf("%dx%d : ", n,n);
+       printf("%20s %10.2f MFlops %10.6f sec\n", st1, mflops, timeg);
+       n = n + nstep;
+
+endwhile
diff --git a/benchmark/scripts/OCTAVE/zgemv.m b/benchmark/scripts/OCTAVE/zgemv.m
new file mode 100755 (executable)
index 0000000..10a0089
--- /dev/null
@@ -0,0 +1,56 @@
+#!/usr/bin/octave --silent 
+
+nfrom = 128 ;
+nto   = 2048;
+nstep = 128;
+loops = 1;
+
+
+arg_list = argv();
+for i = 1:nargin
+
+       switch(i)
+               case 1
+                       nfrom = str2num(arg_list{i});
+               case 2
+                       nto   = str2num(arg_list{i});
+               case 3
+                       nstep = str2num(arg_list{i});
+               case 4
+                       loops = str2num(arg_list{i});
+
+       endswitch
+
+endfor
+
+p = getenv("OPENBLAS_LOOPS");
+if p 
+       loops = str2num(p);
+endif
+
+printf("From %d To %d Step=%d Loops=%d\n",nfrom, nto, nstep, loops);
+printf("        SIZE             FLOPS             TIME\n");
+
+n = nfrom;
+while n <= nto
+
+       A = double(rand(n,n)) + double(rand(n,n)) * 1i;
+       B = double(rand(n,1)) + double(rand(n,1)) * 1i;
+       start = clock();
+
+       l=0;
+       while l < loops
+
+               C = A * B;
+               l = l + 1;
+
+       endwhile
+
+       timeg = etime(clock(), start);
+       mflops = ( 4.0 * 2.0*n*n *loops ) / ( timeg * 1.0e6 );
+
+       st1 = sprintf("%dx%d : ", n,n);
+       printf("%20s %10.2f MFlops %10.6f sec\n", st1, mflops, timeg);
+       n = n + nstep;
+
+endwhile
diff --git a/benchmark/scripts/R/deig.R b/benchmark/scripts/R/deig.R
new file mode 100755 (executable)
index 0000000..3521c7c
--- /dev/null
@@ -0,0 +1,62 @@
+#!/usr/bin/Rscript
+
+argv <- commandArgs(trailingOnly = TRUE)
+
+nfrom = 128
+nto = 2048
+nstep = 128
+loops = 1
+
+if ( length(argv) > 0 ) {
+
+       for ( z in 1:length(argv) ) {
+
+               if ( z == 1 ) {
+                       nfrom <- as.numeric(argv[z])
+               } else if ( z==2 ) {
+                       nto <- as.numeric(argv[z])
+               } else if ( z==3 ) {
+                       nstep <- as.numeric(argv[z])
+               } else if ( z==4 ) {
+                       loops <- as.numeric(argv[z])
+               }
+       }
+
+}
+
+p=Sys.getenv("OPENBLAS_LOOPS")
+if ( p != "" ) {
+       loops <- as.numeric(p)
+}      
+
+
+cat(sprintf("From %.0f To %.0f Step=%.0f Loops=%.0f\n",nfrom, nto, nstep, loops))
+cat(sprintf("      SIZE             Flops                   Time\n"))
+
+n = nfrom
+while ( n <= nto ) {
+
+       A <- matrix(runif(n*n), ncol = n, nrow = n, byrow = TRUE)
+       
+       l = 1
+
+       start <- proc.time()[3]
+
+       while ( l <= loops ) {
+
+               ev <- eigen(A)
+               l = l + 1
+       }
+
+       end <- proc.time()[3]
+       timeg = end - start
+       mflops = (26.66 *n*n*n ) * loops / ( timeg * 1.0e6 )
+
+       st = sprintf("%.0fx%.0f :",n , n)
+       cat(sprintf("%20s %10.2f MFlops %10.6f sec\n", st, mflops, timeg))
+
+       n = n + nstep
+
+}
+
+
diff --git a/benchmark/scripts/R/dgemm.R b/benchmark/scripts/R/dgemm.R
new file mode 100755 (executable)
index 0000000..f1c09c3
--- /dev/null
@@ -0,0 +1,63 @@
+#!/usr/bin/Rscript
+
+argv <- commandArgs(trailingOnly = TRUE)
+
+nfrom = 128
+nto = 2048
+nstep = 128
+loops = 1
+
+if ( length(argv) > 0 ) {
+
+       for ( z in 1:length(argv) ) {
+
+               if ( z == 1 ) {
+                       nfrom <- as.numeric(argv[z])
+               } else if ( z==2 ) {
+                       nto <- as.numeric(argv[z])
+               } else if ( z==3 ) {
+                       nstep <- as.numeric(argv[z])
+               } else if ( z==4 ) {
+                       loops <- as.numeric(argv[z])
+               }
+       }
+
+}
+
+p=Sys.getenv("OPENBLAS_LOOPS")
+if ( p != "" ) {
+       loops <- as.numeric(p)
+}      
+
+
+cat(sprintf("From %.0f To %.0f Step=%.0f Loops=%.0f\n",nfrom, nto, nstep, loops))
+cat(sprintf("      SIZE             Flops                   Time\n"))
+
+n = nfrom
+while ( n <= nto ) {
+
+       A <- matrix(runif(n*n), ncol = n, nrow = n, byrow = TRUE)
+       B <- matrix(runif(n*n), ncol = n, nrow = n, byrow = TRUE)
+       
+       l = 1
+
+       start <- proc.time()[3]
+
+       while ( l <= loops ) {
+
+               C <- A %*% B
+               l = l + 1
+       }
+
+       end <- proc.time()[3]
+       timeg = end - start
+       mflops = ( 2.0 *n*n*n ) * loops / ( timeg * 1.0e6 )
+
+       st = sprintf("%.0fx%.0f :",n , n)
+       cat(sprintf("%20s %10.2f MFlops %10.6f sec\n", st, mflops, timeg))
+
+       n = n + nstep
+
+}
+
+
diff --git a/benchmark/scripts/R/dsolve.R b/benchmark/scripts/R/dsolve.R
new file mode 100755 (executable)
index 0000000..6c6b77f
--- /dev/null
@@ -0,0 +1,63 @@
+#!/usr/bin/Rscript
+
+argv <- commandArgs(trailingOnly = TRUE)
+
+nfrom = 128
+nto = 2048
+nstep = 128
+loops = 1
+
+if ( length(argv) > 0 ) {
+
+       for ( z in 1:length(argv) ) {
+
+               if ( z == 1 ) {
+                       nfrom <- as.numeric(argv[z])
+               } else if ( z==2 ) {
+                       nto <- as.numeric(argv[z])
+               } else if ( z==3 ) {
+                       nstep <- as.numeric(argv[z])
+               } else if ( z==4 ) {
+                       loops <- as.numeric(argv[z])
+               }
+       }
+
+}
+
+p=Sys.getenv("OPENBLAS_LOOPS")
+if ( p != "" ) {
+       loops <- as.numeric(p)
+}      
+
+
+cat(sprintf("From %.0f To %.0f Step=%.0f Loops=%.0f\n",nfrom, nto, nstep, loops))
+cat(sprintf("      SIZE             Flops                   Time\n"))
+
+n = nfrom
+while ( n <= nto ) {
+
+       A <- matrix(runif(n*n), ncol = n, nrow = n, byrow = TRUE)
+       B <- matrix(runif(n*n), ncol = n, nrow = n, byrow = TRUE)
+       
+       l = 1
+
+       start <- proc.time()[3]
+
+       while ( l <= loops ) {
+
+               solve(A,B)
+               l = l + 1
+       }
+
+       end <- proc.time()[3]
+       timeg = end - start
+       mflops = (2.0/3.0 *n*n*n + 2.0 *n*n*n ) * loops / ( timeg * 1.0e6 )
+
+       st = sprintf("%.0fx%.0f :",n , n)
+       cat(sprintf("%20s %10.2f MFlops %10.6f sec\n", st, mflops, timeg))
+
+       n = n + nstep
+
+}
+
+