Skip to content

Releases: PrincetonUniversity/SPECFEMPP

v0.4.0

26 Jun 12:38
8c3a12d
Compare
Choose a tag to compare

🚀 TL;DR

Physics updates:

  • Support for elastic SH wave simulation (forward simulation support)
  • Support for Poro-elastic domains (forward simulation support)
  • Support for Cosserat domains (forward simulation support)

Performance Improvements:

  • Memory layout optimization. Solver time on par with SPECFEM2D.

Code maintainance:

  • New macros for better code generation
  • Introduced iterator framework to define parallelism over different solver loops.

Refactoring

  • Split examples into examples and benchmarks directories.

Configuration

  • Introduces CMAKE presets for regularly used build configurations

Maintenance

  • Updates Kokkos version to 4.6.1.
  • Adds support for AMD GPUs
  • Adds support for parallel testing

📋 What's New

Support for elastic SH wave

Wave propagation of an SH wave in an elastic medium in response to a transverse force source Ricker source time function. The domain has one horizontal interface in the vertical center of the domain splitting a slower upper from a faster lower layer.

SH wave simulation with interface

Support for Poro-elastic domains

Below wave propagation simulation in a homogeneous poroelastic medium in response to a medium central downward force in acting on.

Poro-elastic Simulation in a homogeneous medium

Support for Cosserat domains

Below a simulation of wave propagation in a Cosserat medium in response to a central downward force. On the left the norm of the displacement wavefield and on the right the rotational field around the transverse axis.

Wave propagation in a homogeneous Cosserat medium

New macros for better code generation

This feature streamlines the codebase by eliminating redundant code, making it easier to maintain. In addition to improved maintainability, this feature significantly reduces the amount of code required to implement a new medium. Below the old and new way to introduce a new data container to the solver, by the example of acoustic-isotropic media.

The old way of defining the property_container

For each medium/property combination, the previous code required the user to define the following properties container, that is used to store the properties for relevant elements.

template <>
struct properties_container<acoustic isotropic specialization> {

  using ViewType = typename Kokkos::View<type_real ***, Kokkos::LayoutLeft,
                                         Kokkos::DefaultExecutionSpace>;

  int nspec; ///< total number of acoustic spectral elements
  int ngllz; ///< number of quadrature points in z dimension
  int ngllx; ///< number of quadrature points in x dimension
  ViewType rho_inverse;
  ViewType::HostMirror h_rho_inverse;
  ViewType kappa;
  ViewType::HostMirror h_kappa;

  properties_container(const int nspec, const int ngllz, const int ngllx)
      : nspec(nspec), ngllz(ngllz), ngllx(ngllx),
        rho_inverse("specfem::compute::properties::rho_inverse", nspec, ngllz,
                    ngllx),
        h_rho_inverse(Kokkos::create_mirror_view(rho_inverse)),
        kappa("specfem::compute::properties::kappa", nspec, ngllz, ngllx),
        h_kappa(Kokkos::create_mirror_view(kappa)) {}

	template<...>
  KOKKOS_FORCEINLINE_FUNCTION void
  load_device_properties(index, point_property) const { ... }

  template<...>
  load_device_properties(index, point_property) const { ... }

  template<...> 
  inline void
  load_host_properties(index, point_property) const { ... }

  template<...>
  inline void
  load_host_properties(index, point_property) const { ... }

  void copy_to_device() {
    Kokkos::deep_copy(rho_inverse, h_rho_inverse);
    Kokkos::deep_copy(kappa, h_kappa);
  }

  void copy_to_host() {
    Kokkos::deep_copy(h_rho_inverse, rho_inverse);
    Kokkos::deep_copy(h_kappa, kappa);
  }

  template<...>
  inline void assign(index, point_property) const { ... }
};

Even after omitting quite a few code blocks with ... for clarity, leaving ~25% of the code, it is clear that this is not very user friendly, nor maintainable, and too specialized with the perspective of implementing new physics, which is why we needed a more concise, simpler way to approach new data.

The new way of defining the property_containerdata_container

Using macros we can wrap all of the above medium/property specific code into a single line that takes in the variable names and generates all of the above required code during the preprocessing stage.

template <acoustic isotropic specialization>
struct data_container {
  constexpr static auto dimension = specfem::dimension::type::dim2;
  constexpr static auto medium_tag = MediumTag;
  constexpr static auto property_tag =
      specfem::element::property_tag::isotropic;

  DATA_CONTAINER(kappa, mu, rho)
};

A complete documentation for available macros can be found here

CMake Presets

Prior to this release the one always need to manually define the all flags. For example, for a CUDA release build, the user needed to

