ERCIM News No.36 - January 1999

New Language on the Block: Java for High-Performance Computing?

by Mike Ashworth

The Java language is not only an emerging new technology in Web-based computing, but is starting to have a considerable influence in many IT-based science and engineering application areas. For example, it is emerging as a serious contender for use in High Performance Computing (HPC). At the CLRC Daresbury Laboratory, we are developing a multi-language approach in which Java is used as a front-end to existing HPC programming environments. This allows the utilization of high-performance legacy Fortran and C codes within a Java wrapper that facilitates the construction of Graphical User Interfaces (GUI) and access to Web-based client-server computing.

The Java language was designed by James Gosling at Sun Microsystems starting in 1990. It was first intended as a new language for embedded systems in consumer microelectronics, which led to the basic design features of Java: it is simple, object-oriented, architecture neutral, robust, secure and extensible. In 1993, as the World Wide Web was developing to a more graphically oriented interface, the Java team realised that Java also had ideal qualities for Web-based applications. Java has some similarities with C++, but it is much simpler. Many of the more advanced features of object-oriented programming, such as operator overloading, pointer arithmetic and multi-dimensional arrays, were left out.

How does Java work?

Java source is compiled to class files that contain machine-independent byte-code. This is like machine code in form but is not specific to any particular hardware. When a Java enabled client, such as Netscape or Internet Explorer, accesses a page containing a Java applet (a small Java application embedded in a Web page), the byte-code is downloaded and runs on the client’s own hardware using an interpreter known as the Java Virtual Machine. Because Java is compiled to byte-code, it can run on any platform for which an interpreter has been written. Java is small so it can run efficiently on anything from PCs upwards, and the interpreter takes only a few hundred kilobytes.

Java and High Performance Computing

Java is more efficient than other scripts, but it is still very slow compared to traditional languages. Even if compiled to native machine code, there are features in the language that make it currently impossible for native Java compilers to apply the normal optimizations which allow Fortran and C programs fully to exploit the hardware of state-of-the-art. For example, security considerations in Java demand that all array references are checked for out-of-bounds indexes at run-time, which effectively kills performance for computational loop kernels. Experiments at IBM have shown that if this checking can be performed at compile-time and the compiler is allowed to make other optimizations, Java code improves from 1% of Fortran to 80-100%.

Vendors, software developers and computer users in the US have formed a group known as Java Grande, which believes that Java has the potential to be a better environment for HPC than any previous language. The Java Grande Forum aims to develop a consensus for the use of Java for Grande applications and to make recommendations for changes to the Java standard and for the establishment of standards for libraries and services. Interest is also growing in the UK. The First UK Workshop on Java for High Performance Network Computing was held at Euro-Par ‘98 in Southampton in September 1998. There are currently moves to form a UK Java Grande Forum similar in style to the US Forum, but with a greater emphasis on the services and tools required by high performance applications.

Java, HPC and the Web

The World Wide Web was conceived as a means of accessing information, but it is increasingly evolving towards a means of providing services. A major sea change is happening on the Internet, due in no small part to the emergence of the Java programming language. Java is expanding rapidly and comes complete with a wide range of class libraries and toolkits for Web access, thread based computing and GUIs.

Although the popular image of the Web has been as a global information provider, this has not been its only manifestation. Increasingly, organisations are setting up an Intranet - a corporate Web server providing internal information and services. In an industrial R&D environment, the Intranet may enable access for everyone in a department to the technical designs and specifications of a new product together with the project specifications, modification records, test procedures, test results, marketing information etc.

It is in this environment that we see the major benefits of integrating Java, with its support for Web-based computing, with traditional high-performance programming using Fortran and C. This vision is of a new type of multi-language multi-paradigm programming environment for high performance applications which makes use of innovative Web-based and GUI technologies provided by Java and provides a high performance and simple API and a high level of portability and flexibility for large-scale applications. It emphasises the strengths of each component: Java allows easy access to Web-based computing and facilitates the construction of GUIs; Fortran and C allow large-scale applications best to exploit high performance hardware.

Please contact:

Mike Ashworth - CLRC
Tel: +44 1925 60 3663

return to the ERCIM News 36 contents page