[petsc-users] Error - Out of memory. This could be due to allocating too large an object or bleeding by not properly destroying unneeded objects.

Stefano Zampini stefano.zampini at gmail.com
Sun Feb 23 03:35:09 CST 2020


Il giorno dom 23 feb 2020 alle ore 11:53 Tsung-Hsing Chen <
barrydog505 at gmail.com> ha scritto:

> This error came with a matrix approximate 300,000*300,000, and I was
> solving a 3D model.
> " the memory requirements for LU are N log(N) in 2D and N^4/3 in 3D. "
> What unit is it? Byte?
>

Number of floating-point entries.

Assuming an optimal nested dissection ordering can be found (i.e. no
"dense" rows), the largest front is asymptotically as large as N^(2/3) (N
the size of the matrix)
Storing it in memory requires (N^(2/3))^2 entries, thus N^4/3 entries.
What problem are you solving?
If you plan to use direct methods, you may want to experiment with parallel
factorization packages like  MUMPS or SUPERLU_DIST


>
> Stefano Zampini <stefano.zampini at gmail.com> 於 2020年2月23日 週日 下午4:33寫道:
>
>> This seems integer overflow when computing the factors.
>>
>> How large is the matrix when you encounter the error?
>> Note that LU is not memory optimal and you can easily encounter
>> out-of-memory issues with large matrices.
>> Assuming sparsity, the memory requirements for LU are N log(N) in 2D and
>> N^4/3 in 3D.
>>
>>
>> Il giorno dom 23 feb 2020 alle ore 11:01 Tsung-Hsing Chen <
>> barrydog505 at gmail.com> ha scritto:
>>
>>> Hi all,
>>>
>>> I have written a simple code to solve the FEM problem, and I want to use
>>> LU to solve the Ax=b.
>>> My problem(error) won't happen at the beginning until M & N in A_matrix
>>> is getting larger. (Can also be understood as mesh vertex increase.)
>>> All the error output seems to relate to LU, but I don't know what should
>>> be done.
>>> The followings are the code I wrote(section) and the error output.
>>>
>>> Here's the code (section) :
>>>   /*
>>>         code ...
>>>   */
>>>   ierr = MatCreate(PETSC_COMM_WORLD, &A_matrix);CHKERRQ(ierr);
>>>   ierr = MatSetSizes(A_matrix, PETSC_DECIDE, PETSC_DECIDE, M,
>>> N);CHKERRQ(ierr);
>>>   ierr = MatSetType(A_matrix, MATSEQAIJ);CHKERRQ(ierr);
>>>   // setting nnz ...
>>>   ierr = MatSeqAIJSetPreallocation(A_matrix, 0, nnz);CHKERRQ(ierr);
>>>   /*
>>>         MatSetValues(); ...
>>>         MatAssemblyBegin();
>>>         MatAssemblyEnd();
>>>   */
>>>   ierr = KSPCreate(PETSC_COMM_WORLD, &ksp);CHKERRQ(ierr);
>>>   ierr = KSPSetOperators(ksp, A_matrix, A_matrix);CHKERRQ(ierr);
>>>   ierr = KSPSetType(ksp, KSPPREONLY);CHKERRQ(ierr);
>>>   ierr = KSPGetPC(ksp, &pc);CHKERRQ(ierr);
>>>   ierr = PCSetType(pc, PCLU);CHKERRQ(ierr);
>>>   ierr = KSPSetFromOptions(ksp);CHKERRQ(ierr);
>>>   ierr = KSPSetUp(ksp);CHKERRQ(ierr);
>>>   /*
>>>         code ...
>>>   */
>>>
>>> Here's the error (run with valgrind --tool=memcheck --leak-check=full) :
>>>   ==6371== Warning: set address range perms: large range [0x7c84a040,
>>> 0xb4e9a598) (undefined)
>>>   ==6371== Warning: set address range perms: large range [0xb4e9b040,
>>> 0x2b4e9aeac) (undefined)
>>>   ==6371== Warning: set address range perms: large range [0x2b4e9b040,
>>> 0x4b4e9aeac) (undefined)
>>>   ==6371== Argument 'size' of function memalign has a fishy (possibly
>>> negative) value: -5187484888
>>>   ==6371==    at 0x4C320A6: memalign (in
>>> /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
>>>   ==6371==    by 0x501B4B0: PetscMallocAlign (mal.c:49)
>>>   ==6371==    by 0x501CE37: PetscMallocA (mal.c:422)
>>>   ==6371==    by 0x5ACFF0C: MatLUFactorSymbolic_SeqAIJ (aijfact.c:366)
>>>   ==6371==    by 0x561D8B3: MatLUFactorSymbolic (matrix.c:3005)
>>>   ==6371==    by 0x644ED9C: PCSetUp_LU (lu.c:90)
>>>   ==6371==    by 0x65A2C32: PCSetUp (precon.c:894)
>>>   ==6371==    by 0x6707E71: KSPSetUp (itfunc.c:376)
>>>   ==6371==    by 0x13AB09: Calculate (taylor_hood.c:1780)
>>>   ==6371==    by 0x10CB85: main (taylor_hood.c:228)
>>>   ==6371==
>>>   [0]PETSC ERROR: --------------------- Error Message
>>> --------------------------------------------------------------
>>>   [0]PETSC ERROR: Out of memory. This could be due to allocating
>>>   [0]PETSC ERROR: too large an object or bleeding by not properly
>>>   [0]PETSC ERROR: destroying unneeded objects.
>>>   [0]PETSC ERROR: Memory allocated 0 Memory used by process 15258234880
>>>   [0]PETSC ERROR: Try running with -malloc_dump or -malloc_view for info.
>>>   [0]PETSC ERROR: Memory requested 18446744068522065920
>>>   [0]PETSC ERROR: See
>>> https://www.mcs.anl.gov/petsc/documentation/faq.html for trouble
>>> shooting.
>>>   [0]PETSC ERROR: Petsc Release Version 3.12.4, unknown
>>>   [0]PETSC ERROR: ./taylor_hood on a arch-linux2-c-debug named e2-120 by
>>> barry Sun Feb 23 14:18:46 2020
>>>   [0]PETSC ERROR: Configure options --with-cc=gcc --with-cxx=g++
>>> --with-fc=gfortran --download-mpich --download-fblaslapack
>>> --download-triangle
>>>   [0]PETSC ERROR: #1 MatLUFactorSymbolic_SeqAIJ() line 366 in
>>> /home/barry/petsc/src/mat/impls/aij/seq/aijfact.c
>>>   [0]PETSC ERROR: #2 PetscMallocA() line 422 in
>>> /home/barry/petsc/src/sys/memory/mal.c
>>>   [0]PETSC ERROR: #3 MatLUFactorSymbolic_SeqAIJ() line 366 in
>>> /home/barry/petsc/src/mat/impls/aij/seq/aijfact.c
>>>   [0]PETSC ERROR: #4 MatLUFactorSymbolic() line 3005 in
>>> /home/barry/petsc/src/mat/interface/matrix.c
>>>   [0]PETSC ERROR: #5 PCSetUp_LU() line 90 in
>>> /home/barry/petsc/src/ksp/pc/impls/factor/lu/lu.c
>>>   [0]PETSC ERROR: #6 PCSetUp() line 894 in
>>> /home/barry/petsc/src/ksp/pc/interface/precon.c
>>>   [0]PETSC ERROR: #7 KSPSetUp() line 376 in
>>> /home/barry/petsc/src/ksp/ksp/interface/itfunc.c
>>>   [0]PETSC ERROR: #8 Calculate() line 1780 in
>>> /home/barry/brain/brain/3D/taylor_hood.c
>>>   [0]PETSC ERROR: #9 main() line 230 in
>>> /home/barry/brain/brain/3D/taylor_hood.c
>>>   [0]PETSC ERROR: PETSc Option Table entries:
>>>   [0]PETSC ERROR: -dm_view
>>>   [0]PETSC ERROR: -f mesh/ellipsoid.msh
>>>   [0]PETSC ERROR: -matload_block_size 1
>>>   [0]PETSC ERROR: ----------------End of Error Message -------send
>>> entire error message to petsc-maint at mcs.anl.gov----------
>>>
>>> Is there any setting that should be done but I ignore?
>>>
>>> Thanks in advance,
>>>
>>> Tsung-Hsing Chen
>>>
>>
>>
>> --
>> Stefano
>>
>

-- 
Stefano
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20200223/6dd3d911/attachment.html>


More information about the petsc-users mailing list