Skip to content

Commit

Permalink
Rust analyzer and stack fixes (#66)
Browse files Browse the repository at this point in the history
* test on quad with more basis functions

* Fixed rust analyzer issue and increase CI test stack size

---------

Co-authored-by: Matthew Scroggs <[email protected]>
  • Loading branch information
tbetcke and mscroggs authored Dec 4, 2024
1 parent 560eaa3 commit c668de9
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
14 changes: 6 additions & 8 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
4 changes: 3 additions & 1 deletion src/bindings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,9 @@ pub mod ciarlet {
data: *mut c_void,
) {
let tdim = reference_cell::dim(element.cell_type());
let points = points as *mut <E::T as RlstScalar>::Real;
// The following transmute is only necessary because Rust-Analyzer bugs out
// for the statement `let points = points as *mut <E::T as RlstScalar>::Real;`
let points: *mut <E::T as RlstScalar>::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) },
Expand Down
1 change: 1 addition & 0 deletions src/ciarlet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

0 comments on commit c668de9

Please sign in to comment.