<div>You are right. I need to look into iterative solvers. Memory usage of direct solvers is a problem.</div><div>Thanks</div><div>Amir</div><br><div class="gmail_quote_attribution">On Oct 7 2019, at 12:19 pm, Smith, Barry F. <bsmith@mcs.anl.gov> wrote:</div><blockquote><div><br><div>If you need to use a direct solver than you need to start running in parallel and using MUMPS or SuperLU_DIST or Pastix as your direct solver. But direct solvers memory usage grows much more than linearly with problem size limiting how big you can go.</div><br><div>You should also investigate iterative solvers, their memory usage is generally order the problem size (or a tiny bit more like a log) so you can do much larger problems: see https://www.mcs.anl.gov/petsc/documentation/faq.html#newton and https://www.mcs.anl.gov/petsc/documentation/faq.html#kspdiverged for tips on figuring out why solvers are failing.</div><br><div>Barry</div><br><br><blockquote><div>On Oct 4, 2019, at 3:26 PM, Amir via petsc-users <petsc-users@mcs.anl.gov> wrote:</div><br><div>Hi</div><div>To test my FormFunction, running the code on a coarse mesh, the memory usage is normal. However, when I try to use higher mesh resolution, the memory behavior is abnormal. It goes up till the program finished with Memory requested message. To better see the memory usage, I run with -log_view -malloc_test -malloc_dump. All of vectors created, were destructed. Can you help me through this. Is it really because I use higher mesh resolution? Thanks for your time.</div><div>Amir</div><br><div>[0]PETSC ERROR: Memory requested 8589934260</div><div>[0]PETSC ERROR: See http://www.mcs.anl.gov/petsc/documentation/faq.html for trouble shooting.</div><div>[0]PETSC ERROR: Petsc Release Version 3.9.1, unknown</div><div>[0]PETSC ERROR: ./main on a mpich-gcc-dbg named amir by amir Sat Oct 5 04:06:01 2019</div><div>[0]PETSC ERROR: Configure options --download-mpich --download-fblaslapack --with-shared-libraries=1 --with-blaslapack-dir=/usr --with-x-dir=/ --download-mumps --download-superlu_dist --download-hypre --download-ml --download-hdf5 --download-cmake --download-scalapack -download-parmetis -download-metis --with-mpich=1 --with-fortran-kernels=generic --with-debugging=0</div><div>[0]PETSC ERROR: #1 PetscFreeSpaceGet() line 11 in /home/amir/petsc/src/mat/utils/freespace.c</div><div>[0]PETSC ERROR: #2 PetscTrMallocDefault() line 183 in /home/amir/petsc/src/sys/memory/mtr.c</div><div>[0]PETSC ERROR: #3 PetscMallocA() line 390 in /home/amir/petsc/src/sys/memory/mal.c</div><div>[0]PETSC ERROR: #4 PetscFreeSpaceGet() line 11 in /home/amir/petsc/src/mat/utils/freespace.c</div><div>[0]PETSC ERROR: #5 MatLUFactorSymbolic_SeqAIJ() line 349 in /home/amir/petsc/src/mat/impls/aij/seq/aijfact.c</div><div>[0]PETSC ERROR: #6 MatLUFactorSymbolic() line 2975 in /home/amir/petsc/src/mat/interface/matrix.c</div><div>[0]PETSC ERROR: #7 PCSetUp_LU() line 95 in /home/amir/petsc/src/ksp/pc/impls/factor/lu/lu.c</div><div>[0]PETSC ERROR: #8 PCSetUp() line 923 in /home/amir/petsc/src/ksp/pc/interface/precon.c</div><div>[0]PETSC ERROR: #9 KSPSetUp() line 381 in /home/amir/petsc/src/ksp/ksp/interface/itfunc.c</div><div>[0]PETSC ERROR: #10 KSPSolve() line 612 in /home/amir/petsc/src/ksp/ksp/interface/itfunc.c</div><div>[0]PETSC ERROR: #11 SNESSolve_NEWTONLS() line 224 in /home/amir/petsc/src/snes/impls/ls/ls.c</div><div>[0]PETSC ERROR: #12 SNESSolve() line 4312 in /home/amir/petsc/src/snes/interface/snes.c</div><br><div>[ 0]48 bytes PetscFreeSpaceGet() line 10 in /home/amir/petsc/src/mat/utils/freespace.c</div><div>[ 0]1356241520 bytes PetscFreeSpaceGet() line 11 in /home/amir/petsc/src/mat/utils/freespace.c</div><div>[ 0]48 bytes PetscFreeSpaceGet() line 10 in /home/amir/petsc/src/mat/utils/freespace.c</div><div>[ 0]2227520 bytes MatLUFactorSymbolic_SeqAIJ() line 308 in /home/amir/petsc/src/mat/impls/aij/seq/aijfact.c</div><div>[ 0]23216 bytes PetscBTCreate() line 75 in /home/amir/petsc/include/petscbt.h</div><div>[ 0]742512 bytes MatLUFactorSymbolic_SeqAIJ() line 306 in /home/amir/petsc/src/mat/impls/aij/seq/aijfact.c</div><div>[ 0]742512 bytes MatLUFactorSymbolic_SeqAIJ() line 301 in /home/amir/petsc/src/mat/impls/aij/seq/aijfact.c</div><div>[ 0]742512 bytes MatLUFactorSymbolic_SeqAIJ() line 300 in /home/amir/petsc/src/mat/impls/aij/seq/aijfact.c</div><div>[ 0]16 bytes PetscLayoutSetUp() line 141 in /home/amir/petsc/src/vec/is/utils/pmap.c</div><div>[ 0]16 bytes PetscStrallocpy() line 189 in /home/amir/petsc/src/sys/utils/str.c</div><div>[ 0]32 bytes PetscStrallocpy() line 189 in /home/amir/petsc/src/sys/utils/str.c</div><div>[ 0]32 bytes PetscFunctionListAdd_Private() line 213 in /home/amir/petsc/src/sys/dll/reg.c</div><div>[ 0]16 bytes ISCreate_General() line 740 in /home/amir/petsc/src/vec/is/is/impls/general/general.c</div><div>[ 0]48 bytes PetscLayoutCreate() line 48 in /home/amir/petsc/src/vec/is/utils/pmap.c</div><div>[ 0]784 bytes ISCreate() line 39 in /home/amir/petsc/src/vec/is/is/interface/isreg.c</div><div>[ 0]742512 bytes ISInvertPermutation_General() line 205 in /home/amir/petsc/src/vec/is/is/impls/general/general.c</div></blockquote></div></blockquote><img class="mailspring-open" alt="Sent from Mailspring" width="0" height="0" style="border:0; width:0; height:0;" src="https://link.getmailspring.com/open/9B3B5373-3F66-4989-A820-9F2D3E92FC3E@getmailspring.com?me=97a6ec29&recipient=cGV0c2MtdXNlcnNAbWNzLmFubC5nb3Y%3D">