Skip to content

Commit 635b1d2

Browse files
committed
Merge branch 'main' into feature/mpi-driver
2 parents 6b73dfc + 3af3dce commit 635b1d2

File tree

104 files changed

+3292
-1550
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

104 files changed

+3292
-1550
lines changed

.github/workflows/format-check.yaml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,8 @@ jobs:
1212
path: ['src', 'tests']
1313

1414
steps:
15-
- name: Checkout
16-
uses: actions/checkout@v4
17-
1815
- name: Run clang-format style check
19-
uses: jidicula/clang-format-action@v4.11.0
16+
uses: jidicula/clang-format-action@v4.16.0
2017
with:
2118
clang-format-version: '18'
2219
check-path: ${{ matrix.path }}

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,6 @@ The following options can be used to configure your build:
115115
| `COMPILE_SEM` | Enable compilation of the SEM proxy (default: ON) |
116116
| `ENABLE_CUDA` | Enable CUDA backend (used by Kokkos) |
117117
| `ENABLE_PYWRAP` | Enable Python bindings via pybind11 (experimental) |
118-
| `ENABLE_Shiva` | Enable Shiva discretization lib (default: OFF) |
119118
| `USE_KOKKOS` | Enable Kokkos support (serial by default, CUDA/OpenMP with flags) |
120119
| `USE_VECTOR` | Use `std::vector` for data arrays (enabled by default unless Kokkos is used)|
121120

cmake/ProxyConfig.cmake

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,6 @@ option(ENABLE_PYWRAP "Enable python binding compilation with pybind11" OFF)
1919
# Debugging options
2020
option(FD_SAVE_SNAPSHOTS "Save snapshots for FD-proxy" OFF)
2121
option(PRINT_ALLOC_INFO "Printout memory allocation info" OFF)
22-
option(ENABLE_Shiva "Enable shiva discretization" OFF)
23-
if (ENABLE_Shiva)
24-
add_compile_definitions(ENABLE_Shiva)
25-
endif()
2622
# Build options
2723
option(BUILD_SHARED_LIBS "Build shared libraries" ON)
2824

