Full HTML for

Basic foilset Java Access to Numerical Libraries: Compiling Fortran to Java

Given by Jack Dongarra, Christian Deane, Keith Seymour, Clint Whaley at SC98 Orlando Java Grande Panel on November 13 98. Foils prepared December 6 98
Outside Index Summary of Material


Java Grande Forum Homepage
SC98 Java Grande Panel Presentation
Motivation and Implementation of Translation of LAPACK into Java
Discussion of I/O GOTO and futures
ATLAS automatic BLAS Optimization and extension to Java

Table of Contents for full HTML of Java Access to Numerical Libraries: Compiling Fortran to Java

Denote Foils where Image Critical
Denote Foils where Image has important information
Denote Foils where HTML is sufficient

1 Java Access to Numerical Libraries: Compiling Fortran to Java
2 Motivation
3 LAPACK
4 Why Higher Level BLAS?
5 LAPACK
6 PPT Slide
7 PPT Slide
8 PPT Slide
9 PPT Slide
10 PPT Slide
11 PPT Slide
12 PPT Slide
13 How To Get Performance From Commodity Processors?
14 What is ATLAS
15 Why ATLAS is needed
16 Code Generation Strategy
17 PPT Slide
18 PPT Slide
19 Multithreaded BLAS for Performance
20 ATLAS
21 What is needed to use ATLAS with Java:
22 Test Results for Matrix Multiply UltraSparc 2200 (200 MHz, peak of 400 Mflop/s)
23 Futures

Outside Index Summary of Material



HTML version of Basic Foils prepared December 6 98

Foil 1 Java Access to Numerical Libraries: Compiling Fortran to Java

From Java Access to Numerical Libraries: Compiling Fortran to Java SC98 Orlando Java Grande Panel -- November 13 98. *
Full HTML Index
Jack Dongarra
Christian Deane
Keith Seymour
Clint Whaley
University of Tennessee
Oak Ridge National Laboratory

HTML version of Basic Foils prepared December 6 98

Foil 2 Motivation

From Java Access to Numerical Libraries: Compiling Fortran to Java SC98 Orlando Java Grande Panel -- November 13 98. *
Full HTML Index
Provide well-known and reliable libraries
Avoid re-writing numerical code
Quick and reliable translation
Performance

HTML version of Basic Foils prepared December 6 98

Foil 3 LAPACK

From Java Access to Numerical Libraries: Compiling Fortran to Java SC98 Orlando Java Grande Panel -- November 13 98. *
Full HTML Index
Linear Algebra library in Fortran 77 (binding to c)
  • State of the art numerical routines
  • Extensive coverage
  • Solution of systems of equations
  • Solution of eigenvalue problems
Block algorithms
  • Parameterized for memory hierarchies
    • Built on the Level 1, 2, and 3 BLAS
  • Efficient on a wide range of computers
    • RISC, Vector, SMPs
User interface provides similar calls in:
  • Single, Double, Complex, Double Complex
Used by vendors: HP-48G to Teraflop/s Machines

HTML version of Basic Foils prepared December 6 98

Foil 4 Why Higher Level BLAS?

From Java Access to Numerical Libraries: Compiling Fortran to Java SC98 Orlando Java Grande Panel -- November 13 98. *
Full HTML Index
Can only do arithmetic on data at the top of the hierarchy
Higher level BLAS lets us do this
Development of blocked algorithms important for performance

HTML version of Basic Foils prepared December 6 98

Foil 5 LAPACK

From Java Access to Numerical Libraries: Compiling Fortran to Java SC98 Orlando Java Grande Panel -- November 13 98. *
Full HTML Index
600K lines of code
extensive test package
developed over 10 years with input from the linear algebra community
state of the art methods
Automatically translate to Java

HTML version of Basic Foils prepared December 6 98

Foil 6 PPT Slide

From Java Access to Numerical Libraries: Compiling Fortran to Java SC98 Orlando Java Grande Panel -- November 13 98. *
Full HTML Index
Outline of Project
Phase 1: Write Fortran front end to lex and parse subset Fortran 77.
Phase 2: Generate Java source and Jasmin assembly code for use with JVM.
Phase 3: Test, document and distribute BLAS and LAPACK class files.

