# PC failed due to FACTOR\_OUTMEMORY

**URL:** <https://community.freefem.org/t/pc-failed-due-to-factor-outmemory/1593>\
**Category:** General Discussion\
**Created:** [March 11, 2022, 2:10am UTC](https://community.freefem.org/t/pc-failed-due-to-factor-outmemory/1593 "2022-03-11T02:10:40Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Qianrui](https://avatars.discourse-cdn.com/v4/letter/q/9fc348/32.png) [@Qianrui](https://community.freefem.org/u/Qianrui)\
**Post date:** [March 11, 2022, 2:10am UTC](https://community.freefem.org/t/pc-failed-due-to-factor-outmemory/1593/1 "2022-03-11T02:10:40Z")

</div>

Hello, I encountered the following problem when running FreeFree+±mpi (load “PETSc-complex” ) :

> set(A, sparams =“-pc\_type lu -pc\_factor\_mat\_solver\_type mumps -ksp\_converged\_reason”);

> Linear solve did not converge due to DIVERGED\_PC\_FAILED iterations 0  
> PC failed due to FACTOR\_OUTMEMORY  
> Linear solve did not converge due to DIVERGED\_PC\_FAILED iterations 0  
> PC failed due to FACTOR\_OUTMEMORY  
> [0]PETSC ERROR: ------------------------------------------------------------------------  
> [0]PETSC ERROR: Caught signal number 11 SEGV: Segmentation Violation, probably memory access out of range  
> [0]PETSC ERROR: Try option -start\_in\_debugger or -on\_error\_attach\_debugger  
> [0]PETSC ERROR: or see [FAQ — PETSc 3.20.1 documentation](https://petsc.org/release/faq/#valgrind)  
> [0]PETSC ERROR: or try [http://valgrind.org](http://valgrind.org) on GNU/linux and Apple Mac OS X to find memory corruption errors  
> [0]PETSC ERROR: configure using --with-debugging=yes, recompile, link, and run  
> [0]PETSC ERROR: to get more information on the crash.  
> e[1;31m[0]PETSC ERROR: --------------------- Error Message --------------------------------------------------------------  
> e[0;39me[0;49m[0]PETSC ERROR: Signal received  
> [0]PETSC ERROR: See [FAQ — PETSc 3.20.1 documentation](https://petsc.org/release/faq/) for trouble shooting.  
> [0]PETSC ERROR: Petsc Release Version 3.16.1, Nov 01, 2021  
> [0]PETSC ERROR: FreeFem+±mpi on a named LAPTOP-4T98F0QS by weiqi Fri Mar 11 10:04:30 2022  
> [0]PETSC ERROR: Configure options --prefix=/mingw64/ff-petsc/c MAKEFLAGS= --with-debugging=0 COPTFLAGS=“-O3 -mtune=generic” CXXOPTFLAGS=“-O3 -mtune=generic” FOPTFLAGS=“-O3 -mtune=generic” --with-cxx-dialect=C++11 --with-ssl=0 --with-x=0 --with-fortran-bindings=0 --with-cudac=0 --with-shared-libraries=0 --with-cc=gcc --with-cxx=g++ CXXFLAGS=-fno-stack-protector CFLAGS=-fno-stack-protector FFLAGS=“-g -O2” --with-mpi-lib=/c/Windows/System32/msmpi.dll --with-mpi-include=/c/builds/workspace/deployEXE/3rdparty/include/msmpi --with-mpiexec=“/C/Program\ Files/Microsoft\ MPI/Bin/mpiexec” --with-fc=gfortran --with-scalar-type=complex --with-blaslapack-include= --with-blaslapack-lib=/mingw64/bin/libopenblas.dll --with-metis-dir=/mingw64/ff-petsc/r --with-ptscotch-dir=/mingw64/ff-petsc/r --with-mmg-dir=/mingw64/ff-petsc/r --with-parmmg-dir=/mingw64/ff-petsc/r --with-superlu-dir=/mingw64/ff-petsc/r --with-suitesparse-dir=/mingw64/ff-petsc/r --with-parmetis-dir=/mingw64/ff-petsc/r --with-tetgen-dir=/mingw64/ff-petsc/r --download-slepc --download-hpddm --download-htool --with-scalapack-dir=/mingw64/ff-petsc/r --with-mumps-dir=/mingw64/ff-petsc/r PETSC\_ARCH=fc  
> [0]PETSC ERROR: #1 User provided function() at unknown file:0  
> [0]PETSC ERROR: Run with -malloc\_debug to check if memory corruption is causing the crash.
> 
> job aborted:  
> [ranks] message
> 
> [0] application aborted  
> aborting MPI\_COMM\_WORLD (comm=0x44000000), error 59, comm rank 0

---

<div class="post-metadata">

**Author:** ![prj](https://avatars.discourse-cdn.com/v4/letter/p/ecae2f/32.png) [@prj](https://community.freefem.org/u/prj)\
**Post date:** [March 11, 2022, 9:04am UTC](https://community.freefem.org/t/pc-failed-due-to-factor-outmemory/1593/2 "2022-03-11T09:04:22Z")

</div>

Get more memory in your machine or use a less expensive preconditioner.

---

<div class="post-metadata">

**Author:** ![Qianrui](https://avatars.discourse-cdn.com/v4/letter/q/9fc348/32.png) [@Qianrui](https://community.freefem.org/u/Qianrui)\
**Post date:** [March 11, 2022, 11:11am UTC](https://community.freefem.org/t/pc-failed-due-to-factor-outmemory/1593/3 "2022-03-11T11:11:36Z")

</div>

Hello, does that mean -pc\_type needs to use other more efficient ones? For example,

---

<div class="post-metadata">

**Author:** ![prj](https://avatars.discourse-cdn.com/v4/letter/p/ecae2f/32.png) [@prj](https://community.freefem.org/u/prj)\
**Post date:** [March 11, 2022, 11:50am UTC](https://community.freefem.org/t/pc-failed-due-to-factor-outmemory/1593/4 "2022-03-11T11:50:59Z")

</div>

Yes, that is what it means.

---

<div class="post-metadata">

**Author:** ![Qianrui](https://avatars.discourse-cdn.com/v4/letter/q/9fc348/32.png) [@Qianrui](https://community.freefem.org/u/Qianrui)\
**Post date:** [March 13, 2022, 2:09pm UTC](https://community.freefem.org/t/pc-failed-due-to-factor-outmemory/1593/6 "2022-03-13T14:09:05Z")

</div>

Hello, I have tried several iterative methods, but the following problems will still occur, but my memory is enough. Is it possible that there is a bug in my program code？resulting in the following errors

> set(A, sparams =“-pc\_type lu -ksp\_type bcgs -ksp\_converged\_reason”);

> Linear solve converged due to CONVERGED\_RTOL iterations 1  
> — system solved with PETSc (in 1.196600e-03)  
> – Square mesh : nb vertices =289 , nb triangles = 512 , nb boundary edges 64  
> — partition of unity built (in 3.340000e-05)  
> — global numbering created (in 7.240000e-05)  
> — global CSR created (in 3.937000e-04)  
> [0]PETSC ERROR: ------------------------------------------------------------------------  
> [0]PETSC ERROR: Caught signal number 11 SEGV: Segmentation Violation, probably memory access out of range  
> [0]PETSC ERROR: Try option -start\_in\_debugger or -on\_error\_attach\_debugger  
> [0]PETSC ERROR: or see [FAQ — PETSc 3.20.1 documentation](https://petsc.org/release/faq/#valgrind)  
> [0]PETSC ERROR: or try [http://valgrind.org](http://valgrind.org) on GNU/linux and Apple Mac OS X to find memory corruption errors  
> [0]PETSC ERROR: configure using --with-debugging=yes, recompile, link, and run  
> [0]PETSC ERROR: to get more information on the crash.  
> e[1;31m[0]PETSC ERROR: --------------------- Error Message --------------------------------------------------------------  
> e[0;39me[0;49m[0]PETSC ERROR: Signal received  
> [0]PETSC ERROR: See [FAQ — PETSc 3.20.1 documentation](https://petsc.org/release/faq/) for trouble shooting.  
> [0]PETSC ERROR: Petsc Release Version 3.16.1, Nov 01, 2021  
> [0]PETSC ERROR: FreeFem+±mpi on a named LAPTOP-4T98F0QS by weiqi Sun Mar 13 22:04:19 2022  
> [0]PETSC ERROR: Configure options --prefix=/mingw64/ff-petsc/c MAKEFLAGS= --with-debugging=0 COPTFLAGS=“-O3 -mtune=generic” CXXOPTFLAGS=“-O3 -mtune=generic” FOPTFLAGS=“-O3 -mtune=generic” --with-cxx-dialect=C++11 --with-ssl=0 --with-x=0 --with-fortran-bindings=0 --with-cudac=0 --with-shared-libraries=0 --with-cc=gcc --with-cxx=g++ CXXFLAGS=-fno-stack-protector CFLAGS=-fno-stack-protector FFLAGS=“-g -O2” --with-mpi-lib=/c/Windows/System32/msmpi.dll --with-mpi-include=/c/builds/workspace/deployEXE/3rdparty/include/msmpi --with-mpiexec=“/C/Program\ Files/Microsoft\ MPI/Bin/mpiexec” --with-fc=gfortran --with-scalar-type=complex --with-blaslapack-include= --with-blaslapack-lib=/mingw64/bin/libopenblas.dll --with-metis-dir=/mingw64/ff-petsc/r --with-ptscotch-dir=/mingw64/ff-petsc/r --with-mmg-dir=/mingw64/ff-petsc/r --with-parmmg-dir=/mingw64/ff-petsc/r --with-superlu-dir=/mingw64/ff-petsc/r --with-suitesparse-dir=/mingw64/ff-petsc/r --with-parmetis-dir=/mingw64/ff-petsc/r --with-tetgen-dir=/mingw64/ff-petsc/r --download-slepc --download-hpddm --download-htool --with-scalapack-dir=/mingw64/ff-petsc/r --with-mumps-dir=/mingw64/ff-petsc/r PETSC\_ARCH=fc  
> [0]PETSC ERROR: #1 User provided function() at unknown file:0  
> [0]PETSC ERROR: Run with -malloc\_debug to check if memory corruption is causing the crash.
> 
> job aborted:  
> [ranks] message
> 
> [0] application aborted  
> aborting MPI\_COMM\_WORLD (comm=0x44000000), error 59, comm rank 0

---

<div class="post-metadata">

**Author:** ![prj](https://avatars.discourse-cdn.com/v4/letter/p/ecae2f/32.png) [@prj](https://community.freefem.org/u/prj)\
**Post date:** [March 13, 2022, 2:20pm UTC](https://community.freefem.org/t/pc-failed-due-to-factor-outmemory/1593/7 "2022-03-13T14:20:40Z")

</div>

There is a bug in your program, nothing is related to `PC failed due to FACTOR_OUTMEMORY` in your last log…

---

<div class="post-metadata">

**Author:** ![Qianrui](https://avatars.discourse-cdn.com/v4/letter/q/9fc348/32.png) [@Qianrui](https://community.freefem.org/u/Qianrui)\
**Post date:** [March 14, 2022, 12:44pm UTC](https://community.freefem.org/t/pc-failed-due-to-factor-outmemory/1593/8 "2022-03-14T12:44:19Z")

</div>

Hello, how can I check what bug caused the program crash? After checking many times, the above errors will still appear, or can you provide an example of using PETSc to calculate the error and convergence order? Thank you very much.

---

<div class="post-metadata">

**Author:** ![prj](https://avatars.discourse-cdn.com/v4/letter/p/ecae2f/32.png) [@prj](https://community.freefem.org/u/prj)\
**Post date:** [March 14, 2022, 4:44pm UTC](https://community.freefem.org/t/pc-failed-due-to-factor-outmemory/1593/9 "2022-03-14T16:44:03Z")

</div>

Which error and which convergence order?

---

<div class="post-metadata">

**Author:** ![Qianrui](https://avatars.discourse-cdn.com/v4/letter/q/9fc348/32.png) [@Qianrui](https://community.freefem.org/u/Qianrui)\
**Post date:** [March 15, 2022, 1:14am UTC](https://community.freefem.org/t/pc-failed-due-to-factor-outmemory/1593/10 "2022-03-15T01:14:04Z")

</div>

Hello，A program for calculating the spatial error and convergence order is written with freefem + +. The obtained spatial convergence order and error are consistent with the theoretical results. However, after the spatial grid is encrypted, the calculation is very time-consuming, and the following errors will occur during the calculation,

> Error umpfack umfpack\_zl\_numeric status -1  
> Error umfpack\_di\_solve status -3

so it is rewritten with the parallel version, but the memory will always collapse, I don’t know what caused it. Therefore, could you please provide an example of calculating spatial error and convergence order?

---

<div class="post-metadata">

**Author:** ![Qianrui](https://avatars.discourse-cdn.com/v4/letter/q/9fc348/32.png) [@Qianrui](https://community.freefem.org/u/Qianrui)\
**Post date:** [March 29, 2022, 1:02pm UTC](https://community.freefem.org/t/pc-failed-due-to-factor-outmemory/1593/11 "2022-03-29T13:02:03Z")

</div>

Hello, what is the cause of this?

> – Square mesh : nb vertices =4225 , nb triangles = 8192 , nb boundary edges 256  
> — partition of unity built (in 4.049999e-05)  
> — global numbering created (in 1.829900e-03)  
> — global CSR created (in 3.854000e-04)  
> — global numbering created (in 3.106000e-04)  
> — global CSR created (in 7.018900e-03)  
> — system solved with PETSc (in 1.927317e-01)  
> — global numbering created (in 4.037000e-04)  
> — global CSR created (in 6.861900e-03)  
> (nan,nan) != (nan,nan) diff (nan,nan) =\> Sorry error in Optimization (e) add: int2d(Th,optimize=0)(…)  
> remark if you add (… , optimize=2) then you remove this check (be careful);  
> current line = 63 mpirank 0 / 1  
> Exec error : In Optimized version  
> – number :1  
> Exec error : In Optimized version  
> – number :1

---

<div class="post-metadata">

**Author:** ![prj](https://avatars.discourse-cdn.com/v4/letter/p/ecae2f/32.png) [@prj](https://community.freefem.org/u/prj)\
**Post date:** [March 29, 2022, 6:44pm UTC](https://community.freefem.org/t/pc-failed-due-to-factor-outmemory/1593/12 "2022-03-29T18:44:52Z")

</div>

Something is wrong in your `varf` line 63.
