underworldcode / underworld2

underworld2: A parallel, particle-in-cell, finite element code for Geodynamics.
http://www.underworldcode.org/
Other
169 stars 58 forks source link

Memory leak problem when using non-linear solver #123

Closed ymwanghub closed 8 years ago

ymwanghub commented 8 years ago

When I use the nonlinear solver to deal with some non-linear problem, for example, a strain-rate dependent viscosity in convection system, in the beginning the system seems convergent but with some memory leak problems reported and the execution stops quickly:

........
Constructing QLJME0LO__matrix..
Stiffness matrix: 'QLJME0LO__matrix'
    Calculating number of nonzero entries...
    Instantiating StiffnessMatrix as JBZIRFEY__matrix
Constructing JBZIRFEY__matrix..
Stiffness matrix: 'JBZIRFEY__matrix'
    Calculating number of nonzero entries...
    Instantiating MassMatrixTerm as UWSXJ2VA__assemblyterm
Constructing UWSXJ2VA__assemblyterm..
swig/python detected a memory leak of type 'Vec *', no destructor found.
swig/python detected a memory leak of type 'Vec *', no destructor found.
In SystemLinearEquations_NonLinearExecute

Non linear solver - iteration 0
Linear solver (0HV9JY8Y__system-execute) 

BSSCR -- Block Stokes Schur Compliment Reduction Solver 
... ... ... ...
... ... .. ....
... ... ... ...
Non linear solver - iteration 4
Linear solver (0HV9JY8Y__system-execute) 

BSSCR -- Block Stokes Schur Compliment Reduction Solver 

-----  K2_GMG  ------

AUGMENTED LAGRANGIAN K2 METHOD - Penalty = 1.000000

    * K+p*K2 in time: 0.060849 seconds

SROpGenerator_SimpleFinestLevel: time = 3.05870e-02 
  [5] SROpGenerator_SimpleCoarserLevel: time = 1.31850e-02 
  [4] SROpGenerator_SimpleCoarserLevel: time = 3.15595e-03 
  [3] SROpGenerator_SimpleCoarserLevel: time = 8.36134e-04 
  [2] SROpGenerator_SimpleCoarserLevel: time = 2.75850e-04 
  [1] SROpGenerator_SimpleCoarserLevel: time = 1.24931e-04 
  Setting schur_pc to "uw" 

SCR Solver Summary:

  Multigrid setup:        = 0.04903 secs 
  Pressure Solve:         = 0.9454 secs / 3 its
  Final V Solve:          = 0.2606 secs / 8 its

  Total BSSCR Linear solve time: 2.159412 seconds

Linear solver (0HV9JY8Y__system-execute), solution time 2.170133e+00 (secs)
In func SystemLinearEquations_NonLinearExecute: Iteration 4 of 500 - Residual 6.429e-06 - Tolerance = 0.01
Non linear solver - Residual 6.42903200e-06; Tolerance 1.0000e-02 - Converged - 2.911548e+01 (secs)

In func SystemLinearEquations_NonLinearExecute: Converged after 4 iterations.
    Instantiating AdvDiffMulticorrector as UKE9OFZ9__solver
    Instantiating AdvectionDiffusionSLE as UKE9OFZ9__system
    Instantiating ForceVector as 966EYMNE__vector
Constructing 966EYMNE__vector..
    Instantiating ForceVector as 1WQUN3CP__vector
Constructing 1WQUN3CP__vector..
    Instantiating IntegrationPointsSwarm as 38EBMZVK__swarm
    Instantiating GaussParticleLayout as 38EBMZVK__particleLayout
    Instantiating SingleCellLayout as 38EBMZVK__cellLayout
Constructing 38EBMZVK__swarm..
    38EBMZVK__cellLayout has not been constructed yet. Constructing now.
        Constructing 38EBMZVK__cellLayout..
    38EBMZVK__particleLayout has not been constructed yet. Constructing now.
        Constructing 38EBMZVK__particleLayout..
Constructing UKE9OFZ9__system..
    UKE9OFZ9__solver has not been constructed yet. Constructing now.
        Constructing UKE9OFZ9__solver..
    Instantiating LumpedMassMatrixForceTerm as HPD3X9V4__assemblyterm
Constructing HPD3X9V4__assemblyterm..
    Instantiating AdvDiffResidualForceTerm as 4QMSM3BD__assemblyterm
Constructing 4QMSM3BD__assemblyterm..
    Instantiating TimeIntegrator as CSYDU65P__system
    Instantiating SwarmAdvector as CSYDU65P__integrand
Constructing CSYDU65P__system..
Constructing CSYDU65P__integrand..
Traceback (most recent call last):
  File "input_subduction_01.py", line 300, in <module>
    stokesPIC.solve()
TypeError: 'NoneType' object is not callable
RebeccaFarrington commented 8 years ago

Hello,

Is it possible for you to provide some details?
The input file would be great. Thanks

ymwanghub commented 8 years ago

Hi, I have attached my input file. Some of the commands in the input file may not be used but for personal purpose, and maybe you can just focus on the rheology and solving parts. The input file was written as a python script, but it can not be uploaded with a '.py' suffix, so I just changed the suffix to '.txt'.

Thanks. input_test_01.txt

jmansour commented 8 years ago

Hi there. Sorry about the delay on this.

Those memory leak messages can be ignored safely.

There were issues in your model that I have corrected. Do a diff to see what's changed. The model now runs to completion without issue, but that's as far as I've tested.

I'll close this for now, but feel free to reopen if there are still problems.

test.py.txt