1 / 29

Numeric and Performance Issues of Java

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

angelina
Download Presentation

Numeric and Performance Issues of Java

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

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. 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

  4. Why not Java? • Performance • interpreters too slow • poor optimizing compilers • virtual machine

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

  6. Issues • performance • library/application support • numeric concerns • language features/limitations

  7. Performance

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

  9. 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

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

  11. 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++

  12. SciMark 2.0 results

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

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

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

  16. 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

  17. 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

  18. Numerical Software(Libraries)

  19. 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 Scientific Java Libraries

  20. 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

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

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

  23. 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.

  24. 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

  25. 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?

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

  27. 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

  28. 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...?

  29. 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

More Related