Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Temporary PR for build test #565

Open
wants to merge 105 commits into
base: devel
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
105 commits
Select commit Hold shift + click to select a range
8b23ea5
Updated the save_database function to write element by element
Rohit-Kakodkar Jan 14, 2025
a99f09c
Merge pull request #392 from PrincetonUniversity/issue-391
Rohit-Kakodkar Jan 16, 2025
5469bf9
Merge branch 'devel' into issue-390
Rohit-Kakodkar Jan 21, 2025
d7ea90d
Merge branch 'issue-228-anisotropy' into issue-390
Rohit-Kakodkar Jan 23, 2025
2d660ed
Added 3D mesh example
Rohit-Kakodkar Jan 23, 2025
cbc15f4
Updated dynamic and kinematic fault parameter definitions
Rohit-Kakodkar Jan 23, 2025
1ab66a2
Removed hardcoded input directories
Rohit-Kakodkar Jan 23, 2025
e829c12
Removed hard coded directory structure from meshfem3d and xgenerate d…
Rohit-Kakodkar Jan 23, 2025
4b68731
Separated mesher par file from the generate database par file
Rohit-Kakodkar Jan 23, 2025
4d70c12
Separeted the mesher and generate databases parameter files
Rohit-Kakodkar Jan 23, 2025
af878e2
Fixed compilation issue
Rohit-Kakodkar Jan 24, 2025
89a892a
Merge pull request #430 from PrincetonUniversity/issue-423
lsawade Feb 5, 2025
344a434
Merge pull request #431 from PrincetonUniversity/issue-424
lsawade Feb 5, 2025
4de9521
Merge branch 'devel' into issue-390
lsawade Feb 5, 2025
1f2807b
Moved read_mesh to read_2d_mesh, and moved IO/mesh/impl/fortran/ to I…
lsawade Feb 6, 2025
a351388
Ready to start implementing read functions
lsawade Feb 6, 2025
a4a1455
Updated namespace for the read functions as well
lsawade Feb 6, 2025
5190ada
Added runnable executable to example
lsawade Feb 6, 2025
4d8f16e
Added mesh_parameters.bin file
lsawade Feb 10, 2025
cf302cf
Merge pull request #456 from PrincetonUniversity/issue-455
lsawade Feb 10, 2025
524a1c2
Merge pull request #460 from PrincetonUniversity/issue-457
lsawade Feb 10, 2025
685a001
Added structs and first reader to read meshparameters
lsawade Feb 10, 2025
fc4687e
Added a first working preset
lsawade Feb 10, 2025
7b1b643
Merge branch 'devel' into issue-461
lsawade Feb 10, 2025
9d632f4
This is a larger commit fixing test_data location and output director…
lsawade Feb 10, 2025
b3f5f31
Updated meshfem2d header files to be configuration files and made spe…
lsawade Feb 11, 2025
d792aab
Updated CMakeLists.txt to add binary/include directories for location…
lsawade Feb 11, 2025
eb4ccbd
version.fh.in had no content. Fixed
lsawade Feb 12, 2025
261409f
Updated location of ENABLE_SIMD
lsawade Feb 12, 2025
d35c788
Updated the meshfem2D CMakeLists.txt. Configuration files (constants.…
lsawade Feb 12, 2025
b139965
Added the double precision option to meshfem2d and 3d makelists.txt
lsawade Feb 12, 2025
f3e1bd2
fortran/meshfem2d now fully compilable without specfempp cmakelists.txt
lsawade Feb 12, 2025
c085006
Finally fixed the the Cmakelists.txt for everything to build correctl…
lsawade Feb 12, 2025
f70b8f0
Fixed captilization
lsawade Feb 12, 2025
ef4828c
Tests are passing with the fixed reading of the specfem2d mesh
lsawade Feb 13, 2025
019c601
Printing the output of the cmake subprojects only of build type is debug
lsawade Feb 13, 2025
e740972
Merge pull request #462 from PrincetonUniversity/issue-461
lsawade Feb 14, 2025
3a02a2b
Merge pull request #464 from PrincetonUniversity/issue-398
lsawade Feb 14, 2025
426e6f0
Merge pull request #467 from PrincetonUniversity/issue-463
lsawade Feb 14, 2025
af4b522
Updated array reading into a templated utilities header
lsawade Feb 14, 2025
3db8bb4
Forgot adding files that I added for convenience
lsawade Feb 14, 2025
b1530e7
Removed some comments.
lsawade Feb 14, 2025
a6f18b5
Merge branch 'devel' into issue-472
lsawade Feb 14, 2025
772928a
Forgot to remove, removed file from the cmakelists
lsawade Feb 14, 2025
70f9a7c
Fixed fortran/C interface name mangling for meshfem2D/3D so that it w…
lsawade Feb 17, 2025
9053b32
Created the configuration files for the 3D example so that it is setu…
lsawade Feb 17, 2025
f6190c7
Miniupdate to run the example
lsawade Feb 17, 2025
cae5636
Merge pull request #475 from PrincetonUniversity/issue-472
lsawade Feb 17, 2025
2e6cb1a
Added presets for release/debug-cuda
lsawade Feb 17, 2025
a1cd603
Added target_link_libraries
lsawade Feb 17, 2025
0e854a4
Merge pull request #483 from PrincetonUniversity/issue-482
lsawade Feb 17, 2025
f5d06e5
Refactor of mesh struct to split it in dim2 and dim3
lsawade Feb 18, 2025
9f269ef
Made mesh/materials templated with dimension
lsawade Feb 18, 2025
d22804b
Working boolean array reading
lsawade Feb 20, 2025
cee4707
Wokring reading of the mass matrix and the materials
lsawade Feb 20, 2025
0135d72
Merge pull request #486 from PrincetonUniversity/issue-485
lsawade Feb 20, 2025
dafe52c
Implemented absorbing boundary read
lsawade Feb 20, 2025
6a6ede0
Forgot to add the absorbing boundary header
lsawade Feb 21, 2025
e1e98bc
Refactor of the reading function using wrappers for the try catch blocks
lsawade Feb 21, 2025
fee63b1
Added Free surface
lsawade Feb 21, 2025
80fd23b
Implemented holder for coupled interfaces and reading thereof
lsawade Feb 21, 2025
d9634f3
Updated the last unexpected output for the release version
lsawade Feb 21, 2025
2ef4f67
Added boundaries file
lsawade Feb 21, 2025
8ef9441
Merge branch 'issue-502' into issue-504
lsawade Feb 21, 2025
2cebd4e
Merge branch 'devel' into issue-484
lsawade Feb 24, 2025
e9dc24f
Merge branch 'devel' into issue-502
lsawade Feb 24, 2025
67f5a51
Merge branch 'devel' into issue-504
lsawade Feb 24, 2025
f91ecba
Updated the template for read_array
lsawade Feb 24, 2025
4e18926
Made read_index_array templated by viewtype
lsawade Feb 24, 2025
81e3b19
Updated Documentation for the some of the structs and in particular t…
lsawade Feb 24, 2025
0e88671
Slightly updated how the build folder structure to not have a clutter…
lsawade Feb 24, 2025
fdcf7ad
Added some more documentation for the 2D mesh
lsawade Feb 24, 2025
454baca
Forgot to add some files whoopsie...
lsawade Feb 24, 2025
2210d38
Fixed the parameter_documentation file, there was no rhyme or reason …
lsawade Feb 24, 2025
c004e2d
Fixed some docs
lsawade Feb 24, 2025
e539946
Made parameter documentation nested
lsawade Feb 25, 2025
4cbf45d
Edited the parameter label so that it aligns with standard sphinx par…
lsawade Feb 25, 2025
8b3f023
Forgot to add sphinx_design to the the docs/requirements
lsawade Feb 25, 2025
03e1fd1
Finally happy with the simulation setup.
lsawade Feb 25, 2025
3d3d39c
Updated coupled interfaces documentation
lsawade Feb 25, 2025
0abb953
Collapsible parameter documentation is working now adding the remaini…
lsawade Feb 25, 2025
b2f3b8b
Final version of the parameter file is done
lsawade Feb 25, 2025
951328b
Removed remnants of the previous parameter description
lsawade Feb 25, 2025
5bf5919
Added documentation for parameters, partial derivatives, mass_matrix,…
lsawade Feb 25, 2025
b4a53fc
Fixed adjusted templating
lsawade Feb 25, 2025
3af4632
Update the parallel_reduces to use the specfem host abastractions
lsawade Feb 25, 2025
4d285f4
Merge pull request #501 from PrincetonUniversity/issue-484
lsawade Feb 25, 2025
bdbb756
Merge pull request #503 from PrincetonUniversity/issue-502
lsawade Feb 25, 2025
71665b9
Merge pull request #505 from PrincetonUniversity/issue-504
lsawade Feb 25, 2025
ad4bcb6
Updated fortran save_databases to write integer arrays and element_ty…
lsawade Feb 26, 2025
5ef01db
Implemented the printing for both mapping and coordinates
lsawade Feb 26, 2025
3ba3e47
Updated printing
lsawade Feb 26, 2025
afd53c0
Fixed and updated mesh print
lsawade Feb 26, 2025
95c8c35
Merge branch 'devel' into issue-506
lsawade Feb 26, 2025
7828193
Added the mpi information struct (not used currently)
lsawade Feb 27, 2025
2bd7c8d
All structs are populated
lsawade Feb 27, 2025
1be396a
Fixed up documentation as well.
lsawade Feb 27, 2025
0ad40f2
Added forgotten files (as per usual)
lsawade Feb 27, 2025
bb75b0f
fixed the array reading in specfem
lsawade Feb 27, 2025
776cabb
Merge pull request #510 from PrincetonUniversity/issue-506
lsawade Mar 3, 2025
752ee0a
Merge pull request #519 from PrincetonUniversity/issue-508
lsawade Mar 3, 2025
b943668
Merge pull request #532 from PrincetonUniversity/issue-529
lsawade Mar 3, 2025
83b1a5e
Merge branch 'devel' into issue-390
icui Mar 6, 2025
816265a
Fixed Apple clang SIMD compilation
Rohit-Kakodkar Mar 6, 2025
42997e2
Merge branch 'issue-562' into issue-390-1
Rohit-Kakodkar Mar 6, 2025
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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,6 @@ examples/*/Par_File
autotuning/
profiles
.cache/
test*.cpp
test*.hpp
include/specfem_setup.hpp
178 changes: 131 additions & 47 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 All @@ -26,12 +28,12 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set(FETCHCONTENT_QUIET TRUE)

if (SPECFEMPP_BINDING_PYTHON)
message("-- Adding -fPIC flag for Python binding.")
message(STATUS "Adding -fPIC flag for Python binding.")
if(CMAKE_CXX_COMPILER_ID STREQUAL "IntelLLVM")
set(CMAKE_CXX_FLAGS "-fp-model=precise -fPIC")
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
message("-- Detected Intel classic compiler which will be deprecated soon.")
message("-- It is recommended you use IntelLLVM compiler.")
message(STATUS "Detected Intel classic compiler which will be deprecated soon.")
message(STATUS "It is recommended you use IntelLLVM compiler.")
set(CMAKE_CXX_FLAGS "-diag-disable=10441 -fp-model=precise -fPIC")
else()
set(CMAKE_CXX_FLAGS "-fPIC")
Expand All @@ -40,24 +42,24 @@ else (SPECFEMPP_BINDING_PYTHON)
if(CMAKE_CXX_COMPILER_ID STREQUAL "IntelLLVM")
set(CMAKE_CXX_FLAGS "-fp-model=precise")
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
message("-- Detected Intel classic compiler which will be deprecated soon.")
message("-- It is recommended you use IntelLLVM compiler.")
message(STATUS "Detected Intel classic compiler which will be deprecated soon.")
message(STATUS "It is recommended you use IntelLLVM compiler.")
set(CMAKE_CXX_FLAGS "-diag-disable=10441 -fp-model=precise")
endif()
endif (SPECFEMPP_BINDING_PYTHON)

# Check if MacOS
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(__APPLE__ TRUE)
message("-- macOS detected -- setting __APPLE__ TRUE")
message(STATUS "macOS detected -- setting __APPLE__ TRUE")
else(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(__APPLE__ FALSE)
message("-- macOS not detected -- setting __APPLE__ FALSE")
message(STATUS "macOS not detected -- setting __APPLE__ FALSE")
endif()

if (DEFINED Kokkos_ENABLE_CUDA)
if (Kokkos_ENABLE_CUDA)
# message("Setting CUDA variables")
# message(STATUS "Setting CUDA variables")
set(Kokkos_ENABLE_CUDA_LAMBDA ON CACHE BOOL "Using CUDA Lambda by default")
set(Kokkos_ENABLE_CUDA_RELOCATABLE_DEVICE_CODE ON CACHE BOOL "Using CUDA Relocatable device by default")
endif()
Expand Down Expand Up @@ -97,7 +99,7 @@ find_package(VTK COMPONENTS


if (NOT VTK_FOUND)
message("VTK not found: ${VTK_NOT_FOUND_MESSAGE}")
message(STATUS "VTK not found: ${VTK_NOT_FOUND_MESSAGE}")
set(VTK_CXX_BUILD OFF)
else ()
message(STATUS " VTK: ${VTK_LIBRARIES}")
Expand Down Expand Up @@ -148,34 +150,68 @@ endif()
find_package(HDF5 COMPONENTS CXX)

if (NOT ${HDF5_FOUND})
message("-- HDF5 not found. Building without HDF5.")
message(STATUS "HDF5 not found. Building without HDF5.")
set(HDF5_CXX_BUILD OFF)
else()
message("HDF5 libs/ and incs/:.")
message(STATUS "HDF5 libs/ and incs/:.")
message(STATUS " LIB: ${HDF5_LIBRARIES}")
message(STATUS " INC: ${HDF5_INCLUDE_DIRS}")
message(STATUS " LIBSO: ${HDF5_CXX_LIBRARIES}")
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")
message(STATUS "Enabling SIMD")
add_definitions(-DENABLE_SIMD)
endif()

if (ENABLE_PROFILING)
message("-- Enabling profiling")
message(STATUS "Enabling profiling")
add_definitions(-DENABLE_PROFILING)
endif()

if (ENABLE_DOUBLE_PRECISION)
message(STATUS "Enabling double precision")
set(TYPE_REAL "double")
else(ENABLE_DOUBLE_PRECISION)
message(STATUS "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)

# Set loglevel to STATUS if build type is debug
if (CMAKE_BUILD_TYPE MATCHES Release)
set(SUBDIR_LOG_LEVEL NOTICE)
else()
set(SUBDIR_LOG_LEVEL STATUS)
endif()

# ========== MESHFEM2D ==============
message(STATUS "Building meshfem2D")
set(_saved_CMAKE_MESSAGE_LOG_LEVEL ${CMAKE_MESSAGE_LOG_LEVEL})
set(CMAKE_MESSAGE_LOG_LEVEL ${SUBDIR_LOG_LEVEL})
add_subdirectory(fortran/meshfem2d)
set(CMAKE_MESSAGE_LOG_LEVEL ${_saved_CMAKE_MESSAGE_LOG_LEVEL})
# =================================

# ========== MESHFEM3D ==============
message(STATUS "Building xmeshfem3D & xgenerate_databases")
set(_saved_CMAKE_MESSAGE_LOG_LEVEL ${CMAKE_MESSAGE_LOG_LEVEL})
set(CMAKE_MESSAGE_LOG_LEVEL ${SUBDIR_LOG_LEVEL})
add_subdirectory(fortran/meshfem3d)
set(CMAKE_MESSAGE_LOG_LEVEL ${_saved_CMAKE_MESSAGE_LOG_LEVEL})
# =================================


# Build specfem2d libraries
add_library(
quadrature
Expand All @@ -196,13 +232,20 @@ add_library(
src/IO/fortranio/fortran_io.cpp
src/IO/sources.cpp
src/IO/receivers.cpp
src/IO/mesh.cpp
src/IO/mesh/impl/fortran/read_boundaries.cpp
src/IO/mesh/impl/fortran/read_elements.cpp
src/IO/mesh/impl/fortran/read_material_properties.cpp
src/IO/mesh/impl/fortran/read_mesh_database.cpp
src/IO/mesh/impl/fortran/read_interfaces.cpp
src/IO/mesh/impl/fortran/read_parameters.cpp
# Fortran 2D part
src/IO/mesh/impl/fortran/dim2/mesh.cpp
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/mesh.cpp
src/IO/mesh/impl/fortran/dim3/read_parameters.cpp
src/IO/mesh/impl/fortran/dim3/read_coordinates.cpp
src/IO/mesh/impl/fortran/dim3/read_partial_derivatives.cpp
src/IO/mesh/impl/fortran/dim3/utilities.cpp
)

if (NOT HDF5_CXX_BUILD)
Expand Down Expand Up @@ -275,9 +318,9 @@ if (MPI_PARALLEL)
specfem_mpi
PUBLIC -DMPI_PARALLEL
)
message("-- Compiling SPECFEM with MPI")
message(STATUS "Compiling SPECFEM with MPI")
else()
message("-- Compiling SPECFEM without MPI")
message(STATUS "Compiling SPECFEM without MPI")
endif(MPI_PARALLEL)

# add_library(
Expand All @@ -294,21 +337,36 @@ endif(MPI_PARALLEL)

add_library(
mesh
src/mesh/boundaries/forcing_boundaries.cpp
src/mesh/boundaries/absorbing_boundaries.cpp
src/mesh/boundaries/acoustic_free_surface.cpp
src/mesh/elements/tangential_elements.cpp
src/mesh/elements/axial_elements.cpp
# 2-D
src/mesh/dim2/mesh.cpp
src/mesh/dim2/boundaries/forcing_boundaries.cpp
src/mesh/dim2/boundaries/absorbing_boundaries.cpp
src/mesh/dim2/boundaries/acoustic_free_surface.cpp
src/mesh/dim2/elements/tangential_elements.cpp
src/mesh/dim2/elements/axial_elements.cpp
# src/mesh/mpi_interfaces/mpi_interfaces.cpp
src/mesh/materials/materials.cpp
src/mesh/coupled_interfaces/interface_container.cpp
src/mesh/coupled_interfaces/coupled_interfaces.cpp
src/mesh/tags/tags.cpp
src/mesh/mesh.cpp
src/mesh/dim2/materials/materials.cpp
src/mesh/dim2/coupled_interfaces/interface_container.cpp
src/mesh/dim2/coupled_interfaces/coupled_interfaces.cpp
src/mesh/dim2/tags/tags.cpp
# 3-D
src/mesh/dim3/mesh.cpp
src/mesh/dim3/boundaries/absorbing_boundary.cpp
src/mesh/dim3/boundaries/free_surface.cpp
src/mesh/dim3/coupled_interfaces/coupled_interfaces.cpp
src/mesh/dim3/element_types/element_types.cpp
src/mesh/dim3/parameters/parameters.cpp
src/mesh/dim3/parameters/parameters.cpp
src/mesh/dim3/mapping/mapping.cpp
src/mesh/dim3/materials/materials.cpp
src/mesh/dim3/coordinates/coordinates.cpp
src/mesh/dim3/partial_derivatives/partial_derivatives.cpp

)

target_link_libraries(
mesh
enumerations
Kokkos::kokkos
specfem_mpi
# material_class
Expand Down Expand Up @@ -631,21 +689,47 @@ add_executable(
src/specfem2d.cpp
)



target_link_libraries(
specfem2d
execute
)

add_executable(
specfem3d
src/specfem3d.cpp
)

target_link_libraries(
specfem3d
specfem_mpi
IO
Kokkos::kokkos
mesh
quadrature
compute
source_class
parameter_reader
receiver_class
writer
periodic_tasks
reader
medium
coupled_interface
kokkos_kernels
solver
${BOOST_LIBS}
yaml-cpp
)


# Include tests
if (BUILD_TESTS)
message("-- Including tests.")
message(STATUS "Including tests.")
add_subdirectory(tests/unit-tests)
endif()

if (BUILD_EXAMPLES)
message("-- Including examples.")
message(STATUS "Including examples.")
add_subdirectory(examples)
endif()

Expand All @@ -661,7 +745,7 @@ if (DOXYGEN_FOUND)

# request to configure the file
configure_file(${DOXYGEN_IN} ${DOXYGEN_OUT} @ONLY)
message("Doxygen build started")
message(STATUS "Doxygen build started")

# Note: do not put "ALL" - this builds docs together with application EVERY TIME!
add_custom_target( docs
Expand All @@ -670,7 +754,7 @@ if (DOXYGEN_FOUND)
COMMENT "Generating API documentation with Doxygen"
VERBATIM )
else (DOXYGEN_FOUND)
message("Doxygen need to be installed to generate the doxygen documentation")
message(STATUS "Doxygen need to be installed to generate the doxygen documentation")
endif (DOXYGEN_FOUND)

if (SPECFEMPP_USE_SKBUILD AND EXISTS ${SKBUILD_SCRIPTS_DIR})
Expand Down
Loading