250 likes | 355 Views
The role of virtual machine technologies for scientific computing. Roldan Pozo Mathematical Software Group National Institute of Standards and Technology. Clusters and Computational Grids for Scientific Computing 9-28-2004.
E N D
The role of virtual machine technologies for scientific computing Roldan Pozo Mathematical Software Group National Institute of Standards and Technology Clusters and Computational Grids for Scientific Computing 9-28-2004
Java and .NET for numerics • what works • what doesn’t • what can be improved • what can we realistically expect
Why we originally looked at Java • portability of the Java Virtual Machine (JVM) • minimize memory leaks and pointer errors • security model • network-aware environment • Parallel and Distributed computing • Threads • Remote Method Invocation (RMI) • Integrated graphics • Widely adopted • embedded systems, browsers, devices • widely adopted for teaching, development
Microsoft .NET • provides portable executables and runtime environment • based on Windows Win32 API • C# is the canonical language for .NET • compilers (C#, C++, Fortran, Basic) target same platform • interoperability from different languages • ECMA Standard Specification for C# and CLI • Shared Source CLI (Rotor) available for • Windows XP, FreeBSD, Mac OS X
Java concerns • Performance • early JVMs too slow • poor optimizing compilers • virtual machine • security model • array bounds checking
Java concerns • lack of scientific software • computational libraries • numerical interfaces • considerable effort to port from f77/C/C++ • no universal translator
Java Numerics Working Group • industry-wide consortium to establish tools, APIs, and libraries • Sun, IBM, Intel, Compaq/Digital/HP MathWorks, VNI, NAG • component of Java Grande Forum • updated Java’s floating-point model • served as focal point for numeric activities • proposals and implementations for • complex, arrays, mult-adds, fdlibm • libraries, compilers, language extensions
Numeric issues • array bounds checking • floating point model subset of IEEE 754 • no IEEE extended formats (80 bit FPU stack) • many compiler optimizations (e.g. associativity) disallowed • cannot use hardware acceleration • e.g no mapping sin(x) to x86 opcodes • no fused multiply-adds
What we needed • floating point model • true multidimensional arrays • complex data types • lightweight objects • operator overloading • generic typing (templates)
Java Linear Algebra Libraries • JAMA (NIST & MathWorks) • provides APIs and implementations for • basic vector, matrix operations • LU, QR, SVD and Cholesky factorizations • Eigenvalue decompositions • JLAPACK (UTK) • JamPack (NIST & UMD)
SciMark Benchmark • Numerical benchmark for Java, C/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 Pozo, Miller (NIST) Java & C, Werner Vogels (Cornell, Rotor HPC Project) C#
SciMark database of results • Over 2,200 separate results for • Hardware platforms • laptops, desktops, and PDAs: Intel, Apple, Sun, IBM, Apple, Sharp, AMD • Java Virtual Machines (JVM) • Sun, IBM, Apple, Blackdown, Microsoft, Compaq, HP, Symantec, Netscape, BEA, NSIcom, Golden Code, FreeBSD • Operating Systems • Windows 95/98/2000/ME/NT/XP, OS/2, AIX, NetBSD, Linux, IRIX, FreeBSD, Ultrix, Solaris, SunOS, Apple OS X, Compaq, NETWARE, OSF1
JVMs have improved over time(Scimark scores) SciMark : 333 MHz Sun Ultra 10
SciMark: Java, C, C#Large out-of-cache problem sizes gcc -O6 -funroll-all-loops Borland bcc32 -6 -0 (Intel P4 2.5GHz, Windows XP .NET MS C/C++ v. 13.10)
SciMark: Java, C, C#Small in-cache problem sizes gcc -O6 -funroll-all-loops Borland bcc32 -6 -0 Intel P4 2.5GHz, Windows XP .NET MS C/C++ v. 13.10 .NET C# v. 7.0)
C# multiarray performanceScimark small in-cache problem sizes (Intel P4 2.8GHz, Windows XP, CLR v. 1.0.3705.288)
Fortran performance in .NETTime (secs) for Polyhedron 2004 F90 Benchmarks FTN95: Salford FTN95 /omptimize /p6 FTN95.NET: Salford FTN95 /optimize /clr Intel: ifort /03 /Qipo /QxN /link /stack: 64000000 3.06 GHz Intel Pentium 4, 512K cache, 768 MB Windows XP Pro
Java and Fortran PerformanceIBM High Performance Fortran compiler (Moriera, et. al.) *IBM RS/6000 67MHz POWER2 (266 Mflops peak) AIX Fortran, HPJC
Java Numerical Software • General • Apflot, Colt, JADE, Java3D (matrix), ArciMath BigDecimal, IBM Alphaworks, Jsci, Spline++, JMSL (Visual Numerics), jCrunch, mpjava, RngPack, OpsResearch, • Linear Algebra • JAMA, Jampack, Java LAPACK, Matrix Toolkit, Owlpack, JSP • Language extensions (compilers) • multi-dimensional arrays (IBM), complex numbers (zeta) , HPJava, Cj, Titanium
Scientific .NET Software • Center Space Software: NMath library • mathematical, financial, engineering, scientific • linear algebra, random numbers, integration, interpolation, statistics, linear regression • native interface to BLAS/LAPACK • callable from any .NET language • .NET Analytics: dnAnalytics library • complex, double matrices, LU, Cholesky, QR, SVD • Matrix Library in C# or with native interfaces • native interface to ATLAS, CLAPACK, Intel’s MKL, Apple’s Vector Library (veclib) • Compatible with Mono on Windows, Linux, MacOS
Java Conclusions • Java’s strength: • binary portability; single software distribution • competitive performance • strict security model; numerical reproducibility • Java’s obstacles: • no standard support for multidimensional arrays, complex numbers, and operator overloading • limited numeric software and library support • no blind conversion of C/C++/Fortran codes • Can be solved (technologically) • but need standards and support
.NET/C# Conclusions • .NET’s strengths: • common platforms for Microsoft languages • shared source CLI (Rotor) implementation, ECMA standard • interlanguage compatibility (Fortran, C/C++) • competitive performance • C# provides structs, operator overloading, multiarrays • more flexible security model; limited reproducibility • .NET’s obstacles: • not as widely available on all platforms • various projects (e.g. Mono, Rotor) are addressing this • compatibility with Fortran and ANSI C/C++ is not 100% • limited numeric software and library support • Can be solved but also need standards and support
Resources • Java Numerics Working Group • math.nist.gov/JavaNumerics • Java Grande Benchmarks • www.javagrande.org • SciMark • (Java, C ) math.nist.gov/SciMark • (C#, .NET) rotor.cs.cornell.edu/SciMark/