HTML version of Basic Foils prepared December 6 98

Foil 7 PPT Slide

From Java Access to Numerical Libraries: Compiling Fortran to Java SC98 Orlando Java Grande Panel -- November 13 98. *
Full HTML Index
Array Access/Argument Passing
All arrays are declared as 1D and accessed with index arithmetic.
Array indices must be passed separately as arguments, which changes the user interface.
Primitives are passed in object wrappers to emulate pass-by-reference (only when needed, though).

HTML version of Basic Foils prepared December 6 98

Foil 8 PPT Slide

From Java Access to Numerical Libraries: Compiling Fortran to Java SC98 Orlando Java Grande Panel -- November 13 98. *
Full HTML Index
GOTO Translation
First Step
Try to identify Fortran constructs containing GOTO statements that can be translated to equivalent Java constructs (which cannot contain a goto statement).
10 CONTINUE
IF(C .EQ. ONE) THEN
A = 2 * A
GO TO 10
END IF
while(c == one)
{
a = 2 * a;
}

HTML version of Basic Foils prepared December 6 98

Foil 9 PPT Slide

From Java Access to Numerical Libraries: Compiling Fortran to Java SC98 Orlando Java Grande Panel -- November 13 98. *
Full HTML Index
GOTO Translation
Second Step
Remaining GOTO statements must be transformed at the bytecode level.
Bytecode Transformer
Use bytecode parsing code from javab (Indiana University) .
Provides efficient translation of GOTO statements.

HTML version of Basic Foils prepared December 6 98

Foil 10 PPT Slide

From Java Access to Numerical Libraries: Compiling Fortran to Java SC98 Orlando Java Grande Panel -- November 13 98. *
Full HTML Index
Input/Output
Small subset of WRITE/FORMAT has been implemented -- just enough to allow translation of BLAS/LAPACK test routines.
Some unformatted READ statements supported.
File I/O not supported yet, but may be necessary for future testing.

HTML version of Basic Foils prepared December 6 98

Foil 11 PPT Slide

From Java Access to Numerical Libraries: Compiling Fortran to Java SC98 Orlando Java Grande Panel -- November 13 98. *
Full HTML Index
Current Status of Project
f2j: formal compiler of Fortran 77 subset sufficient for BLAS, LAPACK and other numerical libraries.
Most I/O statements are not fully supported.
Double precision BLAS levels 1, 2, and 3 successfully tested.
Double precision LAPACK routines successfully tested.
released: May 22, 1998

HTML version of Basic Foils prepared December 6 98

Foil 12 PPT Slide

From Java Access to Numerical Libraries: Compiling Fortran to Java SC98 Orlando Java Grande Panel -- November 13 98. *
Full HTML Index
Future of Fortran-to-Java Project
Extend to wider subsets of Fortran and translate more numerical libraries.
Support for Complex data type.
Provide a large reliable Java numerical software repository.
Focus on optimization

HTML version of Basic Foils prepared December 6 98

Foil 13 How To Get Performance From Commodity Processors?

From Java Access to Numerical Libraries: Compiling Fortran to Java SC98 Orlando Java Grande Panel -- November 13 98. *
Full HTML Index
Today's processors can achieve high-performance, but this requires extensive machine-specific hand tuning.
Routines have a large design space w/many parameters
  • blocking sizes, loop nesting permutations, loop unrolling depths, software pipelining strategies, register allocations, and instruction schedules.
  • Complicated interactions with the increasingly sophisticated microarchitectures of new microprocessors.
A few months ago no tuned BLAS for Pentium for Linux.
Need for quick deployment of optimized routines.
ATLAS - Automatic Tuned Linear Algebra Software

HTML version of Basic Foils prepared December 6 98

Foil 14 What is ATLAS

From Java Access to Numerical Libraries: Compiling Fortran to Java SC98 Orlando Java Grande Panel -- November 13 98. *
Full HTML Index
A package that adapts itself to differing architectures via code generation coupled with timing
  • Initially, supply BLAS
