Releases: PrincetonUniversity/SPECFEMPP
v0.4.0
🚀 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.
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.
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.
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_container
→ data_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
Acoustic Simulation
Elastic-Acoustic coupled simulation
New Contributors
- @cmorency1 made their first contribution in #680
- @arja2 made their first contribution in #682
- @maxlchien made their first contribution in #916
Statistics
Changelog
👨🔬 New physics
- Add elastic shear wave enumerations by @Rohit-Kakodkar in #507
- Updates mesh reader for shear waves by @Rohit-Kakodkar in #520
- [Main PR] Add SH domain support by @Rohit-Kakodkar in #578
- Issue 579 -- EM mesh reader by @lsawade in #593
- Generate electromagnetic meshes by @Rohit-Kakodkar in #625
- Poroelastic mesh reader by @Rohit-Kakodkar in #649
- Issue 557 and 626: displacement tests for poroelastic and electromagnetic domains by @icui in #627
- Added damping forces by @Rohit-Kakodkar in #652
- Issue 587 - Adds Point kernels, point_properties for EM by @lsawade in #622
- Issue 590 -- Updates Sources for EM & adds tests for EM & PE assembly kernels and properties by @lsawade in #624
...
v0.3.0
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
- @int-ptr-ptr made their first contribution in #138
- @sirpipat made their first contribution in #154
Changes
Python Bindings
- Enabling
pip install
by @icui in #174 - Hello world for pybind by @icui in #186
- Basic Python executable by @icui in #197
- Remove [build-system] by @icui in #235
- Final implementation by @icui in #230
- Allow for receiver and source definition from Python by @lsawade in #397
- Capture Ctrl-C with Python binding by @icui in #415
Anisotropic media
PRs for the anisotropy implementation tracked by:
- Implemented new anisotropic material::properties and the allowed for reading by @lsawade in #263
- Implements point properties for anisotropic media by @Rohit-Kakodkar in #267
- Implement anisotropic properties_container. by @icui in #269
- Implements test for
specfem::mesh::materials
by @Rohit-Kakodkar in #273 - Added the anisotropic medium header by @lsawade in #271
- Added anisotropic receivers by @Rohit-Kakodkar in #284
- Added anisotropic mass matrix computations by @Rohit-Kakodkar in #286
- Added template specializations for acoustic and elastic kernels class by @Rohit-Kakodkar in #291
- Added anisotropic template instantiations by @Rohit-Kakodkar in #290
- Added method to compute anisotropic stacey traction by @Rohit-Kakodkar in #288
- Added anisotropic sources by @Rohit-Kakodkar in #283
- Added anisotropic tags to element ordering by @Rohit-Kakodkar in #282
- Implement kernels_container by @icui in #294
- Implementation of Frechet derivatives by @lsawade in #298
- Updated the driver function for frechet derivatives + fixes Tromp2005 snakefile.in by @lsawade in #304
- kernel writer by @icui in #300
- Fixed seg faults on tests | Fixed wavefield plotting by @Rohit-Kakodkar in #312
Visualization
- Added display section to runtime configuration by @Rohit-Kakodkar in #129
- Added write method for the plotter by @Rohit-Kakodkar in #131
- Wavefield access at x-th timestep by @Rohit-Kakodkar in #135
- Implements plotting routines for wavefields by @Rohit-Kakodkar in #139
- Added display section to docs by @Rohit-Kakodkar in #171
- Add visualization docs by @Rohit-Kakodkar in #180
- Live Screen Update capability by @Rohit-Kakodkar in #191
New Cookbooks & Examples
- Fluid-Solid Bathymetry by @sirpipat in #154 and #241 by @Rohit-Kakodkar
- Implement Anisotropic Crystal example by @lsawade in #308
- Solid-Solid-interface (Computational Seismology homework 9) cookbook and restructure Cookbooks by @lsawade in #385
New features added capabilities
- Pressure Wavefield by @Rohit-Kakodkar in #165
- Pressure Seismogram by @int-ptr-ptr in #138
- Pressure Seismogram fixes by @Rohit-Kakodkar in #229
- Pressure seismogram fixes by @Rohit-Kakodkar in #322
- Adds first derivative of the Gaussian as a source_time_function by @lsawade in #382
MacOS Support
- Compilation on MacOS by @lsawade in #166
- Implements seamless plotting using VTK on MacOS by @lsawade in #237
- Makes VTK an optional dependency in
CMakeLists.txt
by @Rohit-Kakodkar in #265
Other Updates
v0.3.0-release-candidate
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
- @int-ptr-ptr made their first contribution in #138
- @sirpipat made their first contribution in #154
Changes
Python Bindings
- Enabling
pip install
by @icui in #174 - Hello world for pybind by @icui in #186
- Basic Python executable by @icui in #197
- Remove [build-system] by @icui in #235
- Final implementation by @icui in #230
- Allow for receiver and source definition from Python by @lsawade in #397
- Capture Ctrl-C with Python binding by @icui in #415
Anisotropic media
PRs for the anisotropy implementation tracked by:
- Implemented new anisotropic material::properties and the allowed for reading by @lsawade in #263
- Implements point properties for anisotropic media by @Rohit-Kakodkar in #267
- Implement anisotropic properties_container. by @icui in #269
- Implements test for
specfem::mesh::materials
by @Rohit-Kakodkar in #273 - Added the anisotropic medium header by @lsawade in #271
- Added anisotropic receivers by @Rohit-Kakodkar in #284
- Added anisotropic mass matrix computations by @Rohit-Kakodkar in #286
- Added template specializations for acoustic and elastic kernels class by @Rohit-Kakodkar in #291
- Added anisotropic template instantiations by @Rohit-Kakodkar in #290
- Added method to compute anisotropic stacey traction by @Rohit-Kakodkar in #288
- Added anisotropic sources by @Rohit-Kakodkar in #283
- Added anisotropic tags to element ordering by @Rohit-Kakodkar in #282
- Implement kernels_container by @icui in #294
- Implementation of Frechet derivatives by @lsawade in #298
- Updated the driver function for frechet derivatives + fixes Tromp2005 snakefile.in by @lsawade in #304
- kernel writer by @icui in #300
- Fixed seg faults on tests | Fixed wavefield plotting by @Rohit-Kakodkar in #312
Visualization
- Added display section to runtime configuration by @Rohit-Kakodkar in #129
- Added write method for the plotter by @Rohit-Kakodkar in #131
- Wavefield access at x-th timestep by @Rohit-Kakodkar in #135
- Implements plotting routines for wavefields by @Rohit-Kakodkar in #139
- Added display section to docs by @Rohit-Kakodkar in #171
- Add visualization docs by @Rohit-Kakodkar in #180
- Live Screen Update capability by @Rohit-Kakodkar in #191
New Cookbooks & Examples
- Fluid-Solid Bathymetry by @sirpipat in #154 and #241 by @Rohit-Kakodkar
- Implement Anisotropic Crystal example by @lsawade in #308
- Solid-Solid-interface (Computational Seismology homework 9) cookbook and restructure Cookbooks by @lsawade in #385
New features added capabilities
- Pressure Wavefield by @Rohit-Kakodkar in #165
- Pressure Seismogram by @int-ptr-ptr in #138
- Pressure Seismogram fixes by @Rohit-Kakodkar in #229
- Pressure seismogram fixes by @Rohit-Kakodkar in #322
- Adds first derivative of the Gaussian as a source_time_function by @lsawade in #382
MacOS Support
- Compilation on MacOS by @lsawade in #166
- Implements seamless plotting using VTK on MacOS by @lsawade in #237
- Makes VTK an optional dependency in
CMakeLists.txt
by @Rohit-Kakodkar in #265
Other Updates
- Restructure IO routines by @lsawade in #157
- General
CMakeLists.txt
updates - 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...
v0.2.0
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
-
Assembly implementation by @Rohit-Kakodkar in #103
- Addedspecfem::compute::assembly
, which holds all the assembly information
-specfem::compute::assembly
is organized to optimize for caching on CPUs and Coalescing on GPUs
- Documentation https://specfem2d-kokkos.readthedocs.io/en/devel/api/assembly/index.html -
Reimplement kernels by @Rohit-Kakodkar in #104
- Re-implemented compute kernels as elemental functions -
Write forward fields by @Rohit-Kakodkar in #105
- implemented forward wavefield writer
- implemeted IO libraries for ASCII and HDF5 -
Read backward fields by @Rohit-Kakodkar in #106
- Implemented wavefield readers -
Adjoint sources by @Rohit-Kakodkar in #107
- Implented adjoint sources
- External source time functions -
Adjoint simulations by @Rohit-Kakodkar in #112
- Implemented Misfit Kernels
- Implemented solver for combined forward-adjoint simulations
- SIMD implementation
- Writer for Misfit Kernels
Full Changelog: v0.1.0...0.2.0
0.2.0-release-candidate
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
-
Assembly implementation by @Rohit-Kakodkar in #103
- Addedspecfem::compute::assembly
, which holds all the assembly information
-specfem::compute::assembly
is organized to optimize for caching on CPUs and Coalescing on GPUs
- Documentation https://specfem2d-kokkos.readthedocs.io/en/devel/api/assembly/index.html -
Reimplement kernels by @Rohit-Kakodkar in #104
- Re-implemented compute kernels as elemental functions -
Write forward fields by @Rohit-Kakodkar in #105
- implemented forward wavefield writer
- implemeted IO libraries for ASCII and HDF5 -
Read backward fields by @Rohit-Kakodkar in #106
- Implemented wavefield readers -
Adjoint sources by @Rohit-Kakodkar in #107
- Implented adjoint sources
- External source time functions -
Adjoint simulations by @Rohit-Kakodkar in #112
- Implemented Misfit Kernels
- Implemented solver for combined forward-adjoint simulations
- SIMD implementation
- Writer for Misfit Kernels
Full Changelog: v0.1.0...0.2.0-release-candidate
v0.1.0
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
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
- @lsawade made their first contribution in #40
- @williameaton made their first contribution in #73
- @sirpipat made their first contribution in #79
- @icui made their first contribution in #74
Full Changelog: https://github.com/PrincetonUniversity/SPECFEMPP/commits/v0.1.0-release-candidate
v0.0.1-beta
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
- @Rohit-Kakodkar made their first contribution in #1
- @lsawade made their first contribution in #40
Full Changelog: https://github.com/PrincetonUniversity/specfem2d_kokkos/commits/v0.0.1-beta