Sciport

Sciport

Sciport is a Cray SciLib compatibility interface library on CXML supplied by Compaq Computer Corporation. Sciport implements the functionality and user interface of many of the Cray SciLib routines by calling appropriate sequences of CXML routines. The primary function of the Sciport library is to aid in porting Cray applications to platforms supported by CXML. Sciport is not supported on the Windows NT platform. This section describes the SciLib functions that are supported in Sciport. Refer to the Routines Summary tables, later in this section, for a description of each routine.

What Sciport Provides

Compaq Sciport provides the following:

These Compaq Sciport routines are compatible with their Cray SciLib counterparts and require no source code changes except as described in this documentation.

It is important to note that Sciport is not intended to be a complete implementation of Cray SciLib. Instead Sciport implements a very common subset of SciLib that is useful for porting most Cray applications. In particular, it should be noted that Sciport does not support any of the SciLib distributed memory routines. However, support for SMP (symmetric multiprocessing) is provided by linking Sciport with the parallel CXML.

How Data is Handled

The Cray Fortran compiler (CF77) treats REAL , COMPLEX , and INTEGER data as 64, 128, and 64 bit quantities, respectively. The Compaq Fortran compiler treats REAL , COMPLEX , and INTEGER data as 32, 64, and 32 bit quantities. To aid in porting applications, the Compaq Fortran compiler supports switches to override default behavior and automatically treat all REAL , COMPLEX , and INTEGER data as the 64, 128, and 64 bits, respectivvely. The Sciport library is intended to be used in conjunction with these compiler switches to port Cray applications with minimal source changes. Refer to the Compaq Fortran documentation for information about the use of these switches.

Compatibility and Restrictions

Since the primary objective of Sciport is to enable porting Cray applications to Compaq platforms, great care was taken in the development of Sciport to minimize compatibility issues. In many cases, Sciport routines provide bit-for-bit compatible results. For example, the Sciport version of RANF returns exactly the same sequence of random digits as its Cray SciLib counterpart.

Another important objective of Sciport is to allow ported applications to benefit from the performance enhancement provided by CXML, with minimal source code modification.

When these two objectives come into conflict with one another, the conflict is usually resolved in favor of compatibility. However, in a small number of cases, allowing small incompatibilites enables significant performance gains.

In some cases implementation differences between Cray and Compaq computer hardware and compilers do not allow all details of SciLib routines to be duplicated faithfully. However, the differences between Sciport and SciLib routines are generally minimal. The following sections provide information about any differences that may exist.

The Orders Routine

The ORDERS routine performs a radix sort on fixed-length records. In the Sciport version of ORDER , the arguments RECORD and KEY are not optional as they are in the SciLib version. Owing to differences in Cray and Compaq system endianness, care must be taken when sorting multi-byte character data. Because of endian considerations, the range of the key argument has been limited to the closed interval [1,8].

CF77 Intrinsic Functions

Many of these CF77 intrinsic functions return a CF77-specific data type of BOOLEAN . Since the non-ANSI FORTRAN-77 data type BOOLEAN is not supported by Compaq Fortran compilers, it is necessary for users to change the function return types from BOOLEAN to INTEGER .

BLAS and LAPACK Routines

In order to achieve source code compatibility with SciLib, Sciport single-precision and single-complex BLAS and LAPACK routines support 64-bit integers passed by reference. However, Sciport internally maps these routines onto their corresponding double-precision and double-complex CXML BLAS and LAPACK routines which use 32 bit integers. Consequently, some runtime uses of SciLib are not supported by Sciport. In practice, this does not appear to be a significant restriction.

Note

When necessary, Sciport automatically converts between 64 and 32 bit integers.

Additionally, since the single-precision Sciport BLAS and LAPACK routines have the same names as the single-precision CXML BLAS and LAPACK routines, applications that use Sciport cannot use the shared-library version of CXML. That is, applications that use Sciport must be linked "non-shared" with the Sciport and CXML libraries. In addition, the Sciport library must precede CXML in the link command. Refer to the Compiling and Linking Sciport section for more information about how to link Sciport.

FFT Routines

The interface to the SciLib FFT routines requires that a work array of sufficient size be allocated and passed to the FFT routines. Users are free to write to this work array between calls to the SciLib FFT routines.

Some SciLib FFT routines additionally require that a table array be allocated and passed to the FFT routines. Users cannot write to this table array between FFT calls. It is assumed to be "read-only" after initialization.

