Sun S3L 3.0 Programming and Reference Guide

Chapter 4 Sun S3L Data Types

Data type information is encoded in the S3L array handle for both C and Fortran interfaces and is decoded at run time. This allows appropriate branching to occur during execution, which makes it unnecessary to maintain separate routines with different names for each language interface.

Table 4-1 shows the data types supported for the various Sun S3L routines. Table 4-2 lists the C and Fortran language-specific data type equivalents.

Within each subroutine call, elements of all array arguments must match in data type, unless the argument descriptions indicate otherwise.

Place one of the following include lines at the top of any C or Fortran program unit that makes an S3L call:

C and C++ Programs

#include <s3l/s3l-c.h>

F77 and F90 Programs

include 's3l/s3l-f.h'

Note -

For Sun S3L 2.0, the S3L array handles for the F77 interfaces are of type integer*4 and for Sun S3L 3.0, they are of type integer*8. Therefore, when porting F77 programs from Sun S3L 2.0 to Sun S3L 3.0, be sure to change the array handle data type definitions accordingly. If you want your F77 program to be compatible with both Sun S3L 2.0 and Sun S3L 3.0, you should insert #ifdef statements in appropriate places in the code.


Table 4-1 Array Data Types Supported for C/C++ and F77/F90

Operation 

int 

long integer 

float 

double 

complex 

dcomplex 

2-norm 

 

 

Autocorrelation 

 

 

Convolve 

 

 

Copy array 

Circular shift 

Declare array 

Deconvolve 

 

 

Define array 

Describe array 

Exit 

 

 

 

- N/A - 

 

 

FFT, simple and detailed  

complex-to-complex 

 

 

 

 

FFT, inverse 

 

 

 

 

FFT, simple real-to-complex 

 

 

 

 

FFT, simple complex-to-real 

 

 

 

 

Forall 

Free array handle 

General band solver 

 

 

General iterative solver  

 

 

General least squares 

 

 

General singular value decomposition (SVD) 

 

 

General tridiagonal 

 

 

Get array elements 

Get array attributes 

Grade up/down 

Initialize S3L environment 

 

 

 

- N/A - 

 

 

Inner product 

 

 

LU factor 

 

 

LU solve 

 

 

LU invert 

 

 

Matrix multiplication 

 

 

Matrix vector multiplication 

 

 

Matrix vector sparse 

 

 

Outer product 

 

 

Print array 

Print sparse array 

 

 

Read array 

Read sparse array 

 

 

Reduce 

Reduce axis 

RNG, lagged Fibonacci 

RNG, linear congruential 

RNG, sparse matrix 

 

 

Set array elements 

Set process grid 

 

 

 

- N/A - 

 

 

Set safety 

 

 

 

- N/A - 

 

 

Sort 

 

 

Thread communicator setup 

 

 

 

- N/A - 

 

 

Symmetric eigenvalues, eigenvectors 

 

 

Transpose 

Write array 

Zero elements 

Table 4-2 Equivalent S3L, Fortran, and C Array Data Types

S3L Data Types 

F77/F90 Data Types 

C/C++ Data Types 

S3L_integer

INTEGER*4

int

S3L_long_integer

INTEGER*8

long long

S3L_float

REAL*4

float

S3L_double

REAL*8

double

S3L_complex

COMPLEX*8

typedef struct

   { float real;

     float imag;

   } S3L_cmpx8

S3L_double_complex

COMPLEX*16

typedef struct cmpx16_s

   { float double real;

     float double imag;

   } S3L_cmpx16