Details
Description
It would be really beneficial for BEAM and NEST algorithm developers to use a single, high-performance linear algebra library. BEAM should be bundled with this library and it should replace the JAMA library currently used (http://math.nist.gov/javanumerics/jama/).
The new Java LA library shall
o be the output of an active open-source project
o be very fast, ideally comparable to well known native libs such as LAPACK / BLAS.
o have an easy and comprehensive API, which shall not be too invasive and stick to primitive arrays whenever possible
JAMA may be indeed too slow for operations on big matrices:
===================================================================
Petar Marinkovic (NEST-DORIS Team) wrote:
"Most of the InSAR functionalities require some complex or float linear algebra operations. Java native linear algebra operations (package org.esa.beam.util.math), with overhead coming with the complex class data type is not efficient enough.
Since recently I started using Jblas (www.jblas.org) libraries: Java wrapper for platform precompiled BLAS. Some benchmarks (per core) for n number of elements:
Running benchmark "Java matrix multiplication, single precision".
n = 10 : 1084.9 MFLOPS (2712261 iterations in 5.0 seconds)
n = 100 : 2057.7 MFLOPS (5145 iterations in 5.0 seconds)
n = 1000 : 2416.7 MFLOPS (7 iterations in 5.8 seconds)
Running benchmark "JBlas matrix multiplication, single precision".
n = 10 : 1024.7 MFLOPS (2561805 iterations in 5.0 seconds)
n = 100 : 10789.8 MFLOPS (26975 iterations in 5.0 seconds)
n = 1000 : 16453.9 MFLOPS (42 iterations in 5.1 seconds)
The level of efficiency increases with the size of the input matrix. It also supports complex numbers, with the similar performance. The library was relatively recently released, and we should be very critical in terms of level of support and whether its mature to be used. This seems to be the most efficient linear algebra library, with the complex numbers support, for Java. And in some form would be part of NEST-DORIS, with checks on the platform compatibility. The question is, whether using this library in the other NEST/BEAM core classes would be needed."
===================================================================
The new Java LA library shall
o be the output of an active open-source project
o be very fast, ideally comparable to well known native libs such as LAPACK / BLAS.
o have an easy and comprehensive API, which shall not be too invasive and stick to primitive arrays whenever possible
JAMA may be indeed too slow for operations on big matrices:
===================================================================
Petar Marinkovic (NEST-DORIS Team) wrote:
"Most of the InSAR functionalities require some complex or float linear algebra operations. Java native linear algebra operations (package org.esa.beam.util.math), with overhead coming with the complex class data type is not efficient enough.
Since recently I started using Jblas (www.jblas.org) libraries: Java wrapper for platform precompiled BLAS. Some benchmarks (per core) for n number of elements:
Running benchmark "Java matrix multiplication, single precision".
n = 10 : 1084.9 MFLOPS (2712261 iterations in 5.0 seconds)
n = 100 : 2057.7 MFLOPS (5145 iterations in 5.0 seconds)
n = 1000 : 2416.7 MFLOPS (7 iterations in 5.8 seconds)
Running benchmark "JBlas matrix multiplication, single precision".
n = 10 : 1024.7 MFLOPS (2561805 iterations in 5.0 seconds)
n = 100 : 10789.8 MFLOPS (26975 iterations in 5.0 seconds)
n = 1000 : 16453.9 MFLOPS (42 iterations in 5.1 seconds)
The level of efficiency increases with the size of the input matrix. It also supports complex numbers, with the similar performance. The library was relatively recently released, and we should be very critical in terms of level of support and whether its mature to be used. This seems to be the most efficient linear algebra library, with the complex numbers support, for Java. And in some form would be part of NEST-DORIS, with checks on the platform compatibility. The question is, whether using this library in the other NEST/BEAM core classes would be needed."
===================================================================
A page providing useful benchmarks is http://code.google.com/p/java-matrix-benchmark/