Sun Logo


Suntrademark S3L 4.0 Software Programming Guide

817-0086-10



Contents

Preface

1. Introduction to Sun S3L

Sun S3L Overview

Contents of Sun S3L

2. Sun S3L Data Types

3. Sun S3L Arrays

Overview

Sun S3L Array Attributes

Array Indexing

Sun S3L Array Handles

Creating Sun S3L Array Handles

Deallocating Sun S3L Array Handles

MPI Processes and Sun S3L Process Grids

Creating Process Grids

Distributing Sun S3L Arrays

Examining the Contents of Sun S3L Arrays

Printing Sun S3L Arrays

Visualizing Distributed Sun S3L Arrays With Prism

4. Multiple Instance

Defining Multiple Independent Data Sets

Rules for Data Axes and Instance Axes

Specifying Single-Instance vs. Multiple-Instance Operations

Example 1: Matrix-Vector Multiplication

Single-Instance Operation

Multiple-Instance Operation

The Importance of Data Layout

Example 2: Fast Fourier Transforms

5. Using Sun S3L

Incorporating Sun S3L Function Calls Into Your Program

Referencing Sun S3L Include Files

Setting Up the Sun S3L Environment

Enabling Thread-Safe Use of Sun S3L Routines

Using the Sun S3L Safety Mechanism

Creating Sun S3L Array Handles for Dense Arrays

Creating Sun S3L Array Handles for Sparse Arrays

Overview of S3L_declare_sparse

Overview of S3L_read_sparse

Overview of S3L_rand_sparse

Freeing Sun S3L Array Handles for Dense and Sparse Arrays

Using the Sun S3L Link Switch

Accessing Online Program Examples and Man Pages

Sample Code Directories

Compiling and Running the Examples

Man Pages

6. Setting Up the Sun S3L Environment

Creating and Removing Sun S3L Environments

Creating a Sun S3L Environment

Removing a Sun S3L Environment

Setting Up Support for Thread-Safe Operation

Controlling the Sun S3L Safety Mechanism

Error Checking and Reporting

Synchronization

7. Sun S3L Toolkit Routines for Managing Dense Arrays

Creating and Destroying Array Handles for Dense Sun S3L Arrays

Notes

Sun S3L Declare Example

Sun S3L Declare Detailed Example

Converting Between ScaLAPACK Descriptors and Sun S3L Array Handles

Converting From ScaLAPACK to Sun S3L

Converting From Sun S3L to ScaLAPACK

Freeing Sun S3L Array Handles

Initializing a Sun S3L Array From a File

Writing a Sun S3L Array to a File

Printing a Sun S3L Array to Standard Output

Copying Sun S3L Arrays

8. Creating and Freeing Custom Process Grids

Creating a Custom Process Grid

Set Process Grid Example

Deallocating a Process Grid

9. Extracting Information From Sun S3L Arrays and Process Grids

Extracting Descriptions of Sun S3L Arrays and Process Grids

Extracting Sun S3L Array Attributes

Obtaining and Setting Array Elements

S3L_get_array_element

S3L_set_array_element

S3L_get_array_element_on_proc

S3L_set_array_element_on_proc

10. Dense Matrix Routines

Overview

Matrix-Matrix Multiplication

Matrix-Vector Multiplication

2-Norm Operations

Inner-Product Operations

Multiple-Instance Inner-Product Routines

Single-Instance Inner-Product Routines

Outer-Product Operations

11. General Linear Systems Solvers

Gaussian Elimination for Dense Systems

LU Factor Routine

LU Solve Routine

LU Invert Routine

LU Deallocate Routine

Householder Transformations

Computing QR Decomposition of Sun S3L Arrays

Notes

Finding the Least-Squares Solution for a QR-Decomposed Array

Notes

Obtaining Q and R Arrays

Freeing QR Factors

12. Basic Sparse Matrix Routines

Supported Sparse Formats

Coordinate Format

Compressed Sparse Row Format

Compressed Sparse Column Format

Variable Block Row Format

Declaring a Sparse Matrix

Initializing a Sparse Matrix From a File

Initializing a Sparse Matrix With Random Values

Writing a Sparse Matrix to a File

Printing a Sparse Matrix to Standard Output

Converting a Sparse Matrix From One Format to Another

Computing a Sparse Matrix-Vector Product

Deallocating a Sparse Matrix Array Handle

13. Sparse Linear System Solvers

Solving Sparse Linear Systems by the Direct Method

Solving Sparse Linear Systems by an Iterative Method

Algorithm

Preconditioning

Convergence/Divergence Criteria

Initial Guess

Maximum Iterations

Krylov Subspace

Stopping Criterion Tolerance

Richardson Scaling Factor

Iteration Termination

Deallocating a Sparse Linear System Solver

14. Fast Fourier Transform Routines

Overview

Setting Up for FFT Operations

Using Sun S3L FFT Computational Routines

Simple, Complex-to-Complex FFTs

Detailed, Complex-to-Complex FFTs

Real-to-Complex and Complex-to-Real FFTs

Supported Array Sizes

Scaling

Complex Data Packed Representation

Argument Syntax

Deallocating FFT Setups

15. Parallel Random Number Generation Routines

Initialize Lagged-Fibonacci State Table

Lagged-Fibonacci Random Number Generator

Linear Congruential Random Number Generator

Deallocate LFG Setup

16. Summary of Other Sun S3L Routines

Other Computational Routines

Walsh Transform

Iterative Eigenpairs

Stock Option Pricing

Discrete Sine and Cosine Transforms

Quadratic Programming Optimization

Sparse Linear Problem Solver

Cholesky Solver

Structured Solvers

Dense Symmetric Eigenvalue Solver

Condition Numbers

Least-Squares Solver

Dense Singular Value Decomposition

Iterative Solver

Autocorrelation

Convolution

Deconvolution

Grade Elements

Sort Elements

Parallel Transpose

Other Toolkit Routines

Perform Operations on Array Elements

Copy Arrays