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
8 changes: 5 additions & 3 deletions scripts/run_semproxy_benchmark.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set -euo pipefail
EXS="100"
EYS="100"
EZS="100"
IMPLEMS="classic optim geos shiva"
IMPLEMS="geos shiva"
MESHES="cartesian ucartesian"
ORDERS="1 2 3"
SEMPROXY_BIN="bin/semproxy"
Expand All @@ -20,7 +20,7 @@ Options (space-separated lists allowed; quoted):
--ex "100" # values for --ex
--ey "100" # values for --ey
--ez "100" # values for --ez
--implem "classic" # {classic, optim, geos, shiva}
--implem "geos" # {classic, optim, geos, shiva}
--mesh "cartesian" # {cartesian, ucartesian}
-o|--order "1 2 3" # polynomial orders
--bin PATH # path to semproxy (default: bin/semproxy)
Expand Down Expand Up @@ -77,7 +77,9 @@ for order in $ORDERS; do
--ex "$ex" --ey "$ey" --ez "$ez"
--implem "$implem"
--mesh "$mesh"
-o "$order" )
-o "$order"
--timemax "1.5"
--dt "0.001" )
echo ">> ${cmd[*]}"

if [[ "$DRY_RUN" -eq 1 ]]; then
Expand Down
30 changes: 29 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,32 @@ add_subdirectory(main)

if(ENABLE_PYWRAP)
install_pyproxys_package(model solver)
endif()
endif()


# Collect all sources
file(GLOB_RECURSE ALL_SOURCE_FILES
"${CMAKE_SOURCE_DIR}/src/*.cpp"
"${CMAKE_SOURCE_DIR}/src/*.hpp"
"${CMAKE_SOURCE_DIR}/src/*.cxx"
"${CMAKE_SOURCE_DIR}/src/*.hxx"
"${CMAKE_SOURCE_DIR}/src/*.cc"
"${CMAKE_SOURCE_DIR}/src/*.c"
"${CMAKE_SOURCE_DIR}/src/*.h"
"${CMAKE_SOURCE_DIR}/src/*.hh")

# Example: filter out files whose path contains "Shiva" or "SEMKernels"
list(FILTER ALL_SOURCE_FILES EXCLUDE REGEX "Shiva")
list(FILTER ALL_SOURCE_FILES EXCLUDE REGEX "SEMKernels")

# Make the format target
if( NOT CLANG_FORMAT_EXECUTABLE )
set( CLANG_FORMAT_EXECUTABLE clang-format )
endif()

message( STATUS "Using clang-format executable: ${CLANG_FORMAT_EXECUTABLE}" )

add_custom_target( apply_clang_format
COMMAND ${CLANG_FORMAT_EXECUTABLE} -i -style=file -fallback-style=none ${ALL_SOURCE_FILES}
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
)
10 changes: 2 additions & 8 deletions src/discretization/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,14 @@ target_include_directories(discretization
INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/fe/SEMKernels/src/>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/fe/SEMKernels/src/finiteElement/>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/fe/SEMKernels/src/Shiva/src/>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/fe>
# $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/fd>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
${CMAKE_BINARY_DIR}/include
)
message(STATUS "Binary include dir: ${CMAKE_BINARY_DIR}/include")

include( fe/SEMKernels/src/Shiva/tpl/camp/extern/blt/SetupBLT.cmake )
add_subdirectory( fe/SEMKernels )

add_dependencies( discretization finiteElements shiva)

target_link_libraries(discretization
INTERFACE
proxy_utils
)
target_link_libraries( discretization INTERFACE proxy_utils )
target_link_libraries( discretization INTERFACE Shiva::shiva )
2 changes: 1 addition & 1 deletion src/discretization/fe/SEMKernels
2 changes: 2 additions & 0 deletions src/main/fe/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
if(COMPILE_SEM)

set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)

add_executable(semproxy
src/main.cc
src/sem_proxy.cc
Expand Down
2 changes: 2 additions & 0 deletions src/model/api/include/builder.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ class ModelBuilderBase
ModelBuilderBase() = default;
~ModelBuilderBase() = default;

static constexpr int MAX_ORDER = 5;

virtual std::shared_ptr<model::ModelApi<FloatType, ScalarType>> getModel()
const = 0;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ template <typename FloatType, typename ScalarType>
class CartesianUnstructBuilder : ModelBuilderBase<FloatType, ScalarType>
{
public:
using ModelBuilderBase<FloatType, ScalarType>::MAX_ORDER;

CartesianUnstructBuilder() {}

CartesianUnstructBuilder(const CartesianParams<FloatType, ScalarType>& p)
Expand Down Expand Up @@ -115,7 +117,7 @@ class CartesianUnstructBuilder : ModelBuilderBase<FloatType, ScalarType>

void getCoordInOneDirection(const int& h, const int& n_element, float* coord)
{
float xi[order_ + 1];
float xi[MAX_ORDER + 1];

switch (order_)
{
Expand Down Expand Up @@ -188,9 +190,9 @@ class CartesianUnstructBuilder : ModelBuilderBase<FloatType, ScalarType>
nodes_coords_z_ =
allocateVector<VECTOR_REAL_VIEW>(total_nodes, "nodes coords z");

float coord_x[order_ + 1];
float coord_y[order_ + 1];
float coord_z[order_ + 1];
float coord_x[MAX_ORDER + 1];
float coord_y[MAX_ORDER + 1];
float coord_z[MAX_ORDER + 1];

auto hx = lx_ / ex_;
auto hy = ly_ / ey_;
Expand Down
2 changes: 1 addition & 1 deletion src/solver/impl/include/sem_solver.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class SEMsolver : public SolverBase
virtual void computeFEInit(model::ModelApi<float, int> &mesh,
const float sponge_size[3],
const bool surface_sponge,
const float taper_delta_);
const float taper_delta_) override final;
/**
* @brief Compute one time step of the SEM wave equation solver.
*
Expand Down
Loading