Open SNMS95 opened 1 year ago
Add to end:
if use_petsc:
A_fn.destroy()
else:
del A_fn
del dofs
del res_vec
gc.collect()
return sol
# Delete PETSc objects
ksp.destroy()
rhs.destroy()
y.destroy()
A.destroy()
result = x.getArray()
x.destroy()
gc.collect()
return result
problem.A_sp_scipy_diag = A_sp_scipy.diagonal()
...
del A_sp_scipy
del A_sp
I think we should make garbage collection as a standard practice when collaborating
It seems there is come memory leakage somewhere. It can be clearly seen if the topopt example is run and you monitor the memory. It is steadily increasing. This results in OOM-KILL events on HPCs.