Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,4 @@ profiles
.cache/
test*.cpp
test*.hpp
include/specfem_setup.hpp
2 changes: 1 addition & 1 deletion .jenkins/gnu_compiler_checks.gvy
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ pipeline{
}
axis{
name 'HostSpace'
values 'SERIAL;-DKokkos_ENABLE_SERIAL=ON -DKokkos_ENABLE_ATOMICS_BYPASS=ON;-n 1', 'OPENMP;-DKokkos_ENABLE_OPENMP=ON;-n 10'
values 'SERIAL;-DKokkos_ENABLE_SERIAL=ON -DKokkos_ENABLE_ATOMICS_BYPASS=ON;-n 1', 'OPENMP;-DKokkos_ENABLE_OPENMP=ON;-n 1 -c 10'
}
}
stages {
Expand Down
2 changes: 1 addition & 1 deletion .jenkins/intel_compiler_checks.gvy
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ pipeline{
}
axis{
name 'HostSpace'
values 'SERIAL;-DKokkos_ENABLE_SERIAL=ON -DKokkos_ENABLE_ATOMICS_BYPASS=ON;-n 1', 'OPENMP;-DKokkos_ENABLE_OPENMP=ON;-n 10'
values 'SERIAL;-DKokkos_ENABLE_SERIAL=ON -DKokkos_ENABLE_ATOMICS_BYPASS=ON;-n 1', 'OPENMP;-DKokkos_ENABLE_OPENMP=ON;-n 1 -c 10'
}
axis{
name 'SIMD'
Expand Down
2 changes: 1 addition & 1 deletion .jenkins/nvidia_compiler_checks.gvy
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ pipeline{
}
axis{
name 'HostSpace'
values 'SERIAL;-DKokkos_ENABLE_SERIAL=ON;-n 1', 'OPENMP;-DKokkos_ENABLE_OPENMP=ON;-n 10'
values 'SERIAL;-DKokkos_ENABLE_SERIAL=ON;-n 1', 'OPENMP;-DKokkos_ENABLE_OPENMP=ON; -n 1 -c 10'
}
axis{
name 'DeviceSpace'
Expand Down
44 changes: 35 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.17.5)

project(SPECFEMPP VERSION 0.1.0)
project(SPECFEMPP VERSION 0.1.0 LANGUAGES CXX Fortran)

set(CMAKE_CXX_STANDARD 17)
option(HDF5_CXX_BUILD "Build HDF5 C++" ON)
Expand All @@ -11,6 +11,8 @@ option(BUILD_EXAMPLES "Examples included" ON)
option(ENABLE_SIMD "Enable SIMD" OFF)
option(ENABLE_PROFILING "Enable profiling" OFF)
option(SPECFEMPP_BINDING_PYTHON "Enable Python binding" OFF)
option(ENABLE_DOUBLE_PRECISION "Enable double precision" OFF)

# set(CMAKE_BUILD_TYPE Release)
set(CHUNK_SIZE 32)
set(NUM_CHUNKS 1)
Expand Down Expand Up @@ -158,14 +160,6 @@ else()
endif()


configure_file(constants.hpp.in constants.hpp)

include_directories(include)
include_directories(${CMAKE_BINARY_DIR})

add_subdirectory(fortran/meshfem2d)
add_subdirectory(fortran/meshfem3d)

if (ENABLE_SIMD)
message("-- Enabling SIMD")
add_definitions(-DENABLE_SIMD)
Expand All @@ -176,6 +170,30 @@ if (ENABLE_PROFILING)
add_definitions(-DENABLE_PROFILING)
endif()

if (ENABLE_DOUBLE_PRECISION)
message("-- Enabling double precision")
set(TYPE_REAL "double")
else(ENABLE_DOUBLE_PRECISION)
message("-- Enabling single precision")
set(TYPE_REAL "float")
endif(ENABLE_DOUBLE_PRECISION)

# Configure the setup headers
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/setup/specfem_setup.hpp.in
${CMAKE_BINARY_DIR}/include/specfem_setup.hpp)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/setup/constants.hpp.in
${CMAKE_BINARY_DIR}/include/constants.hpp)

