Presentation is loading. Please wait.

Presentation is loading. Please wait.

Numeric and Performance Issues of Java Roldan Pozo Leader, Mathematical Software Group National Institute of Standards and Technology.

Similar presentations


Presentation on theme: "Numeric and Performance Issues of Java Roldan Pozo Leader, Mathematical Software Group National Institute of Standards and Technology."— Presentation transcript:

1 Numeric and Performance Issues of Java Roldan Pozo Leader, Mathematical Software Group National Institute of Standards and Technology

2 Numeric and Performance Issues of Java for Grid Computing! Roldan Pozo Leader, Mathematical Software Group National Institute of Standards and Technology

3 Background: Where we are coming from... National Institute of Standards and Technology –US Department of Commerce –NIST (3,000 employees, mainly scientists and engineers) Many areas of responsibility –building & fire research –low-temperature physics –materials science –metrology / combinatorial experiments –bio-informatics

4 Mathematical & Computational Sciences Division Originally established to work with NIST scientists Transfer of research software/algorithm technologies to US Industry Applications: Fortran, C, C++, Matlab, Mathematica, GAUSS, Perl, Expect, Tcl/TK,... middle to large-scale computing domain (single workstation to clusters)

5 Why Java? Portability of the Java Virtual Machine (JVM) Safe, minimize memory leaks and pointer errors Security model Network-aware environment Parallel and Distributed computing: threads, RMI standard interfaces for graphics, GUIs, databases, etc. Widely adopted

6 Portability Binary portability is Java’s greatest strength –several million JDK downloads –Java developers for intranet applications greater than C, C++, and Basic combined JVM bytecodes are the key many languages can generate Java bytecodes Issue: –can performance be obtained at bytecode level?

7 Why not Java? Performance –interpreters too slow –poor optimizing compilers –virtual machine

8 Why not Java? lack of scientific software –computational libraries –numerical issues/interfaces –major effort to port from f77/C

9 Issues performance library/application support numeric concerns language features/limitations

10 Performance

11 What are we really measuring? language vs. virtual machine (VM) Java -> bytecode translator bytecode execution (VM) –interpreted –just-in-time compilation (JIT) –adaptive compilers (HotSpot) underlying hardware

12 Matrix multiply optimized (100% Pure Java) * Pentium II I 500Mhz; java JDK 1.2 (Win98) 2-level blocking: 40x40, 8x8

13 Java Benchmarking Efforts Caffine Mark SPECjvm98 Java Linpack Java Grande Forum Benchmarks SciMark Image/J benchmark BenchBeans VolanoMark Plasma benchmark RMI benchmark JMark JavaWorld benchmark...

14 SciMark Benchmark Numerical benchmark for Java, C/C++ composite results for five kernels: –FFT (complex, 1D) –Successive Over-relaxation –Monte Carlo integration –Sparse matrix multiply –dense LU factorization results in Mflops two sizes: small, large

15 http://math.nist.gov/scimark

16 SciMark results over 200 platforms (OS/CPU/JVM) deployed from one mouse click –numerical libraries –instrumentation/analysis –optional database collection impossible to do in Fortran/C/C++

17 SciMark 2.0 results

18 JVMs have improved over time SciMark : 333 MHz Sun Ultra 10

19 SciMark: Java vs. C (Sun UltraSPARC 60) * Sun JDK 1.3 (HotSpot), javac -0; Sun cc -0; SunOS 5.7

20 SciMark: Java vs. C (Intel PIII 500MHz, Linux) * RH Linux 6.2, gcc (v. 2.91.66) -06, IBM JDK 1.3, javac -O

21 Current JVMs aren’t so bad... Scimark high score: 323 Mflops * –FFT: 271 Mflops –Jacobi: 353 Mflops –Monte Carlo: 60 Mflops –Sparse matmult: 308 –LU factorization: 621 Mflops * 1.5 GHz AMD Athlon, IBM 1.3.1, OS/2

22 Making Java fast(er) Native methods (JNI) stand-alone compliers (.java ->.exe) modified JVMs –(fused mult-adds, bypass array bounds checking) aggressive bytecode optimization –JITs, HotSpot, etc. bytecode transformers concurrency: threads, RMI

23 Numerical Software (Libraries)

24 Scientific Java Libraries Matrix library (JAMA) –NIST/Mathworks –LU, QR, SVD, eigenvalue solvers Java Numerical Toolkit (JNT) –special functions –quadrature –random numbers –BLAS subset IBM –Array class package Univ. of Maryland –Linear Algebra library JLAPACK –port of LAPACK COLT Visual Numerics –LINPACK –Complex

25 Java Numerics Group industry-wide consortium to establish tools, APIs, and libraries –IBM, Intel, Compaq/Digital/HP, Sun, MathWorks, VNI, NAG –NIST, Inria –Berkeley, UCSB, Austin, MIT, Indiana component of Java Grande Forum –Concurrency group

26 Scientific Java Resources Java Numerics Group –http://math.nist.gov/javanumerics Java Grande Forum –http://www.javagrade.org SciMark Benchmark –http://math.nist.gov/scimark

27 Java Numerics Issues Virtual Machine –reproducability: IEEE floating point model –multidimensonal arrays –complex data types –lightweight objects Language –operator overloading –generic typing (templates)

28 Floating point model binary reproducability hard for numerics floating point model based on Sun architecture... –IEEE 754 standard, no extended formats –on other platforms (Intel, IBM, Alpha) must round down: up to 10x performance hit –solved by relaxing JVM model: extended exponents OK, use strictfp otherwise.

29 Floating Point Model (cont’d) Elementary functions – loose definition based on Sun C lib –e.g. on x86: hardware sin(x) = x for x>2^64 –solved by allowing results to vary in 1 ulp –use StrictMath library otherwise Fused Multiply-Adds (FMAs) –available on many platforms, 50% hit –discussed, but not yet resolved

30 Java Arrays 1-d array size limited to 2^32 elements multi-arrays ala C: A[i][j] need Fortran-like arrays for best optimization –no aliasing of subsections –map to 1-d vector proposed ‘row-major’ contiguous array class – use A.get(i,j): ugly & slow?

31 Java vs. Fortran Performance *IBM RS/6000 67MHz POWER2 (266 Mflops peak) AIX Fortran, HPJC

32 Complex numbers / Lightweight Objects class has wrong semantics (x = = y) can’t return/pass by value temporaries can clog garbage collection solutions: –add complex native type to JVM (?) –allow lightweight objects (C structs) general solution for intervals, multiprecision, etc. requires new category of variables in JVM –use preprocessor to unroll complex operations

33 Java Language Issues operator overloading –numeric community makes best case –unlikely to be introduced into the language –can be solved by external preprocessors templates (generics) –proposal for Generic Java (GJ) passed through standardization process Is Java a language issue at all...?

34 Conclusions Java’s biggest strength for scientific computing: binary portability, dynamic distribution Java numerics performance can be competitive –can achieve efficiency of optimized C/Fortran –will it, depends on economics -- not technology best Java performance on commodity platforms improving Java numerics: –integrate true array and complex into Java standard –more libraries and numerical software support


Download ppt "Numeric and Performance Issues of Java Roldan Pozo Leader, Mathematical Software Group National Institute of Standards and Technology."

Similar presentations


Ads by Google