For performance reasons, Sciport FFT routines are implemented as calls to CXML FFT routines. CXML FFT routines do not require a user-allocated work space. However they do require a small user-allocated data struture to record information from call-to-call in a thread-safe manner.

In order to preserve the SciLib interface, Sciport FFT routines overlay the table array (if it is present), or the user work array (if the table array is not present), with the CXML FFT data structure. This implementation has the following important side effects:

Compiling and Linking Sciport

As noted in the previous section, Sciport is used in conjuntion with CXML, and must be linked into an application statically. The typical approach is:

For example, on a UNIX platform this is accomplished with the following command:


 f77 -o prog -r8 -i8 -double_size 128 prog.f -static -lsciport -lcxml 

The same command also applies to Linux, except that the name of the Fortran driver is "fort".

On a VMS platform, linking can be accomplished by the following command:


LINK PROG, OBJ, SYS$LIBRARY:CXML$FGS_SCIPORT/LIB 

Note: CXML must be linked in after Sciport.

On platforms that support parallel execution, users can link in the parallel CXML rather than the serial CXML.

Summary of Sciport Routines

The following set of SciLib routines are supported in Sciport. With the exception of BLAS and LAPACK routines, any SciLib routines not listed here are not supported in Sciport.

Summary of CF77 Intrinsics
Routine Name Operation
snglr Returns closest real approximation to double precision.
gamma Computes the natural log of the gamma function.
coss Computes sine and cosine.
cot, dcot Computes cotangent.
cbrt, dcbrt Computes the cube root.
erf, erfc Returns the value of the error function and the complimentary error function.
j0, j1, jn Returns the value of the Bessel function of the first kind of orders 0, 1, and n.
y0, y1, yn Returns the value of the Bessel function of the second kind of orders 0, 1, and n.
ranf, ranget, ranset Computes pseudo-random numbers.
flmin, flmax Return the minimum and maximum positive floating-point values, respectively.
ffrac Returns the fractional accuracy of single precision floating point numbers.
inmax Returns the maximum positive integer value.
and Computes logical product.
or Computes logical sum.
compl Computes logical complement.
eqv Computes logical equivalence.
xor, neqv Computes logical difference.
shift Performs a left circular shift.
shiftl Performs a left shift with zero fill.
shiftr Performs a right shift with zero fill.
dshiftr Returns the lowermost 64 bits of a right-shifted 128 bit integer.
dshiftl Returns the uppermost 64 bits of a left-shifted 128 bit integer.
mask Returns a bit mask.
leadz Counts number of leading zero bits.
popcnt Counts number of bits set to 1.
poppar Computes bit population parity.
cvmgp, cvmgn, cvmgt, cvmgz Performs a conditional merge.
csmg Performs a scalar boolean merge.

Summary of BLAS Extensions
Routine Name Operation
spaxpy Adds a scalar multiple of a real vector to a sparse real vector.
saxpby, caxpby Adds a scalar multiple of a real or complex vector to a scalar multiple of another real or complex vector.
spdot Computes a sparse dot product of two real vectors.
scopy2 Copies a real or complex vector into another real or complex vector.
shad Computes the Hadamard product of two vectors.
cgesum, sgesum Adds a scalar multiple of a real or complex matrix to a scalar multiple of another real or complex matrix.
sspr12 Performs two simultaneous symmetric rank 1 updates of a real symmetric packed matrix.
sgemms, cgemms Multiplies a real or complex general matrix by a real or complex general matrix using Strassen's algorithm.