cmake3 -S . -B build/release-cuda -D CMAKE_BUILD_TYPE=Release -D BUILD_TESTS=ON -D Kokkos_ENABLE_CUDA=ON -D Kokkos_ARCH_<architecture>=ON
cmake --build build/release-cuda

to build the software. We added CMakePresets.json for a variety of “standard” compilations. Which allow for building using

cmake --preset release-cuda
cmake --build --preset release-cuda

We want to advertise this feature in particular since cmake allows for CMakeUserPresets.json which if located in the SPECFEM++ root directory takes precedence over CMakePresets.json and can be used for super custom user installation without having to populate 4 lines of the command line every time you want to build. The list of “standard” presets are:

"release"          - Default Release -- SIMD enabled
"release-nosimd"   - Release -- SIMD disabled
"release-cuda"     - Release -- CUDA enabled
"release-hip"      - Release -- HIP enabled
"release-frontier" - Release Frontier -- HIP enabled
"debug"            - Default Debug -- SIMD enabled
"debug-cuda"       - Debug -- CUDA enabled
"debug-nosimd"     - Debug -- SIMD disabled

Performance

The plots below show the performance of SPECFEM++ compared to SPECFEM2D:

Elastic simulation

Performance on CPU -- Homogeneous Elastic Performance on GPU -- Homogeneous Elastic

Acoustic Simulation

Performance on CPU -- Homogeneous Acoustic Performance on GPU -- Homogeneous Acoustic

Elastic-Acoustic coupled simulation

Performance on CPU -- Elastic-Acoustic Performance on GPU -- Elastic-Acoustic

New Contributors

Statistics

Commits and PRs since the last Release

Changelog

👨‍🔬 New physics

Read more

v0.3.0

18 Feb 14:58
4fc63c1
Compare
Choose a tag to compare

What's Changed

This release contains a few major updates:

  • Python Bindings
  • Anisotropy Implementation
  • Refactor for easier implementation of new media
  • Visualization using VTK
  • New examples and cookbooks
  • meshfem3d integration (note: no IO or simulation support yet)
  • macOS support

Details for each of these are below

New Contributors

Changes

Python Bindings

Anisotropic media

PRs for the anisotropy implementation tracked by:

#257

Visualization

New Cookbooks & Examples

New features added capabilities

MacOS Support

