SUNDIALS

Category: Libraries-Math

Description

SUite of Nonlinear and DIfferential/ALgebraic equation Solvers Center for Applied Scientific Computing, LLNL,

The family of solvers referred to as SUNDIALS consists of solvers CVODE (for ODE systems), CVODES (ODE with sensitivity analysis capabilities), IDA (for differential-algebraic systems), and KINSOL (for nonlinear algebraic systems).

The various solvers of this family share many subordinate modules. For this reason, it is organized as a family, with a directory structure that exploits that sharing. Each individual solver includes documentation on installation, along with full usage documentation.

The following is a list of the solver packages presently available.

See: https://computation.llnl.gov/casc/sundials/description/description.html

SUNDIALS was implemented with the goal of providing robust time integrators and nonlinear solvers that can easily be incorporated into existing simulation codes. The primary design goals were to require minimal information from the user, allow users to easily supply their own data structures underneath the solvers, and allow for easy incorporation of user-supplied linear solvers and preconditioners.

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. In addition, all parallelism is contained within specific vector operations (norms, dot products, etc.) No other operations within the solvers require knowledge of parallelism. Thus, using a solver in parallel consists of using a parallel vector implementation, either the one provided with SUNDIALS, or the user's own parallel vector structure, underneath the solver. Hence, we do not make a distinction between parallel and serial versions of the codes.

Use

How do I link the SUNDIALS libraries to my 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 available in instdir/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}

Support

This package has the following support level : Unsupported

Available Versions

Version Available Builds
pgi pathscale gnu Other
2.3.0
v
v
v