Skip to content

GLAD M25 in ADIOS1 (Detailed Instructions are ADIOS1)

Wenjie Lei edited this page Apr 7, 2022 · 1 revision

In order to use Adios format, you need to install the adios library on the computing cluster. In the following, we will provide all the info you need to install ADIOS and enable SPECFEM3D_GLOBE to use the ADIOS format for the simulations.

There are a total of three steps to get ADIOS running.

  1. Download and Unzip
  2. Compile
  3. Add necessary flags to SPECFEM3D_GLOBE configuration

1. Download and Unzip

Important to note is the fact that with updated versions the link may change as noted below. However, installation procedure should stay more or less the same.

# Where
PACKAGE_DIR="<where/to/install>"
ADIOS_DIR="${PACKAGE_DIR}/adios"

# This link is subject to change of course
ADIOS_LINK="https://users.nccs.gov/~pnorbert/adios-1.13.1.tar.gz"

# Change your directory
cd $PACKAGE_DIR
mkdir adios

# Dowloading the tarball at the link location and renaming it
wget --no-check-certificate -O adios.tar.gz $ADIOS_LINK
# or on, e.g., macOS
curl $ADIOS_LINK --output adios.tar.gz  

# Decompress
tar -xzvf adios.tar.gz --strip-components=1 -C $ADIOS_DIR

2 Compile

Whe you define the compilers it is important to choose the same ones as you choose for the compilation of SPECFEM3D_GLOBE -- this avoids incompatitbility issues. Here, for simplicity's sake, we choose gcc.

## Where to build -- we choose in place
ADIOS_DESTDIR="${ADIOS_DIR}/build"

# C/C++/Fortran compiler
CC=gcc
CXX=g++
FC=gfortran

# Create and navigate to build directory
cd $ADIOS_DIR
mkdir $ADIOS_DESTDIR && cd build

# Configure the build
../configure CC=$CC CXX=$CXX FC=$FC --prefix="$ADIOS_DESTDIR"

# Compile 
make -j
make install

3. Configure Specfem

Here, three things have to happen. First, SPECFEM3D_GLOBE has to be configured to use ADIOS. Second, the model file has to be copied to the GLL directory. Third, the Par_file has to be changed to use ADIOS files.

When configuring SPECFEM3D_GLOBE, add the --with-adios and ADIOS_CONFIG flags like so:

ADIOS_CONFIG="$ADIOS_DESTDIR/bin/adios_config"

# Configure
./configure ... \
    ...\
    --with-adios ADIOS_CONFIG="$ADIOS_CONFIG"

Note that the ... are just place holders for all the other configuration flags.

Then, move the model file to SPECFEM3D_GLOBE/DATA/GLL -- create the directory if it doesn't exist.

modelfile=<where/the/model/is/model.bp>

cp $modelfile <where/specfem3D_globe/DATA/GLL/model.bp>

The following lines have to be changed in the Par_file

...
MODEL                           = GLL
...
# At the very end of the file
# set to true to use the ADIOS library for I/Os
ADIOS_ENABLED                   = .true.
ADIOS_FOR_FORWARD_ARRAYS        = .true.
ADIOS_FOR_MPI_ARRAYS            = .true.
ADIOS_FOR_ARRAYS_SOLVER         = .true.
ADIOS_FOR_SOLVER_MESHFILES      = .true.
ADIOS_FOR_AVS_DX                = .true.
ADIOS_FOR_KERNELS               = .true.
ADIOS_FOR_MODELS                = .true.
ADIOS_FOR_UNDO_ATTENUATION      = .true.

Note that not all ADIOS flags have to be set to true, but ADIOS_FOR_MODELS has to be set to .true.. To use GLAD-M25.

Then, you are set to compile SPECFEM3D_GLOBE's mesher.

A full suite of scripts that brings you from nothing to simulation is provided here: SpecfemMagic.