Other Updates

  • Fixed testing with OpenMP by @lsawade in [https://github.com//pull/452]
  • Update commit template by @lsawade in [https://github.com//pull/470]
  • Restructure IO routines by @lsawade in #157
  • General CMakeLists.txt updates
    • Update for MPI_PARALLEL flag by @icui in #203
  • CI Updates
    • Updated Jenkins artifact folder by @Rohit-Kakodkadr in #184
    • Jenkins fix for GNU tests by @Rohit-Kakodkar in #219
    • Fix Boost installation to remove non-official dependency by @lsawade in #358
    • Fixing docker image creation by @lsawade in [https...
Read more

v0.3.0-release-candidate

05 Feb 15:51
ac02df2
Compare
Choose a tag to compare
Pre-release

What's Changed

This release contains a few major updates:

  • Python Bindings
  • Anisotropy Implementation
  • Refactor for easier implementation of new media
  • Visualization using VTK
  • New examples and cookbooks
  • meshfem3d integration (note: no IO or simulation support yet)
  • macOS support

Details for each of these are below

New Contributors

Changes

Python Bindings

Anisotropic media

PRs for the anisotropy implementation tracked by:

#257

Visualization

New Cookbooks & Examples

New features added capabilities

MacOS Support

Other Updates

  • Restructure IO routines by @lsawade in #157
  • General CMakeLists.txt updates
    • Update for MPI_PARALLEL flag by @icui in #203
  • CI Updates
    • Updated Jenkins artifact folder by @Rohit-Kakodkadr in #184
    • Jenkins fix for GNU tests by @Rohit-Kakodkar in #219
    • Fix Boost installation to remove non-official dependency by @lsawade in #358
    • Fixing docker image creation by @lsawade in #356
    • Fixed clang-format issue for header files. by @lsawade in [https://github.com/Princeto...
Read more

v0.2.0

05 Nov 15:15
f54b50f
Compare
Choose a tag to compare

Description

This release adds support for forward-adjoint simulations and computing Misfit Kernels. Have a look at example 03 for user guide on how to use adjoint capabilities within SPECFEM++.

Documentation

The documentation for this release can be found here

Getting the code

git clone https://github.com/PrincetonUniversity/SPECFEMPP && \
cd SPECFEMPP && \
git checkout tags/0.2.0

What's Changed

Full Changelog: v0.1.0...0.2.0

0.2.0-release-candidate

16 Oct 13:30
5086419
Compare
Choose a tag to compare
Pre-release

Description

This release adds support for forward-adjoint simulations and computing Misfit Kernels. Have a look at example 03 for user guide on how to use adjoint capabilities within SPECFEM++.

Documentation

The documentation for this release can be found here

Getting the code

git clone https://github.com/PrincetonUniversity/SPECFEMPP && \
cd SPECFEMPP && \
git checkout tags/0.2.0-release-candidate

What's Changed

Full Changelog: v0.1.0...0.2.0-release-candidate

v0.1.0

09 Jan 21:31
d199e41
Compare
Choose a tag to compare

Major Release Candidate

New Features

  • GLL Library

    • GLL library implementation to compute GLL points and weights.
  • Meshing (MESHFEM)

    • MESHFEM2D is included as the default mesher in this release
    • Implemented MESH database reader for fortran binary generated by MESHFEM
  • Sources

    • Force Source
    • Moment-tensor source
  • Source time function

    • Dirac delta source
    • Ricker (Gaussian) source
  • Receiver

    • Displacement
    • Velocity
    • Acceleration
  • Physics

    • Elastic Domain
    • Acoustic Domain
    • Elastic-Acoustic Coupling
  • Boundary Conditions

    • Free surface
    • Stacey
  • Solver

    • Newmark Time-Marching Solver

Major Changes

  • None

Minor Changes

  • None

Known Issues (Bugs)

Patches will be released soon for these bugs.

  • Memory corruption issue for Dirichlet, Stacey and Composite BC on IntelLLVM compiler 2022.2.0 when running tests. The solver does not experience these issues. Check pull request #100

New Contributors

v0.1.0-release-candidate

03 Jan 18:01
35d2f06
Compare
Choose a tag to compare
Pre-release

Major Release Candidate

New Features

  • GLL Library

    • GLL library implementation to compute GLL points and weights.
  • Meshing (MESHFEM)

    • MESHFEM2D is included as the default mesher in this release
    • Implemented MESH database reader for fortran binary generated by MESHFEM
  • Sources

    • Force Source
    • Moment-tensor source
  • Source time function

    • Dirac delta source
    • Ricker (Gaussian) source
  • Receiver

    • Displacement
    • Velocity
    • Acceleration
  • Physics

    • Elastic Domain
    • Acoustic Domain
    • Elastic-Acoustic Coupling
  • Boundary Conditions

    • Free surface
    • Stacey
  • Solver

    • Newmark Time-Marching Solver

Major Changes

  • None

Minor Changes

  • None

Known Issues (Bugs)

Patches will be released soon for these bugs.

  • Memory corruption issue for Dirichlet, Stacey and Composite BC on IntelLLVM compiler 2022.2.0
  • Composite BC do not work using CUDA

New Contributors

Full Changelog: https://github.com/PrincetonUniversity/SPECFEMPP/commits/v0.1.0-release-candidate

v0.0.1-beta

14 Mar 20:16
06b2b42
Compare
Choose a tag to compare

Initial release of SPECFEM2D KOKKOS package

We are pleased to announce first release 0.0.1-beta for Kokkos implementation of SPECFEM2D package. This version of the package is able to simulate wave propagation through elastic homogeneous media in 2-Dimensions.

What's Changed

  • New: Added support for GLL quadrature by @Rohit-Kakodkar in #5
  • New: Read fortran mesh database files generated by xmeshfem2d by @Rohit-Kakodkar in #7
  • New: Create a Mesh struct to store the mesh (The mesh is created by reading the database binaries created by xmeshfem2d) by @Rohit-Kakodkar in #8
  • New: Implemeted a source class (Currently only Dirac sources are enabled in this version of the package) by @Rohit-Kakodkar in #20
  • New: Implemented Newmark Timescheme, Implemented domain class to store wavefields by @Rohit-Kakodkar in #21
  • New: Enabled GPU support (First working GPU implementation) by @Rohit-Kakodkar in #26
  • New: Implemented a time-marching (explicit) solver to simulate wave propagation by @Rohit-Kakodkar in #28
  • New: Enabled simulation setup using a parameter YAML file by @Rohit-Kakodkar in #31
  • New: Added support for command line parsing by @Rohit-Kakodkar in #34
  • New: Added cookbook example for simulating wave propagation through homogeneous media by @Rohit-Kakodkar in #39
  • New: Implemented routines to compute and store seismographs (Implemented a seismograph writer) by @Rohit-Kakodkar in #43
  • Thanks to @lsawade, @icui and @EtienneBachmann for their help with running the code and with changes to the documentation

New Contributors

Full Changelog: https://github.com/PrincetonUniversity/specfem2d_kokkos/commits/v0.0.1-beta