From c668de96d85be65786e84bcf6c8a9b474f40b565 Mon Sep 17 00:00:00 2001 From: Timo Betcke Date: Wed, 4 Dec 2024 19:55:50 +0000 Subject: [PATCH] Rust analyzer and stack fixes (#66) * test on quad with more basis functions * Fixed rust analyzer issue and increase CI test stack size --------- Co-authored-by: Matthew Scroggs --- .github/workflows/run-tests.yml | 14 ++++++-------- src/bindings.rs | 4 +++- src/ciarlet.rs | 1 + 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index e9b5ec1..fa79929 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -14,7 +14,7 @@ jobs: strategy: matrix: rust-version: ["stable"] - mpi: ['mpich', 'openmpi'] + mpi: ["mpich", "openmpi"] feature-flags: ['--features "strict"', '--features "mpi,serde,strict"'] steps: - name: Set up Rust @@ -29,15 +29,14 @@ jobs: run: cargo install cargo-mpirun - uses: actions/checkout@v4 - name: Install LAPACK, OpenBLAS - run: - sudo apt-get install -y libopenblas-dev liblapack-dev + run: sudo apt-get install -y libopenblas-dev liblapack-dev - name: Run unit tests - run: cargo test ${{ matrix.feature-flags }} + run: RUST_MIN_STACK=8388608 cargo test ${{ matrix.feature-flags }} - name: Run unit tests in release mode - run: cargo test --release ${{ matrix.feature-flags }} + run: RUST_MIN_STACK=8388608 cargo test --release ${{ matrix.feature-flags }} - name: Run tests - run: cargo test --examples --release ${{ matrix.feature-flags }} + run: RUST_MIN_STACK=8388608 cargo test --examples --release ${{ matrix.feature-flags }} # - name: Test benchmarks build # run: cargo bench --no-run --features "mpi,strict" - name: Run examples @@ -92,5 +91,4 @@ jobs: run: cargo install cargo-upgrades - uses: actions/checkout@v4 - name: Check that dependencies are up to date - run: - cargo upgrades + run: cargo upgrades diff --git a/src/bindings.rs b/src/bindings.rs index e031517..bb6301b 100644 --- a/src/bindings.rs +++ b/src/bindings.rs @@ -402,7 +402,9 @@ pub mod ciarlet { data: *mut c_void, ) { let tdim = reference_cell::dim(element.cell_type()); - let points = points as *mut ::Real; + // The following transmute is only necessary because Rust-Analyzer bugs out + // for the statement `let points = points as *mut ::Real;` + let points: *mut ::Real = unsafe { std::mem::transmute(points) }; let data = data as *mut E::T; let points = rlst_array_from_slice2!( unsafe { from_raw_parts(points, npoints * tdim) }, diff --git a/src/ciarlet.rs b/src/ciarlet.rs index 5fe82a2..e317d8e 100644 --- a/src/ciarlet.rs +++ b/src/ciarlet.rs @@ -1275,4 +1275,5 @@ mod test { test_entity_closure_dofs_lagrange!(Tetrahedron, 5); test_entity_closure_dofs_lagrange!(Hexahedron, 2); test_entity_closure_dofs_lagrange!(Hexahedron, 3); + test_entity_closure_dofs_lagrange!(Hexahedron, 4); }