cmake/ProxyUtils.cmake

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ function(print_configuration_summary)
66
message(STATUS "")
77
message(STATUS "====== PROXY CONFIGURATION SUMMARY ======")
88
message(STATUS "")
9-
9+
1010
message(STATUS "Discretization Methods:")
1111
message(STATUS " COMPILE_SEM: ${COMPILE_SEM}")
1212
message(STATUS " COMPILE_FD: ${COMPILE_FD}")
1313
message(STATUS "")
14-
14+
1515
message(STATUS "Programming Models:")
1616
message(STATUS " USE_VECTOR: ${USE_VECTOR}")
1717
message(STATUS " USE_KOKKOS: ${USE_KOKKOS}")
@@ -22,13 +22,12 @@ function(print_configuration_summary)
2222
message(STATUS "Python Wrapping:")
2323
message(STATUS " ENABLE_PYWRAP: ${ENABLE_PYWRAP}")
2424
message(STATUS "")
25-
25+
2626
message(STATUS "Debugging Options:")
2727
message(STATUS " FD_SAVE_SNAPSHOTS: ${FD_SAVE_SNAPSHOTS}")
2828
message(STATUS " PRINT_ALLOC_INFO: ${PRINT_ALLOC_INFO}")
29-
message(STATUS " ENABLE_Shiva: ${ENABLE_Shiva}")
3029
message(STATUS "")
31-
30+
3231
message(STATUS "Build Options:")
3332
message(STATUS " CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
3433
message(STATUS " BUILD_SHARED_LIBS: ${BUILD_SHARED_LIBS}")

scripts/dev/fix_include_guards.py

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,8 @@ def fix_include_guards(filepath: Path, src_root: Path, project_name: str = "", d
139139

140140
if not ifndef_line:
141141
print(f"⚠️ No include guard found in {filepath}")
142-
return False
142+
print(f" Add incluide guards in {filepath}")
143+
return add_include_guards(filepath, src_root, project_name, dry_run)
143144

144145
# Extract current guard name
145146
current_guard = re.search(r'#\s*ifndef\s+([A-Za-z0-9_]+)', ifndef_line).group(1)
@@ -193,6 +194,37 @@ def fix_include_guards(filepath: Path, src_root: Path, project_name: str = "", d
193194
print(f"❌ Error writing {filepath}: {e}")
194195
return False
195196

197+
def add_include_guards(filepath: Path, src_root: Path, project_name: str = "", dry_run: bool = False) -> bool:
198+
"""
199+
Add include guards to a file that doesn't have them.
200+
201+
Returns:
202+
True if the file was modified, False otherwise
203+
"""
204+
try:
205+
with open(filepath, 'r', encoding='utf-8') as f:
206+
content = f.read()
207+
except Exception as e:
208+
print(f"❌ Error reading {filepath}: {e}")
209+
return False
210+
211+
guard_name = generate_guard_name(filepath, src_root, project_name)
212+
213+
print(f" {filepath.relative_to(src_root.parent)}:")
214+
print(f" Adding guard: {guard_name}")
215+
216+
if dry_run:
217+
return True
218+
219+
new_content = f"#ifndef {guard_name}\n#define {guard_name}\n\n{content.rstrip()}\n\n#endif // {guard_name}\n"
220+
221+
try:
222+
with open(filepath, 'w', encoding='utf-8') as f:
223+
f.write(new_content)
224+
return True
225+
except Exception as e:
226+
print(f"❌ Error writing {filepath}: {e}")
227+
return False
196228

197229
def main():
198230
import argparse
@@ -228,6 +260,8 @@ def main():
228260

229261
extensions = [f".{ext.strip()}" for ext in args.extensions.split(',')]
230262
exclude_dirs = args.exclude
263+
264+
exclude_dirs = [d.strip("/") for d in args.exclude]
231265

232266
print(f"🔍 Searching for header files in {src_root}")
233267
print(f" Extensions: {', '.join(extensions)}")

src/CMakeLists.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@ endforeach()
2323

2424
file(GLOB_RECURSE ALL_SOURCE_FILES ${GLOBS})
2525

26-
# Example: filter out files whose path contains "Shiva" or "SEMKernels"
27-
list(FILTER ALL_SOURCE_FILES EXCLUDE REGEX "Shiva")
26+
# Example: filter out files whose path contains "SEMKernels"
2827
list(FILTER ALL_SOURCE_FILES EXCLUDE REGEX "SEMKernels")
2928

3029
# Make the format target

src/discretization/CMakeLists.txt

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,13 @@ add_library(discretization INTERFACE)
33
target_include_directories( discretization INTERFACE
44
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/fe/SEMKernels/src/>
55
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/fe/SEMKernels/src/finiteElement/>
6-
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/fe/SEMKernels/src/Shiva/src/>
76
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/>
87
${CMAKE_BINARY_DIR}/include
9-
)
8+
)
109
message(STATUS "Binary include dir: ${CMAKE_BINARY_DIR}/include")
1110

1211
add_subdirectory( fe/SEMKernels )
1312

1413
target_link_libraries( discretization INTERFACE proxy_utils )
1514

16-
if (ENABLE_Shiva)
17-
target_link_libraries( discretization INTERFACE Shiva::shiva )
18-
endif()
19-
2015
add_subdirectory(fd)

src/discretization/fd/abckernels/include/fd_abckernels.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
#ifndef FDTD_PML_HPP
2-
#define FDTD_PML_HPP
3-
1+
#ifndef FUNTIDES_DISCRETIZATION_FD_ABCKERNELS_INCLUDE_FD_ABCKERNELS_H_
2+
#define FUNTIDES_DISCRETIZATION_FD_ABCKERNELS_INCLUDE_FD_ABCKERNELS_H_
43
#include "data_type.h"
54
#include "fd_macros.h"
65

@@ -233,4 +232,4 @@ struct FdtdAbcKernels
233232

234233
} // namespace abckernel
235234
} // namespace fdtd
236-
#endif // FDTD_PML_HPP
235+
#endif // FUNTIDES_DISCRETIZATION_FD_ABCKERNELS_INCLUDE_FD_ABCKERNELS_H_

src/discretization/fd/kernels/include/fd_kernels.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
#ifndef FDTD_KERNEL_H
2-
#define FDTD_KERNEL_H
3-
1+
#ifndef FUNTIDES_DISCRETIZATION_FD_KERNELS_INCLUDE_FD_KERNELS_H_
2+
#define FUNTIDES_DISCRETIZATION_FD_KERNELS_INCLUDE_FD_KERNELS_H_
43
#include "data_type.h"
54
#include "fd_abckernels.h"
65
#include "fd_macros.h"
@@ -163,4 +162,4 @@ struct FdtdKernels
163162

164163
} // namespace kernel
165164
} // namespace fdtd
166-
#endif // FDTD_KERNEL_H
165+
#endif // FUNTIDES_DISCRETIZATION_FD_KERNELS_INCLUDE_FD_KERNELS_H_

src/discretization/fd/kernels/include/fd_macros.h

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
#ifndef FDTD_MACROS_H
2-
#define FDTD_MACROS_H
3-
1+
#ifndef FUNTIDES_DISCRETIZATION_FD_KERNELS_INCLUDE_FD_MACROS_H_
2+
#define FUNTIDES_DISCRETIZATION_FD_KERNELS_INCLUDE_FD_MACROS_H_
43
#define POW2(x) ((x) * (x))
54
#define IDX3(i, j, k) (nz * ny * (i) + nz * (j) + (k))
65
#define IDX3_l(i, j, k) \
@@ -53,5 +52,4 @@
5352
#else
5453
#define FDFENCE
5554
#endif
56-
57-
#endif // FDTD_MACROS_H
55+
#endif // FUNTIDES_DISCRETIZATION_FD_KERNELS_INCLUDE_FD_MACROS_H_

0 commit comments

Comments
 (0)