Skip to content

Commit

Permalink
fix no free
Browse files Browse the repository at this point in the history
  • Loading branch information
rayegun committed Nov 16, 2023
1 parent 9aabc86 commit 1692348
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion examples/basic_example.jl
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ chunksizes = isroot ? distribute_evenly(size(csr, 1), nprow * npcol) : nothing
# SuperLUDIST.superlu_set_num_threads(Int64, 1)

# If constructing from existing per-node data the following constructors will help:
# A = DistributedSuperMatrix(store::CSRStore, firstrow, globalsize::NTuple{2, Int})
# store = CSRStore(ptrs, indices, values, localsize::NTuple{2, Int})
# A = DistributedSuperMatrix(store::CSRStore, firstrow, globalsize::NTuple{2, Int})
# @show iam csr
A = Communication.scatterstore!(
DistributedSuperMatrix{Float64, Int64}(grid), csr, chunksizes; root);
Expand Down
8 changes: 4 additions & 4 deletions src/lowlevel.jl
Original file line number Diff line number Diff line change
Expand Up @@ -62,17 +62,17 @@ L = Symbol(String(:SuperLU_) * String(I))
!MPI.Finalized() && ScalePermstructFree(x)
end
end
function LUstructFree(r::Base.RefValue{$(prefixname(T, :LUstruct_t)){$I}})
function LUstructFree(r::$(prefixname(T, :LUstruct_t)){$I})
$L.$(prefixname(T, :LUstructFree))(r)
end
function Destroy_LU(r::Base.RefValue{$(prefixname(T, :LUstruct_t)){$I}}, n, grid)
function Destroy_LU(r::$(prefixname(T, :LUstruct_t)){$I}, n, grid)
$L.$(prefixname(T, :Destroy_LU))(n, grid, r) # why do I have to grid.grid here?!
end
function LUstructInit(r::$(prefixname(T, :LUstruct_t)){$I}, n, grid)
$L.$(prefixname(T, :LUstructInit))(n, r)
return finalizer(r) do x
# !MPI.Finalized() && Destroy_LU(x, n, grid)
# !MPI.Finalized() && LUstructFree(x)
!MPI.Finalized() && Destroy_LU(x, n, grid)
!MPI.Finalized() && LUstructFree(x)
end
end
end
Expand Down

0 comments on commit 1692348

Please sign in to comment.