Skip to content
Draft
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
20 changes: 14 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,19 @@ jobs:
- x64
julia_version:
- '1.10'
- '1.11'
- '^1.13.0-rc1'
t8code_version:
- '3.0.1'
include:
- os: ubuntu-latest
test_type: coverage
arch: x64
julia_version: '1.11'
julia_version: '^1.13.0-rc1'
t8code_version: '3.0.1'
env:
# Necessary for HDF5 to play nice with Julia
LD_PRELOAD: /lib/x86_64-linux-gnu/libcurl.so.4
# Necessary for HDF5 to play nice with Julia 1.10
# https://docs.github.com/en/actions/reference/workflows-and-actions/expressions#example
LD_PRELOAD: ${{ matrix.julia_version == '1.10' && '/lib/x86_64-linux-gnu/libcurl.so.4' || '' }}
# Necessary such that libtrixi will not use its own default for the depot path
JULIA_DEPOT_PATH: ~/.julia
steps:
Expand Down Expand Up @@ -115,22 +116,27 @@ jobs:
- name: Configure (test_type == 'regular')
if: ${{ matrix.test_type == 'regular' }}
run: |
# remove once https://github.com/JuliaLang/julia/pull/57681 is in the release
C_FLAGS=${{ matrix.julia_version == '1.12' && '-Wno-error=unused-parameter' || '' }}
mkdir build
cd build
cmake .. -DCMAKE_INSTALL_PREFIX=../install \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_FLAGS="${C_FLAGS}" \
-DT8CODE_ROOT=$PWD/../t8code-local/prefix \
-DENABLE_TESTING=ON -DJULIA_PROJECT_PATH=../libtrixi-julia

- name: Configure (test_type == 'coverage')
if: ${{ matrix.test_type == 'coverage' }}
run: |
# remove once https://github.com/JuliaLang/julia/pull/57681 is in the release
C_FLAGS=${{ matrix.julia_version == '1.12' && '-Wno-error=unused-parameter' || '' }}
mkdir build
cd build
cmake .. -DCMAKE_INSTALL_PREFIX=../install \
-DCMAKE_BUILD_TYPE=Debug \
-DT8CODE_ROOT=$PWD/../t8code-local/prefix \
-DCMAKE_C_FLAGS="-cpp --coverage -O0" \
-DCMAKE_C_FLAGS="-cpp --coverage -O0 ${C_FLAGS}" \
-DCMAKE_Fortran_FLAGS="-cpp --coverage -O0" \
-DCMAKE_EXE_LINKER_FLAGS="--coverage" \
-DCMAKE_SHARED_LINKER_FLAGS="--coverage" \
Expand Down Expand Up @@ -205,7 +211,7 @@ jobs:
if: ${{ matrix.test_type == 'package-compiler' }}
run: |
cd build
make -j2
make
du -hL ./prefix-pc/lib/libtrixi.so

- name: Test external CMake project
Expand Down Expand Up @@ -313,6 +319,8 @@ jobs:
cd build/test/c
ctest -V
env:
# This seems to fix stalling tests with Julia 1.12
JULIA_NUM_THREADS: 1
LIBTRIXI_DEBUG: all
GTEST_COLOR: 'yes'

Expand Down
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ if( USE_PACKAGE_COMPILER )
COMMENT "Building ${PROJECT_NAME} with PackageCompiler.jl..."
COMMAND ${JULIA_EXECUTABLE}
--project=${CMAKE_SOURCE_DIR}/LibTrixi.jl/lib
--threads=1
${CMAKE_SOURCE_DIR}/LibTrixi.jl/lib/build.jl
${JULIA_PROJECT_PATH}
${CMAKE_BINARY_DIR}/prefix-pc
Expand Down
3 changes: 1 addition & 2 deletions LibTrixi.jl/src/api_jl.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ function trixi_initialize_simulation_jl(filename)

# Initialize simulation state
# Note: we need `invokelatest` here since the function is dynamically upon `include`
# Note: `invokelatest` is not exported until Julia v1.9, thus we call it through `Base`
simstate = Base.invokelatest(Main.init_simstate)
simstate = @invokelatest Main.init_simstate()

if show_debug_output()
println("Simulation state initialized")
Expand Down
4 changes: 2 additions & 2 deletions examples/trixi_controller_baroclinic.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ void source_terms_baroclinic(int nnodes, double * nodes, t8_forest_t forest,
// Iterates through all local trees
for (t8_locidx_t itree = 0, index = 0; itree < num_local_trees; ++itree) {
// Get number of elements of this tree
t8_locidx_t num_elements_in_tree = t8_forest_get_tree_num_elements (forest, itree);
t8_locidx_t num_elements_in_tree = t8_forest_get_tree_num_leaf_elements (forest, itree);
// Iterate through all the local elements
for (t8_locidx_t ielement = 0; ielement < num_elements_in_tree; ++ielement) {
// Get a pointer to the current element
const t8_element_t *element = t8_forest_get_element_in_tree (forest, itree, ielement);
const t8_element_t *element = t8_forest_get_leaf_element_in_tree (forest, itree, ielement);
for (int k = 0; k < nnodes; ++k) {
for (int j = 0; j < nnodes; ++j) {
for (int i = 0; i < nnodes; ++i, ++index) {
Expand Down
4 changes: 2 additions & 2 deletions examples/trixi_controller_t8code.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ void t8_print_forest_information (t8_forest_t forest)
T8_ASSERT (t8_forest_is_committed (forest));

// Get the local number of elements.
local_num_elements = t8_forest_get_local_num_elements (forest);
local_num_elements = t8_forest_get_local_num_leaf_elements (forest);

// Get the global number of elements.
global_num_elements = t8_forest_get_global_num_elements (forest);
global_num_elements = t8_forest_get_global_num_leaf_elements (forest);

printf ("\n*** T8code *** Local number of elements:\t%i\n", local_num_elements);
printf ("*** T8code *** Global number of elements:\t%li\n", global_num_elements);
Expand Down
2 changes: 1 addition & 1 deletion examples/trixi_controller_t8code.f90
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ subroutine t8_print_forest_information(forest)
! T8_ASSERT (t8_forest_is_committed (forest));

! Get the local number of elements.
local_num_elements = t8_forest_get_local_num_elements (forest)
local_num_elements = t8_forest_get_local_num_leaf_elements (forest)

! Get the global number of elements.
global_num_elements = t8_forest_get_global_num_elements (forest)
Expand Down
Loading