Package contains:
  • Code generators
  • Sophisticated timers
  • Robust search routines
Currently provided:
  • Real matrix matrix multiply
    • 1-2 hours install time

HTML version of Basic Foils prepared December 6 98

Foil 15 Why ATLAS is needed

From Java Access to Numerical Libraries: Compiling Fortran to Java SC98 Orlando Java Grande Panel -- November 13 98. *
Full HTML Index
BLAS require many man-hours / platform
  • Only done if financial incentive is there
    • Many platforms will never have an optimal version
  • Lags behind hardware
  • May not be affordable by everyone
Operations may be important, but not general enough for standard
Allows for portably optimal codes
Pentium's running Linux

HTML version of Basic Foils prepared December 6 98

Foil 16 Code Generation Strategy

From Java Access to Numerical Libraries: Compiling Fortran to Java SC98 Orlando Java Grande Panel -- November 13 98. *
Full HTML Index
Code is iteratively generated & timed until optimal case is found. We try:
  • Differing NBs
  • Breaking false dependencies
  • M, N and K loop unrolling
Cache based multiply optimizes for:
  • TLB access
  • L1 cache reuse
  • FP unit usage
  • Memory fetch
  • Register reuse
  • Loop overhead minimization
Takes a couple of hours to run.

HTML version of Basic Foils prepared December 6 98

Foil 17 PPT Slide

From Java Access to Numerical Libraries: Compiling Fortran to Java SC98 Orlando Java Grande Panel -- November 13 98. *
Full HTML Index

HTML version of Basic Foils prepared December 6 98

Foil 18 PPT Slide

From Java Access to Numerical Libraries: Compiling Fortran to Java SC98 Orlando Java Grande Panel -- November 13 98. *
Full HTML Index

HTML version of Basic Foils prepared December 6 98

Foil 19 Multithreaded BLAS for Performance

From Java Access to Numerical Libraries: Compiling Fortran to Java SC98 Orlando Java Grande Panel -- November 13 98. *
Full HTML Index

HTML version of Basic Foils prepared December 6 98

Foil 20 ATLAS

From Java Access to Numerical Libraries: Compiling Fortran to Java SC98 Orlando Java Grande Panel -- November 13 98. *
Full HTML Index
Keep a repository of kernels for specific machines.
Develop a means of dynamically downloading code
Extend work to allow sparse matrix operations
Extend work to include arbitrary code segments
See: http://www.netlib.org/atlas/

HTML version of Basic Foils prepared December 6 98

Foil 21 What is needed to use ATLAS with Java:

From Java Access to Numerical Libraries: Compiling Fortran to Java SC98 Orlando Java Grande Panel -- November 13 98. *
Full HTML Index
1. The Java calling program (jdmmtst.java)
2. The Java loadLibrary class (CWRAP.java)
3. The java loadLibrary header file (CWRAP.h)
4. The C functions (c wrappers to call ATLAS and ATLAS c software library).
5. The shared object (libCWRAP.so) which contains executable binaries of the C wrapper functions and all the ATLAS functions.

HTML version of Basic Foils prepared December 6 98

Foil 22 Test Results for Matrix Multiply UltraSparc 2200 (200 MHz, peak of 400 Mflop/s)

From Java Access to Numerical Libraries: Compiling Fortran to Java SC98 Orlando Java Grande Panel -- November 13 98. *
Full HTML Index

HTML version of Basic Foils prepared December 6 98

Foil 23 Futures

From Java Access to Numerical Libraries: Compiling Fortran to Java SC98 Orlando Java Grande Panel -- November 13 98. *
Full HTML Index
Extend these ideas to Java directly
References:
http://www.netlib.org/
http://www.netlib.org/atlas/
http://www.cs.utk.edu/f2j/
http://www.netlib.org/utk/people/JackDongarra/

© Northeast Parallel Architectures Center, Syracuse University, npac@npac.syr.edu

If you have any comments about this server, send e-mail to webmaster@npac.syr.edu.

Page produced by wwwfoil on Sun Dec 6 1998