Mathematical Software Overview
This Mathematical Software Overview compares the chief mathemathical subroutine libraries available and explains the lookup and support tools (including reference manuals) that help you use those libraries effectively. It also introduces a few important, commercial, interactive math tools available at LC.
The belief behind LC's approach to mathematical software support is that computational tasks required in a wide variety of applications share common, mathematically defined features to which general purpose techniques can be applied. This results in a long-term overall cost savings through software reuse and reduced duplication of effort. This approach was long embodied in LC's former Mathematical Software Support Service (MSS) and its predecessor groups. It is still reflected in the surviving products of those groups, including local libraries (such as PMATH) and local self-help sites for numerical mathematics software, such as the LINMath Web site. In addition, LC maintains math libraries in compiled (object) form, mostly from commercial vendors, on its machines. This document surveys those libraries and sites, compares their features, and offers links to current reference documentation.
For help, contact the LC Hotline at 925-422-4531 or via email (OCF: firstname.lastname@example.org, SCF: email@example.com).
Math Libraries and Interactive Tools
Users often ask which mathematics libraries and interactive mathematical tools are "available" on which LC systems. The answer depends on what you regard as availability and on how much customization you need (or are willing to perform). Some mathematics libraries, mostly from commercial vendors, are preinstalled as compiled (object) code. The libraries sometimes overlap. Some routines are optimized and some are not; some are threaded and some are not; some support MPI and some do not; some are portable and some are not; some are single or double precision. Only your own computational needs can determine which of these competing libraries are most appropriate for your work.
Mathematics or numerical libraries are designed to be incorporated into user applications. They contain high-quality implementations of common tasks such as linear algebra solvers or fast Fourier transforms.
In addition to the relatively small set of preinstalled math libraries, there is a much larger set of downloadable source-code math software routines and packages (around 1400 in all) on both OCF (CZ and RZ) and SCF, at the LINMath Web site. This semi-interactive site offers four different collections (SLATEC, PMATH, MSSL, and mssl3) of non-proprietary software, organized by problem type. The software addresses a wide range of mathematical and statistical problem types, from simple (e.g., vector operations) to complex (e.g., differential equation solvers), and represents the result of efforts in the numerical math research community since the 1970s. LINMath also provides links to many other popular math software packages that are available elsewhere. The LINMath routines and packages also overlap somewhat with the commercial libraries (BLAS is an example), so in those cases you must decide which alternative best meets your specific needs.
Interactive mathematical tools are stand-alone applications that can be used for numerical analysis, data analysis, and display. These tools have both a GUI and a command-line interface.
The table below shows at a glance which major libraries and interactive mathematical tools reside on which LC machines. Each library or tool name is a link to more information about that library or tool.
|ACML||AMD Core Math Library||Linux||4.4.0, 5.0.0, 5.3.1
(gfortran, ifort, pgi)
See the AMD ACML Web site
|ATLAS||Automatically Tuned Linear Algebra Software||Linux||3.8.4||See the ATLAS Web site|
|BLAS||Basic Linear Algebra Subroutines|| Linux
|See ATLAS, MKL, or ACML (Linux); ESSL (BG/Q)
See the BLAS Web site
|ESSL||IBM Engineering and Scientific Subroutine Library||BG/Q||5.1||/usr/local/tools/essl/<version>/README.esslbgq
See the IBM's ESSL Guide and Reference
|FFTW||Fast Fourier Library||Linux
|2.1.5, 3.3.2, 18.104.22.168
2.1.5, 3.3.1, 3.3.3
|See the FFTW Web site
See ESSL or /usr/local/doc/BGQ/Libraries.html (BG/Q)
|GSL||GNU Scientific Library||Linux||1.13||See the GNU GSL Web site|
|IPP||Intel Performance Primitives are optimized scientific routines for data processing, signal processing, and image and video processing||Linux||See the Intel IPP Web site|
|LAPACK||Dense linear algebra||Linux
|See ATLAS, MKL, or ACML Linux; ESSL (BG/Q)
See the LAPACK Web site
|LIBM||Standard C math library||Linux||See the LIBM man page|
|MASS||Math Acceleration SubSystem (IBM) includes high performance versions of many of the double-precision routines from LIBM||BG/Q||See the IBM Mathematical Acceleration Subsystem for Blue Gene Web site|
|MKL||Intel Math Kernel Library||Linux||9.1.023, 10.1.1.019, 10.2.4.032,
10.3.1, 10.3.8, 10.3.11,
11.0.0, 11.0.3, 11.1.3
|See the doc or Documentation directory in
See the Intel MKL Web site
|MSSL/mssl3||Mathematics and Statistics Software Library is a collection of (mostly Fortran) routines in source code form||MSSL/mssl3 is available from the LINMath Web site as source code, which you can then move to any machine and compile.|
|PETSc||Collection of routines for solving linear systems||Linux
|3.0.0, 3.2, 3.4.3
|See the PETSc Web site|
|PMATH||Machine-independent portable math subroutine library||PMATH is available from the LINMath Web site as source code, which you can then move to any machine and compile.|
|ScaLAPACK||Library of high-performance linear algebra routines for distributed-memory message-passing MIMD computers||Linux
|See MKL (Linux); /usr/local/tools/scalapack/README (BG/Q)
See the Scalable Linear Algebra PACKage Web site
|SLATEC||Comprehensive software library with over 1400 general purpose mathematical and statistical routines written in Fortran 77||SLATEC is available from the LINMath Web site as source code, which you can then move to any machine and compile.|
|Interactive Math Tool||Description||Availability||Versions||Documentation|
|Mathematica||Symbolic mathematics tool||Linux||7.0.2
|Within Mathematica; see also the Mathematica vendor Web site|
|MATLAB||A high-level language and interactive environment for numerical computation, visualization, and programming||Linux||7.11
|Within MATLAB; see also the MATLAB vendor Web site|
|Octave||High-level language primarily intended for numerical computations||Linux||3.6.2||Within Octave; see also the GNU Octave Web site|
This section introduces the math subroutine libraries that LC provides.
The AMD Core Math Library provides optimized single-threaded and multi-threaded mathematical routines. The main components of ACML are:
- A full implementation of BLAS Level 1, 2, and 3 routines.
- A full suite of LAPACK routines.
- A comprehensive suite of FFTs in single-, double-, single-complex, and double-complex data types.
- Fast scalar, vector, and array math library routines.
- Random number generators in both single-and double-precision.
ACML libraries built with the GNU, Intel, and PGI compilers are in /usr/local/tools/acml-<compiler>-<ACML_version>, where <compiler> is either gfortran, ifort, or pgi. For each ACML version 4.X, there are two builds for each compiler, with the direcotry containing -mp being the multi-threaded implementation. For each ACML version 5.X, there are several subdirectories. The fma suffix is for builds using fused multiply-add instructions and the mp suffix is for builds using multiple threads. The corresponding header files can be found in the /include subdirectory.
For example, to use the single-threaded version 5.0 of ACML and the PGI compiler, include the following on your compile line:
and include the following on your link line:
For other compilers or versions, use the appropriate compiler/version paths to the library and header files.
The current version of ATLAS (Automatically Tuned Linear Algebra Software) provides a complete BLAS API (for both C and Fortran77) and a very small subset of the LAPACK API. For all supported operations, the developers claim that ATLAS achieves performance on par with machine-specific tuned libraries.
ATLAS 3.8 provides C and Fortran77 interfaces to these LAPACK routines:
The ATLAS libraries are compiled with the GNU compiler and because there is not standard FORTRAN ABI, the ATLAS libraries may be incompatible with other compilers. When using the PGI or Intel compilers, it is recommended that you use the appropriate ACML or MKL libraries instead. To use the ATLAS BLAS library, link with:
gfortran -lf77blas -L/usr/lib64/atlas-sse3/ copy.f90
Add the appropriate -l options depending on which language and library routines you are using.
The BLAS (Basic Linear Algebra Subprograms) routines provide standard building blocks for performing basic vector and matrix operations. The Level 1 BLAS perform scalar, vector, and vector-vector operations; the Level 2 BLAS perform matrix-vector operations; and the Level 3 BLAS perform matrix-matrix operations. Because the BLAS are efficient, portable, and widely available, they are commonly used in the development of high quality linear algebra software, such as LAPACK.
Various versions of BLAS are installed on LC Linux clusters and the BG/Q systems. Some versions are integrated into specific compiler systems.
- Intel MKL (associated with each MKL library version), e.g.:
- PGI compilers (associated with each compiler version), e.g.,
- /usr/lib64/libblas.so (supplied by Red Hat as part of the regular RHEL distribution and only recommended when using the GNU compiler and when performance is not an issue, as it is not highly optimized
There is a specific way to link for each version of BLAS (PGI, Intel/MKL, and RHEL). In the example below, "copy.f95" is a Fortran source file that references a BLAS Level 2 routine. On the IBM BlueGene systems, tuned versions of the BLAS routines are available via the IBM ESSL library.
In the following example, the 12.8 version of the PGI compiler is chosen, along with the related PGI BLAS.
pgf95 copy.f95 -o copy.pgi.pgi.x -L/usr/local/tools/pgi-12.8/lib/ -lblas
The Intel MKL BLAS provide support for linking with PGI and GNU compilers, in addition to Intel. A very useful tool for building applications using Intel MKL is the Intel Math Kernel Library Link Line Advisor. In the example below, the Intel 13.0.146 compiler, MKL version 11.0.0 are being used with dynamic linking, 64-bit integer support, and the BLAS95 Interface.
setenv MKLROOT /usr/local/tools/mkl-11.0.0/ #csh
export MKLROOT=/usr/local/tools/mkl-11.0.0/ #bash
ifort copy.f90 -i8 -I$MKLROOT/include -I$MKLROOT/include/intel64/ilp64 -L$MKLROOT/lib/intel64 $MKLROOT/lib/intel64/libmkl_blas95_ilp64.a /
-lmkl_intel_ilp64 -lmkl_sequential -lmkl_core -lpthread -lm -o copy.ifort.x -Wl,--auto_rpath
RHEL GNU Compilers
gfortran –lblas copy.f90
The Engineering Scientific Subroutine Library (ESSL) provides a variey of optimized complex mathematical functions for many different scientific and engineering applications such as BLAS, linear algebraic equation solvers and eigensystem analysis (a subset of LAPACK), FFTs, sorting, searching, quadrature, and random number generation. ESSL provides single- and double-precision versions for most routines. At LC, ESSL is available only on the IBM BG/Q (RZuSeq, Sequoia, Vulcan) systems. More information can be found on the BG/Q Libraries Confluence Wiki
ESSL includes all the BLAS that come with the LAPACK distribution, but it does not include the following original BLAS routines, most of which are in libblas.a: CSROT, DROTM, DROTMG, DSDOT, SDSDOT, SROTM, SROTMG, ZDROT.
Some ESSL eigenvalue routines have the same name as LAPACK routines but are different (since ESSL predates LAPACK). If you want to use the LAPACK routines whose names conflict with routines in ESSL, use the AR tool to split ESSL into two libraries: one with just the conflicting routines, say, libconflict.a, and the other with the rest of the routines, say, libesslnoconflict.a. Link the noconflict routines before the full LAPACK library:
... -lesslnoconflict -llapack
This gives you optimized versions of the LAPACK routines that are in ESSL, with liblapack.a resolving all the other routines.
FFTW ("Fastest Fourier Transform in the West") is a C subroutine library for computing the Discrete Fourier Transform (DFT) in one or more dimensions, of both real and complex data, and of arbitrarily large input size. FFTW also efficiently handles multiple, strided transforms.
FFTW 2.1.5 is installed on LC's Linux machines in /usr/local/tools/fftw-2.1.5 and /usr/local/tools/fftw3-<version>/lib, for various version 3 installations. Note that the APIs for FFTW versions 2 and 3 are incompatible.
FFTW is released under the GNU general public license. It works on any platform with a C compiler, and it is also callable from Fortran. Of special interest to LC users is FFTW's support for parallelization. FFTW offers parallelized code for SMP machines with POSIX threads (pthreads), and an MPI version for distributed memory transforms is also available.
For general information on the FFTW math library, background papers on its technical features, and detailed documentation, consult the FFTW Web site.
The GNU Scientific Library (GSL) is a collection of routines for numerical computing. The routines have been written in C and present an Applications Programming Interface (API) for C programmers, allowing wrappers to be written for very high level languages. Where possible the routines have been based on reliable public-domain packages such as FFTPACK and QUADPACK, which the developers of GSL have re-implemented in C with modern coding conventions.
In order to use GSL routines in a C-based program, it is only necessary to add the appropriate compile and link option.
gcc gsl.c -lgsl -L/usr/lib64/libgsl.so -lgslcblas -L/usr/lib64/libgslcblas.so
Intel Integrated Performance Primitives (IPP) is an extensive library of performance profiler tools and software functions for multimedia processing, data processing, and communications applications. For additional information, consult the Intel Software Documentation Library.
Due to the large size of these libraries, not all Intel compiler installations contain the IPP libraries. To see which compiler installations include ipp, run the following command:
ls -ld /usr/local/tools/ic*/ipp
The Linear Algebra PACKage (LAPACK) is a library of numerical solvers for dense linear algebra problems. It provides routines for solving systems of linear equations and linear least squares, eigenvalue problems, and singular value decomposition. Similar to BLAS, LAPACK routines are implemented in various libraries, including MKL, ACML, and ATLAS for Linux systems and ESSL for BG/Q systems. For additional information, consult the LAPACK Web site.
LIBM is the standard C library of basic mathematical functions, such as sin(x), cos(x), exp(x), etc. To include the LIBM functions, just add -lm on your link command line.
The Intel compiler includes an optimized math library that contains optimized implementations of LIBM functions. Some users have reported up to a 10% performance improvement by using Intel's math library. If you use the Intel compiler, this library is included implicitly. If you use a non-Intel compiler, you need to explicitly link in the library. Note that libimf does not implement all libm functions, so you may need to link in libm as well.
Here is an example link line:
gcc test.o -L/usr/local/tools/ic-14.0.174/lib -Wl,-rpath=/usr/local/tools/ic-14.0.174/lib -limf -lm
Mathematical Acceleration Subsystem (MASS) consists of libraries of mathematical functions tuned specifically for optimum performance on a variety of IBM architectures. Scalar and vector libraries are provided. Single instruction multiple data (SIMD) libraries are provided for SIMD architectures. These libraries and functions are:
- Thread safe.
- Tuned specifically for optimum performance on the target architecture, offering improved performance over the corresponding standard system library routines.
- Callable from C, C++, and Fortran applications.
- Intended for applications where slight differences in accuracy or handling of exceptional values can be tolerated.
To use MASS, add -lmass or –lmassv to the library load line for routines from the scalar or vector versions, respectively.
MKL is Intel's threaded Math Kernel Library, a good source for BLAS, LAPACK, ScaLAPACK, FFT and other routines in the LC Linux environment. MKL is available only on LC machines with x86-based chips. Various versions of MKL are available in /usr/local/tools/mkl-<version>, where <version> is a specific version. Newer MKL implementations contain libraries built for specific configurations.
Intel has a web-based tool for determining your link line depending on compiler, architecture, etc. This tool is available at:
Select "Linux" for the operating system and "Intel 64" for the architecture. With the Intel or GNU C compiler with 32-bit integers and non-threaded MKL, the link line will be:
-L$MKLPATH $MKLPATH/libmkl_solver_lp64_sequential.a -Wl,--start-group \
-lmkl_intel_lp64 -lmkl_sequential -lmkl_core -Wl,--end-group -lpthread
To use the Intel or GNU C compiler with 32-bit integers and the threaded implementation of MKL, the link line will be:
-L$MKLPATH $MKLPATH/libmkl_solver_lp64.a -Wl,--start-group \
-lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -Wl,--end-group \
Complete MKL documentation is in either the doc or Documentation directory of the installation, depending on the MKL version. When using the multi-threaded MKL libraries, the Linux environment variable OMP_NUM_THREADS controls the number of threads spawned by the MKL routines (by default, MKL sets the number of threads equal to the number of cores on the node).
MSSL (the Mathematics and Statistics Software Library) is a collection of (mostly Fortran) routines, in source code form, that is made available to LC users via the LINMath Web site. Source code downloaded from LINMath can then be moved to any other desired LC machine.
Historically, MSSL was divided into three classes according to the level of quality control and support. Class 1 and 2 routines required quality assurance, at least minimal support, full usage documentation, and some testing. The Class 3 routines were minimally screened but usage-documented. Following the demise of LC's MSS, these distinctions lost much of their meaning. However, the Class 3 routines are still kept separate, in a collection called mssl3 (about 300 routines), while the name MSSL now refers to the collection of all Class 1 and 2 routines (about 100 routines). Many routines in mssl3 may well be of high quality but simply never went through the screening and testing necessary to raise their class level.
There is one particular set of routines in mssl3 worth highlighting: a trio of routines in the Service Routines category—I0MACH, R0MACH, and D0MACH—that provides various machine constants. The results they return are often more accurate than the values in the corresponding MSSL or SLATEC routines. For details, see the section Largest and Smallest Numbers.
There is no separate MSSL or mssl3 reference manual. The usage documentation for each MSSL or mssl3 routine is provided in the comment line prologue of the source file that is delivered by LINMath.
The Portable, Extensible Toolkit for Scientific Computation is a suite of data structures and routines for the scalable (parallel) solution of scientific applications modeled by partial differential equations. It supports MPI, shared memory pthreads, and NVIDIA GPUs as well as hybrid MPI-shared memory pthreads or MPI-GPU parallelism.
See the Portable, Extensible Toolkit for Scientific Computation Web site for more information, documentation, and tutorials.
On Linux and BG/Q systems, PETSc installations can be found in /usr/local/tools/petsc-<version>.
The PMATH mathematical subroutine library (libpmath.a) is a collection of 66 routines that was constructed as a portable subset of the former (machine-dependent) MATHLIB library with a few other routines added. PMATH supplements but does not duplicate the SLATEC library.
LC's former MSS group (and its predecessor groups) developed MATHLIB, much of which was coded in the machine language, CAL. To meet the need for a machine-independent portable mathematics subroutine library, PMATH ("P" for portable) was developed.
The user-callable routine names in PMATH, with brief descriptions, are listed below. All are Fortran callable, except for those from the random number generator family, which includes some C routines. Where two or more names are shown together, these correspond to the double and single precision versions (and possibly an integer version) of the routines. For details, see the source files, available from LINMath. In particular, the usage documentation of each routine is given in the source file of each routine.
|DMAXAF,SMAXAF,IMAXAF||Maximum element of array|
|DMINAF,SMINAF,IMINAF||Minimum element of array|
|DMINMX,SMINMX,IMINMX||Minimum and maximum elements of array|
|LDFD,LDFS||Table look-down function|
|LUFD,LUFS||Table look-up function|
|LUGD,LUGS||Table look-up function with guess|
|DMEANF,SMEANF||Mean of 1D real array|
|DMEANV,SMEANV||Mean vector of 2D real array|
|DMEDF,SMEDF||Median of 1D real array|
|DRANKS,SRANKS||Ranks of 1D real array|
|DCORRV,SCORRV||Correlation matrix of 2D real array|
|DCOVAR,SCOVAR||Variance-covariance matrix of 2D real array|
|DSTDEV,SSTDEV||Standard deviation of 1D real array|
|DZERO,SZERO||Zero of a nonlinear function|
|DFITPO,SFITPO||Polynomial fit to data|
|DREFIT,SREFIT||Repeated fitting after DFITPO,SFITPO|
|DLSODE,SLSODE||Ordinary differential equation IVP solver|
|DINTDY,SINTDY||Auxiliary interpolator routine for DLSODE,SLSODE|
|DSRCOM,SSRCOM||Save and restore Common for DLSODE,SLSODE|
|DCONST,SCONST||Common mathematical constants|
|IUMACH||Standard output unit number|
|XERRWD,XERRWV||Print error message with values|
|XSETF||Set error message control flag|
|XSETUN||Set error message unit number|
|Random Number Generator Family|
|DRANF,SRANF||Uniform random number generator|
|DRANFV,SRANFV||Uniform random number generator (vectorized)|
|DRLGF,SRLGF||Exponential random number generator|
|ranf8||Uniform random number generator|
|ranfv8||Uniform random number generator (vectorized)|
|rnfcnt||Count calls to RANF|
|rnsget||Get RANF seed|
|rnsset||Set RANF seed|
|rnmset||Set RANF multiplier|
|rlgf8||Exponential random number generator|
|rlfcnt||Count calls to RLGF|
|rlsget||Get RLGF seed|
|rlsset||Set RLGF seed|
|rlmset||Set RLGF multiplier|
ScaLAPACK is a library of high-performance linear algebra routines for distributed-memory message-passing MIMD computers. ScaLAPACK solves dense and banded linear systems, least squares problems, eigenvalue problems, and singular value problems, and is designed to be used in MPI-based parallel applications.
ScaLAPACK can be found in the MKL library on LC Linux systems or in /usr/local/tools/scalapack on LC BG/Q systems.
SLATEC is an acronym for the Sandia, Los Alamos, Air Force Weapons Laboratory Technical Exchange Committee. Formed in 1974 to foster exchange among these three New Mexico laboratories, it has since been expanded to include LLNL (both LC and the former NERSC), ORNL, and NIST (the National Institute for Standards and Technology, formerly NBS). On occasion, ANL, NCAR, and other government laboratories have also been involved in SLATEC activities.
The Common Mathematical Library (CML) developed by SLATEC is a portable Fortran 77 library of high quality mathematical software. It includes the widely-known packages BSPLINE, EISPACK, FISHPACK, FNLIB, LINPACK, PCHIP, QUADPACK and much more. (It is very weak in statistical software.)
Routines from this library, being nonproprietary and portable, may be used on both the LC machines and the user's workstation. SLATEC is not installed on LC machines, but you can build the library yourself from source code that you get from LINMath. In fact, since the LINMath sources are more recent and more thoroughly debugged than the installed binaries, Linux users are also encouraged to prefer the LINMath version of all SLATEC routines.
For those who use the SLATEC library, online documentation (comment prologues) for individual user-callable SLATEC routines is available through the LINMath Web site. For complete documentation, see the Guide to Available Mathematical Software, a cross-index and virtual repository of mathematical and statistical software components of use in computational science and engineering provided by NIST.
LINMath Web Site
LINMath (Livermore Interactive Numerical Mathematics software access utility) is a customized Web site that delivers advice on, and descriptions of, mathematical library routines and (most importantly) delivers source files for the routines themselves. LINMath uses a topic-based menu tree to provide advice, sub-menu lists, and downloadable source files for a set of mathematical software collections. The largest such collection is the SLATEC library, which resulted from a collaboration with seven other laboratories. The MSSL and mssl3 collections are primarily the result of internal development efforts. The PMATH collection arose as a small portable subset of the MATHLIB object code library.
The LINMath Web site uses the standard GAMS (Guide to Available Mathematical Software) hierarchical system for organizing math routines in the structure of its menu tree. Underlying the GAMS structure, the software itself comes from four different collections: SLATEC, MSSL, mssl3, and PMATH. As a related service, LINMath (OCF version) provides links to a large number of external mathematical software packages of possible interest. LINMath also provides the most recent, debugged versions of SLATEC and PMATH routines, potentially more recent than the versions installed on some LC machines as compiled object code.
The vast majority of the software in LINMath is in Fortran (primarily for historical reasons) although there is some software written in C. In the case of the Fortran collections, a major task of LINMath is to deliver the proper set of subordinate routines along with the requested user-callable routine. Subordinate routines are generally shared by multiple top-level routines and thus stored separately. For each given requested routine, LINMath appends to it the correct set of subordinate routines to construct the file delivered to the user.
The LINMath Web site is accessible at http://www-lc.llnl.gov/linmath/. The LINMath server automatically restricts access to those clients running on machines within the LLNL domain(s). A nearly identical LINMath site is available within the LLNL secure network on the SCF at http://www.llnl.gov/linmath.
No separate documentation for using LINMath is available, nor is it necessary. At the home page, simply select a major topic category, then follow a menu tree until reaching the particular subtopic of interest. This leads to a list of those libraries that contain routines for that subtopic. After selecting any one of those, clicking on any entry initiates a download of the software routine named. An example of such a path might be:
I (Differential and Integral Equations)
I1 (Ordinary differential equations)
I1a (Initial value problems)
I1a1 (General, nonstiff or mildly stiff)
MSSL: 7 routines
To aid in the menu navigation process, many of the pages display blocks of information and/or recommendations about the subtopic category and the software available in it.
In addition to supplying mathematical software sources directly, the OCF version of LINMath also provides links to a number (around 130) of math software packages that are available externally. These are listed, with brief descriptions, within the top-level GAMS categories and also in a single alphabetical list linked to from the LINMath home page. Links in the latter list lead back to the package lists for the relevant GAMS categories.
Some packages, such as LINPACK and BLAS, exist in object code libraries available on some LC machines. If your target machine has such a library, using its version of these routines is likely to be more efficient than using the source code form from LINMath. Some experimentation with the two versions may be warranted.
The alphabetical list of mathematical software packages listed by LINMath is provided below. All are externally located, but some (marked *) are also available from within LINMath.
Interactive Math Tools
Mathematica is used for symbolic computation and complex analysis as well as 2D and 3D graphics and programming. Mathematica creates fully customizable, publication-quality, cross-platform electronic and printed documents with professional mathematical typesetting quality, and it also generates Web-ready documents.
Mathematica (version 5.0) is now available as a public file on all OCF and SCF production machines. Mathematica offers a choice of two interfaces: a text interface and a GUI interface. No initialization file is needed to use Mathematica. To start the text interface, type
There are a limited number of licenses on each LC host. If you log into the program and no license is available, you will receive a message indicating that the license limit has been reached or that no license was returned.
To use the GUI interface, log on using an X terminal or Xterm simulator and type
Mathematica is located at /usr/local/bin/mathematica (which is really a link to /usr/global/tools).
# Moab Job Script for MathKernel LC Linux Systems
#MSUB -N Mathematica
#MSUB -l nodes=1,walltime=00:10:00
#MSUB -m ae
echo "Information about the job:"
pstat -n $SLURM_JOBID
echo "Started batch processing at 'date'."
math -noprompt -run '<<pi.m'
echo "Ended batch processing at 'date'."
To read more about Mathematica, consult Stephen Wolfram's Mathematica, A System for Doing Mathematics by Computer, which is considered the definitive source. The vendor Web site for Mathematica features introductory and tutorial background and offers support and help. The Mathematica Journal is free and publishes articles about Mathematica techniques and applications.
MATLAB is an interactive matrix "laboratory" developed and distributed by MathWorks. It is used for tasks involving matrices, graphics, and general numerical computation. There are numerous user-developed packages for MATLAB that can be downloaded from the Internet.
To run MATLAB using the GUI, log on to an LC Linux system using an X terminal or Xterm simulator, and type
(or, to access a non-default version, use the path name /usr/local/tools/matlab/matlabnn where nn is the version number). You can reach MATLAB's help documentation by typing help_win at the MATLAB prompt. A separate window opens and provides a list of help topics. Click the help topic you want to get more information. You can also type helpdesk or visit the MathWorks Web site. There is also a command-line interface for MATLAB.
If all MATLAB licenses are being used, you will receive a warning telling you to "get a valid password."
For additional information, visit the vendor Web site for MATLAB.
Octave is a high-level interpreted language primarily intended for numerical computations. It provides capabilities for the numerical solution of linear and nonlinear problems and for performing other numerical experiments. It also provides extensive graphics capabilities for data visualization and manipulation. Octave is normally used through its interactive command-line interface, but it can also be used to write non-interactive programs. The Octave language is quite similar to MATLAB so that most programs are easily portable.
To use Octave, log onto an LC Linux Cluster system and type
Largest and Smallest Numbers
The largest (and smallest) numbers that you can represent depend on the machine (chip set) that you are using, the compiler that you are using, and the data type (single precision, double precision, or integer). Follow these steps to discover the values most relevant to your needs:
- Select your target machine, target compiler (if several are available), and data type (single, double, integer).
- Log on to the target machine.
- Run any Web browser and supply the open or secure URL for LINMath, LC's online math software source.
- On the LINMath home page, scroll down to the bottom, to the "GAMS Master Index" and select Category R (Service Routines).
- On the page that arrives next, select R1 (Machine-dependent constants).
- On the page that arrives next, select the MSSL3 library.
Warning: LINMath will also offer you routines in the SLATEC library, but avoid those. The SLATEC largest/smallest reporting routines have internal flaws that make them obsolete and unreliable on current LC machines.
- On the page that arrives next (MSSL3), select from these three routines those that meet your needs:
R0MACH for single precision
D0MACH for double precision
I0MACH for integer values
When commented source code (Fortran, with a C version imbedded in the comments) for each routine displays, save it to a file by using your browser's File menu.
- On your target machine and compiler, compile and run a test code invoking the MSSL3
routine that reports current local information on the data type of interest to you, where
R = R0MACH(1) reports the smallest positive magnitude.
R = R0MACH(2) reports the largest positive magnitude.
R = R0MACH(3) reports the smallest relative spacing.
R = R0MACH(4) reports the largest relative spacing.
R = R0MACH(5) reports the log10 of the arithmetic base (usually 2).
D = D0MACH(1) through D0MACH(5)
reports same as R0MACH except double precision.
I = I0MACH(9) reports the largest integer magnitude.
I = I0MACH(12) reports the smallest exponent (single precision).
I = I0MACH(13) reports the largest exponent (single precision).
I = I0MACH(15) reports the smallest exponent (double precision).
I = I0MACH(16)reports the largest exponent (double precision).
(other integer values can also be reported)
You may be more interested in the effect of various "precision" choices on how your calculations are carried out than on largest or smallest represented values per se. In that case, consult the following local (archival) information on these precision topics:
- The range of binary, hexadecimal, character, and integer constants locally supported: https://computing.llnl.gov/code/content/fpe_source.php
- The allowed byte sizes for integer or real statements: https://computing.llnl.gov/code/content/fpe_statements.php
- The specific effects of choosing double precision or double complex data types: https://computing.llnl.gov/code/content/fpe_double_options.php