Skip to main content

Crate hybit

Crate hybit 

Source
Expand description

HyBIT — Autonomous Hybrid Sparse Solver.

HyBIT 0.6.0 provides a Rust facade for real SPD sparse systems using CSR32 input, PCG, adaptive selective local Cholesky correction, weighted overlapping Schwarz, geometry-aware rigid-body coarse correction for 3-D structural systems, and reusable analyze/prepare/solve-many contexts.

§Example

use hybit::{Csr32Matrix, HybitSolver};

let a = Csr32Matrix::new(
    3,
    3,
    vec![0, 2, 5, 7],
    vec![0, 1, 0, 1, 2, 1, 2],
    vec![2.0, -1.0, -1.0, 2.0, -1.0, -1.0, 2.0],
)?;
let b = vec![1.0, 0.0, 1.0];
let mut x = vec![0.0; 3];
let solver = HybitSolver::new();
let report = solver.solve_csr32(&a, &b, &mut x)?;
assert!(report.relative_residual < 1.0e-8);

The automatic path is currently experimental and restricted to real SPD systems with PCG. See the repository README for current limitations.

Structs§

AbtmConfig
AbtmMatrix
AbtmStats
BalancedRigidBodyTwoLevelBlockJacobiPreconditioner
Experimental symmetric balanced two-level structural preconditioner.
BlockJacobiPreconditioner
Csr32Matrix
DofMask
HybitAnalysis
HybitPreparedStructuralSystem
HybitPreparedSystem
HybitSolver
HybridOptions
HybridPreconditioner
IdentityPreconditioner
JacobiPreconditioner
KrylovOutcome
LocalCholeskyRegion
MatrixMarketInfo
MatrixProfile
ParallelCsr32Operator
Read-only parallel CSR operator wrapper. It shares the validated CSR storage and only changes the row execution policy used by apply.
ParallelRigidBodyTwoLevelPreconditioner
Experimental view that parallelizes only the embarrassingly parallel fine/coarse transfer and 3x3 block-Jacobi kernels. The dense coarse triangular solve remains serial. It borrows the already prepared rigid-body preconditioner, so no Cholesky factor is duplicated.
PcgWorkspace
Reusable PCG scratch storage. A prepared HyBIT context allocates this once and reuses it across every Krylov iteration and every subsequent RHS.
RigidBodyApplyProfile
RigidBodyTwoLevelBlockJacobiPreconditioner
SolveReport
SolverOptions
StructuralOptions
TileDesc
TwoLevelBlockJacobiPreconditioner

Enums§

BackendPolicy
HybitError
MatrixBackend
MatrixMarketError
MatrixMarketSymmetry
PreconditionerKind
RigidBodyAggregation
SolveStatus
SolverKind
StructuralPcgVectorPolicy
Execution policy for dense vector kernels inside structural PCG.
StructuralPreconditionerPolicy
Execution policy for the structural rigid-body two-level preconditioner.
StructuralSpmvPolicy
Execution policy for the fine-grid CSR SpMV used by structural PCG.
TileKind

Constants§

PARALLEL_PCG_VECTOR_CHUNK
Chunk size used by the experimental parallel PCG vector kernels.
STRUCTURAL_PARALLEL_PCG_VECTOR_MIN_N
Auto threshold for the parallel/fused PCG dense-vector path.
STRUCTURAL_PARALLEL_PCG_VECTOR_MIN_THREADS
r24 showed a 2-worker pool can be slower than serial vector kernels.
STRUCTURAL_PARALLEL_PRECONDITIONER_MIN_NNZ
Auto switches to the parallel structural preconditioner after this many nonzeros. The dense coarse triangular solve itself remains serial.
STRUCTURAL_PARALLEL_SPMV_MIN_NNZ
Auto switches to parallel CSR after this many nonzeros. Small matrices stay serial because Rayon scheduling overhead dominates there.
TILE_WIDTH

Traits§

LinearOperator
Preconditioner

Functions§

analyze_csr32
parallel_vector_worker_count
Number of workers in the shared Rayon pool used by parallel Krylov kernels.
pcg
pcg_with_workspace
pcg_with_workspace_parallel_vectors
Experimental PCG variant whose dense vector kernels use the shared Rayon pool. The sparse operator and preconditioner are unchanged.
read_matrix_market
read_matrix_market_from_reader
recommend_rigid_body_aggregate_nodes
Recommend a contiguous aggregate size for the six-mode rigid-body coarse space.
solve
write_matrix_market_general