From Flop to Megaflops: Java for Technical Computing - CiteSeerX

38 downloads 1190 Views 284KB Size Report
piler for Java (HPCJ) [Seshadri 1997], and achieves a performance of 5 Mflops on the .... any region needing at least one test as needing all tests. We do this for ...
From Flop to Megaflops: Java for Technical Computing JOSE´ E. MOREIRA, SAMUEL P. MIDKIFF, and MANISH GUPTA IBM Thomas J. Watson Research Center

Although there has been some experimentation with Java as a language for numerically intensive computing, there is a perception by many that the language is unsuited for such work because of performance de ciencies. In this article we show how optimizing array bounds checks and null pointer checks creates loop nests on which aggressive optimizations can be used. Applying these optimizations by hand to a simple matrix-multiply test case leads to Java-compliant programs whose performance is in excess of 500 M ops on a four-processor 332MHz RS/6000 model F50 computer. We also report in this article the e ect that various optimizations have on the performance of six oating-point-intensive benchmarks. Through these optimizations we have been able to achieve with Java at least 80% of the peak Fortran performance on the same benchmarks. Since all of these optimizations can be automated, we conclude that Java will soon be a serious contender for numerically intensive computing. Categories and Subject Descriptors: D.3,4 [Programming Languages]: Processor—compilers; run-time environments; D.1.3 [Programming Techniques]: Concurrent Programming—parallel programming

General Terms: Languages, Performance Additional Key Words and Phrases: Arrays, Compilers, Java

1. INTRODUCTION The scientific programming community has demonstrated a great deal of interest in the use of Java1 for technical computing. There are many compelling reasons for such interest. First and foremost, Java enjoys growing popularity and an expanding programmer base. In addition, Java is object-oriented without excessive complications (in contrast to C++), and has support for networking and graphics. These features of Java are particularly important as technical computing continues to move toward a network-centric model of computation. In this context, it is expected that Java will first be used where it is most natural: for visualization and networking components. Eventually, Java will spread into the core computational components of technical applications. Nevertheless, performance remains a major obstacle to the pervasive use of Java in technical computing. Let us start by looking into the performance of a simple matrix-multiply routine in Java, as shown in Figure 1. This routine computes C = C + A  B , where 1 Java is a trademark of Sun Microsystems, Inc.

Authors’ address: IBM Thomas J. Watson Research Center, PO Box 218, Yorktown Heights, NY 10598-0218; email: jmoreira;smidkiff;mgupta @us.ibm.com. Permission to make digital/hard copy of all or part of this material without fee is granted provided that the copies are not made or distributed for profit or commercial advantage, the ACM copyright/server notice, the title of the publication, and its date appear, and notice is given that copying is by permission of the Association for Computing Machinery, Inc. (ACM). To copy otherwise, to republish, to post on servers, or to redistribute to lists requires prior specific permission and/or a fee. c 1999 ACM 0164-0925/99/0100-0111 $00.75

f

g

ACM Transactions on Programming Languages and Systems Vol. X, No. y, Month 1999, Pages 1–29.

2



Jose´ E. Moreira et al.

static void matmul(double[][] A, double[][] B, double[][] C, int m, int n, int p) { int i, j, k; for (i=0; i

Suggest Documents