Summary of Signal Processing Routines
Routine Name Operation
cfft Applies a complex Fast Fourier Transform (FFT).
cfft2 Applies a complex Fast Fourier Transform (FFT).
cfft2d Applies a two-dimensional complex Fast Fourier Transform (FFT).
cfft3d Applies a three-dimensional complex Fast Fourier Transform (FFT).
cfftmlt Applies complex-to-complex Fast Fourier Transforms (FFT) on multiple input vectors.
crfft2 Applies complex-to-real Fast Fourier Transforms (FFT).
mcfft Applies a multiple complex Fast Fourier Transform (FFT).
rcfft2 Applies real-to-complex Fast Fourier Transforms (FFT).
rfftmlt Applies complex-to-real or real-to-complex Fast Fourier Transforms (FFT) on multiple input vectors.
fftfax Initializes multi-dimensional real Fast Fourier Transforms (FFT).
cftfax Initializes multi-dimensional complex Fast Fourier Transforms (FFT).
ccfft Applies a complex-to-complex Fast Fourier Transform (FFT).
ccfft2d Applies a two-dimensional complex-to-complex Fast Fourier Transform (FFT).
ccfft3d Applies a three-dimensional complex-to-complex Fast Fourier Transform (FFT).
ccfftm Applies multiple complex-to-complex Fast Fourier Transforms (FFTs).
csfft Computes a real-to-complex or complex-to-real Fast Fourier Transform (FFT).
csfft2d Applies a two-dimensional real-to-complex or complex-to-real Fast Fourier Transform (FFT).
csfft3d Applies a three-dimensional real-to- complex Fast Fourier Transform (FFT).
csfftm Applies multiple real-to-complex or complex-to-real Fast Fourier Transforms (FFTs).
scfft Computes a real-to-complex or complex-to-real Fast Fourier Transform (FFT).
scfft2d Applies a two-dimensional real-to-complex or complex-to-real Fast Fourier Transform (FFT).
scfft3d Applies a three-dimensional real-to-complex Fast Fourier Transform (FFT).
scfftm Applies multiple real-to-complex or complex-to-real Fast Fourier Transforms (FFTs).
ccnvl, ccnvlf Computes the complex convolution of a sequence with one or more other sequences.
filterg Computes a correlation of two vectors.
filters Computes a correlation of two vectors (symmetric coefficient).
opfilt Solves Weiner-Levinson linear equations.

Summary of First and Second Order Recurrence Functions
Routine Name Operation
folr, folrp Solves first-order linear recurrences.
folrc Solves first-order linear recurrences with a scalar coefficient.
folr2, folr2p Solves first-order linear recurrences without overwriting the operand vector.
folrn, folrnp Solves for the last term of a first-order linear recurrence.
solr Solves a second-order linear recurrence.
solr3 Solves a second-order linear recurrence for three terms.
solrn Solves a second-order linear recurrence for the last term only.
recpp, recps Solves a partial products or partial summation problem.

Summary of Tri-Diagonal Solvers
Routine Name Operation
sdtsol Solves a real valued tri-diagonal linear system with one right-hand side.
sdttrf Factors a real valued tri-diagonal linear system.
sdttrs Solves a real valued tri-diagonal linear system with one right-hand side, using the matrix factored by SDTTRF.
cdtsol Solves a complex valued tri-diagonal linear system with one right-hand side.
cdttrf Factors a complex valued tri-diagonal linear system.
cdttrs Solves a complex valued tri-diagonal linear system with one right-hand side, using the matrix factored by CDTTRF.

Summary of Sorting Routines
Routine Name Operation
isortd, isortb Sort an integer vector.
ssortb Sort a real vector.
orders Internal, fixed-length record-sorting routine optimized for Cray Research computer systems.

Summary of Vector Scatter/Gather Routines
Routine Name Operation
cluseq, clusne Searches a vector for clusters of values equal or not equal to a target.
clusilt, clusile, clusigt, clusige Searches an integer vector for clusters of values with a specified logical relationship to an integer target.
clusflt, clusfle, clusfgt, clusfge Searches a real vector for clusters or values with a specified logical relationship to a real target.
isrcheq, isrchne Searches a vector for the first element equal or not equal to a target.
isrchilt, isrchile, isrchigt, isrchige Searches an integer vector for the first element with a specified logical relationship to an integer target.
isrchflt, isrchfle, isrchfgt, isrchfge Searches a real vector for the first element with a specified logical relationship to a real target.
isrchmeq, isrchmne Searches a vector for the first element whose subfield is equal or not equal to a target.
isrchmlt, isrchmle, isrchmgt, isrchmge Searches a vector for the first element whose subfield has a specified logical relationship with a target.
wheneq, whenne Searches a vector for the first element equal or not equal to a target.
whenilt, whenile, whenigt, whenige Searches an integer vector for all elements with a specified relationship to an integer target.
whenflt, whenfle, whenfgt, whenfge Searches a real vector for all elements with a specified logical relationship to a real target.
whenmeq, whenmne Searches a vector for all elements whose subfields are equal or not equal to a target.
whenmlt, whenmle, whenmgt, whenmge Searches a vector for all elements whose subfields have a specified logical relationship with a target.
inflmin, inflmax Searches for the minimum or maximum value in subfields of a vector element.
intmin, intmax Searches an integer vector for the maximum or minimum value.
iilz, illz, ilsum Returns a number of leading occurrences of an object in a vector.
osrchf, osrchi Searches an ordered vector for the first location that contains a target.
osrchm Searches an ordered integer vector for the first element whose subfield is equal to an integer target.


CXML Home Page

Index of CXML Routines