# Add the include directories so that the generated files can be found
include_directories(include)
include_directories(${CMAKE_BINARY_DIR}/include)

# ========== MESHFEM ==============
add_subdirectory(fortran/meshfem2d)
add_subdirectory(fortran/meshfem3d)
# =================================


# Build specfem2d libraries
add_library(
quadrature
Expand All @@ -197,12 +215,17 @@ add_library(
src/IO/sources.cpp
src/IO/receivers.cpp
src/IO/mesh.cpp
# Fortran 2D part
src/IO/mesh/impl/fortran/dim2/read_boundaries.cpp
src/IO/mesh/impl/fortran/dim2/read_elements.cpp
src/IO/mesh/impl/fortran/dim2/read_material_properties.cpp
src/IO/mesh/impl/fortran/dim2/read_mesh_database.cpp
src/IO/mesh/impl/fortran/dim2/read_interfaces.cpp
src/IO/mesh/impl/fortran/dim2/read_parameters.cpp
# Fortran 3D part
src/IO/mesh/impl/fortran/dim3/read_parameters.cpp
src/IO/mesh/impl/fortran/dim3/read_mapping.cpp
src/IO/mesh/impl/fortran/dim3/read_coordinates.cpp
)

if (NOT HDF5_CXX_BUILD)
Expand Down Expand Up @@ -304,6 +327,9 @@ add_library(
src/mesh/coupled_interfaces/interface_container.cpp
src/mesh/coupled_interfaces/coupled_interfaces.cpp
src/mesh/tags/tags.cpp
src/mesh/parameters/parameters.cpp
src/mesh/mapping/mapping.cpp
src/mesh/coordinates/coordinates.cpp
src/mesh/mesh.cpp
)

Expand Down
43 changes: 43 additions & 0 deletions CMakePresets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"version": 6,
"configurePresets": [
{
"name": "release",
"displayName": "Default Release -- SIMD enabled",
"binaryDir": "build/release",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release",
"BUILD_TESTS": "ON",
"ENABLE_SIMD": "ON",
"Kokkos_ARCH_NATIVE": "ON",
"Kokkos_ENABLE_AGGRESSIVE_VECTORIZATION": "ON",
"Kokkos_ENABLE_ATOMICS_BYPASS": "ON"
}
},
{
"name": "debug",
"displayName": "Default Debug -- SIMD enabled",
"binaryDir": "build/debug",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"BUILD_TESTS": "ON",
"ENABLE_SIMD": "ON",
"Kokkos_ARCH_NATIVE": "ON",
"Kokkos_ENABLE_AGGRESSIVE_VECTORIZATION": "ON",
"Kokkos_ENABLE_ATOMICS_BYPASS": "ON"
}
}
],
"buildPresets": [
{
"name": "release",
"configurePreset": "release",
"targets": ["all"]
},
{
"name": "debug",
"configurePreset": "debug",
"targets": ["all"]
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,7 @@ The code is divided into set of modules (classes and structs), the major of whic
mesh
compute
domain



CUSTOM_REAL
1 change: 1 addition & 0 deletions examples/dim3/homogeneous_halfspace/specfem_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ parameters:
## databases
databases:
mesh-database: "OUTPUT_FILES/DATABASES_MPI/proc000000_external_mesh.bin"
mesh-parameters: "OUTPUT_FILES/DATABASES_MPI/mesh_parameters.bin"

## sources
sources: "/Users/lsawade/SPECFEMPP/examples/homogeneous-medium-flat-topography/source.yaml"
5 changes: 5 additions & 0 deletions fortran/meshfem2d/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
config.h
constants.h
precision.h
config.fh
version.fh
Loading