diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 96694d49..27cb70b0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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: @@ -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" \ @@ -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 @@ -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' diff --git a/CMakeLists.txt b/CMakeLists.txt index 5376e94d..845a16e0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 diff --git a/LibTrixi.jl/src/api_jl.jl b/LibTrixi.jl/src/api_jl.jl index 637ab34c..1c9c5d99 100644 --- a/LibTrixi.jl/src/api_jl.jl +++ b/LibTrixi.jl/src/api_jl.jl @@ -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") diff --git a/examples/trixi_controller_baroclinic.c b/examples/trixi_controller_baroclinic.c index 22cdefe3..1e12fe5b 100644 --- a/examples/trixi_controller_baroclinic.c +++ b/examples/trixi_controller_baroclinic.c @@ -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) { diff --git a/examples/trixi_controller_t8code.c b/examples/trixi_controller_t8code.c index cebaaf30..84d0c5d8 100644 --- a/examples/trixi_controller_t8code.c +++ b/examples/trixi_controller_t8code.c @@ -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); diff --git a/examples/trixi_controller_t8code.f90 b/examples/trixi_controller_t8code.f90 index ed769030..54858244 100644 --- a/examples/trixi_controller_t8code.f90 +++ b/examples/trixi_controller_t8code.f90 @@ -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)