Skip to content

Commit ee6f56f

Browse files
Sébastien LoiselSébastien Loisel
authored andcommitted
Simplify factorization documentation
1 parent d628eeb commit ee6f56f

4 files changed

Lines changed: 1 addition & 33 deletions

File tree

CLAUDE.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -91,17 +91,11 @@ Factorization uses MUMPS (MUltifrontal Massively Parallel Solver) with distribut
9191
- Created by `lu(A)` for general matrices or `ldlt(A)` for symmetric matrices
9292
- Stores COO arrays (irn_loc, jcn_loc, a_loc) to prevent GC while MUMPS holds pointers
9393

94-
**Automatic cleanup:** Factorization objects are automatically cleaned up when garbage collected.
95-
The cleanup is synchronized across MPI ranks when the next factorization is created. Example:
96-
9794
```julia
9895
F = lu(A)
9996
x = F \ b
100-
# F is automatically cleaned up when GC'd and next factorization is created
10197
```
10298

103-
Manual `finalize!(F)` is still available for explicit control (must be called on all ranks together).
104-
10599
### Local Constructors
106100

107101
For efficient construction when data is already distributed:

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ A_sym = A + transpose(A) + 10I # Make symmetric positive definite
6363
A_sym_dist = SparseMatrixMPI{Float64}(A_sym)
6464
F = ldlt(A_sym_dist) # LDLT factorization
6565
x_sol = solve(F, y) # Solve A_sym * x_sol = y
66-
# F is automatically cleaned up when garbage collected
6766
```
6867

6968
## Running with MPI

docs/src/api.md

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -428,15 +428,6 @@ solve
428428
solve!
429429
```
430430

431-
### Manual Cleanup (Optional)
432-
433-
Factorization objects are automatically cleaned up when garbage collected.
434-
For explicit control, `finalize!` can be called manually (must be called on all ranks together).
435-
436-
```@docs
437-
finalize!
438-
```
439-
440431
### Usage Examples
441432

442433
```julia
@@ -459,14 +450,10 @@ x = solve(F, b)
459450
# Or use backslash
460451
x = F \ b
461452

462-
# F is automatically cleaned up when garbage collected
463-
# (or call finalize!(F) for immediate cleanup on all ranks)
464-
465453
# For non-symmetric matrices, use LU
466454
A_nonsym = SparseMatrixMPI{Float64}(sprand(1000, 1000, 0.01) + 10I)
467455
F_lu = lu(A_nonsym)
468456
x = F_lu \ b
469-
# F_lu is automatically cleaned up when garbage collected
470457
```
471458

472459
### Direct Solve Syntax
@@ -484,8 +471,6 @@ x = transpose(b) / A # solve x*A = transpose(b)
484471
x = transpose(b) / transpose(A) # solve x*transpose(A) = transpose(b)
485472
```
486473

487-
Note: Factorizations are automatically cleaned up when garbage collected. Cleanup is synchronized across MPI ranks when the next factorization is created.
488-
489474
## Cache Management
490475

491476
```@docs

src/mumps_factorization.jl

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,6 @@ const _destroy_list_lock = ReentrantLock()
4848
MUMPSFactorizationMPI{T}
4949
5050
Distributed MUMPS factorization result. Can be reused for multiple solves.
51-
52-
Factorization objects are automatically cleaned up when garbage collected,
53-
with synchronized finalization across MPI ranks. Manual `finalize!(F)` is
54-
still available for explicit control (must be called on all ranks together).
5551
"""
5652
mutable struct MUMPSFactorizationMPI{T}
5753
id::Int # Unique ID for finalization tracking
@@ -282,7 +278,6 @@ end
282278
283279
Compute LU factorization of a distributed sparse matrix using MUMPS.
284280
Returns a `MUMPSFactorizationMPI` for use with `\\` or `solve`.
285-
Factorization is automatically cleaned up when garbage collected.
286281
"""
287282
function LinearAlgebra.lu(A::SparseMatrixMPI{T}) where T
288283
return _create_mumps_factorization(A, false)
@@ -294,7 +289,6 @@ end
294289
Compute LDLT factorization of a distributed symmetric sparse matrix using MUMPS.
295290
The matrix must be symmetric; only the lower triangular part is used.
296291
Returns a `MUMPSFactorizationMPI` for use with `\\` or `solve`.
297-
Factorization is automatically cleaned up when garbage collected.
298292
"""
299293
function LinearAlgebra.ldlt(A::SparseMatrixMPI{T}) where T
300294
return _create_mumps_factorization(A, true)
@@ -371,11 +365,7 @@ end
371365
"""
372366
finalize!(F::MUMPSFactorizationMPI)
373367
374-
Manually release MUMPS resources. This is a **collective operation** - all
375-
ranks must call it together for immediate cleanup.
376-
377-
If the factorization has already been cleaned up (by automatic finalization
378-
or a previous manual call), this is a no-op but all ranks must still call it.
368+
Release MUMPS resources. Must be called on all ranks together.
379369
"""
380370
function finalize!(F::MUMPSFactorizationMPI)
381371
# Check if already finalized (removed from registry)

0 commit comments

Comments
 (0)