SUNDIALS (SUite of Nonlinear and DIfferential/ALgebraic equation Solvers)

Description

SUNDIALS is a suite of advanced computational codes for solving large-scale problems that can be modeled as a system of nonlinear algebraic equations, or as initial-value problems in ordinary differential-algebraic equations.

Consists of the following four solvers:

CVODE solves initial value problems for ordinary differential equation (ODE) systems.

CVODES solves ODE systems and includes sensitivity analysis capabilities (forward and adjoint).

IDA solves initial value problems for differential-algebraic equation (DAE) systems.

KINSOL solves nonlinear algebraic systems.

The goal of SUNDIALS is providing robust time integrators and nonlinear solvers that can easily be incorporated into existing simulation codes.

The main numerical operations performed in these codes are operations on data vectors, and the codes have been written in terms of interfaces to these vector operations. The result of this design is that users can relatively easily provide their own data structures to the solvers by telling the solver about their structures and providing the required operations on them. The codes also come with default vector structures with pre-defined operation implementations for both serial and distributed memory parallel environments in case a user prefers not to supply their own structures.

Please consult the SUNDIALS Home page for further details and documentation.

The installed versions of SUNDIALS

The suite of nonlinear and differential/algebraic equation solvers versions: 2.3.0 and 2.4.0 are available on HLRB-II.

Usage

Before using the SUNDIALS libraries, please provide the environment module sundials via:

module load sundials

Sundials has a number of the header files installed in various subdirectories of include, and users need to specify the code the include and library files. The library and include directories will be automatically linked and available in:

$SUNDIALS_LIB  
$SUNDIALS_INC  

Link SUNDIALS libraries to your own application

The easiest way to determine the preprocessor and linker flags required to link the SUNDIALS libraries to a user application is to invoke, from within the Makefile, the executable script sundials-config which is available in $SUNDIALS_BASE/bin, Its usage is as follows:

Usage: sundials-config -m cvode|cvodes|ida|kinsol -t s|p -l c|f [-s libs|cppflags -hv]
 Requires: standard GNU commands
 Options:
    -m cvode|cvodes|ida|kinsol   SUNDIALS module
    -t s|p                       use serial or parallel vectors
    -l c|f                       use C or Fortran
    -s libs|cppflags             show linking flags or C preprocessor flags.
                                 (show both if option not given.)
    -h                           usage and options (this help)
    -v                           view this script
 Notes:
    '-l f' is not valid for '-m cvodes'
    '-s cppflags' returns an empty string for '-l f'

With this, a sample Makefile to compile a CVODE application witten in C and using the serial NVECTOR

module could look as follows:

SHELL = /bin/sh
 
CC       = gcc
CFLAGS   = -g -O
CPPFLAGS =
LDFLAGS  =
 
SUN_DISTRO = /home/radu/CODES/sundials-2.3.0-mpich1_gcc
 
MY_APPS = app1 app2

all:
     @sun_cppflags=`eval "${SUN_DISTRO}/bin/sundials-config -m cvode -t s -l c -s cppflags"`; \
     sun_ldflags=`eval "${SUN_DISTRO}/bin/sundials-config -m cvode -t s -l c -s libs"`;       \
     for i in ${MY_APPS} ; do                                                                 \
     echo "--- Making $${i} ---" ;                                                            \
     eval "make SUN_CPPFLAGS='$${sun_cppflags}' SUN_LDFLAGS='$${sun_ldflags}' $${i}";         \
     done 

app1: app1.c
        ${CC} ${CPPFLAGS} ${SUN_CPPFLAGS} ${CFLAGS} -c app1.c
        ${CC} -o app1 app1.o ${CFLAGS} ${LDFLAGS} ${SUN_LDFLAGS}
app2: app2.c
        ${CC} ${CPPFLAGS} ${SUN_CPPFLAGS} ${CFLAGS} -DMY_PREPROC_DIR -c app2.c
        ${CC} -o app2 app2.o ${CFLAGS} ${LDFLAGS} ${SUN_LDFLAGS}

clean:
        rm -f *.o
        rm -f ${MY_APPS}

Documentation and Support

Fore more information about the four solvers CVODE, CVODES, IDA, and KINSOL, please read the documentation as it comes with the source code in the directory

$SUNDIALS_DOC

Some examples are available below

$SUNDIALS_EXAMPLES
More details about compilers and options ( Fortran, MPI, library, Matlab, supports ) read
$README-LRZ and $INSTALL_NOTES 

on the systems where SUNDIAL is installed.

Support

For questions concerning the usage of the SUNDIALS library at LRZ contact: Dr. M. Allalen (089) 35831-8816