# PETSc Error in Poroelastic Simulation with PyLith 4.2.0

**URL:** <https://community.geodynamics.org/t/petsc-error-in-poroelastic-simulation-with-pylith-4-2-0/4219>\
**Category:** PyLith\
**Created:** [July 17, 2025, 1:48pm UTC](https://community.geodynamics.org/t/petsc-error-in-poroelastic-simulation-with-pylith-4-2-0/4219 "2025-07-17T13:48:02Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![yangxiao](https://yyz2.discourse-cdn.com/flex036/user_avatar/community.geodynamics.org/yangxiao/32/2323_2.png) [@yangxiao](https://community.geodynamics.org/u/yangxiao)\
**Post date:** [July 17, 2025, 1:48pm UTC](https://community.geodynamics.org/t/petsc-error-in-poroelastic-simulation-with-pylith-4-2-0/4219/1 "2025-07-17T13:48:02Z")

</div>

Dear Baagaard,

I hope this message finds you well.

I am currently running a poroelastic simulation using PyLith 4.2.0. The input model file is approximately 38 MB in size. However, the simulation fails at the beginning of the time stepping and produces the following PETSc error:  
[0]PETSC ERROR: Argument out of range  
[0]PETSC ERROR: 2147483818 is too big for PetscInt, you may need to ./configure using --with-64-bit-indices.  
Could you please advise why this error occurs and how I can resolve it?  
For reference, here is the full error message:

> > /public1/home/a8s000279/pylith-4.2.0-linux-x86\_64/lib/python3.12/site-packages/pylith/problems/TimeDependent.py:132:run  
> > – timedependent(info)  
> > – Solving problem.  
> > 0 TS dt 1742. time 0.  
> > [0]PETSC ERROR: --------------------- Error Message --------------------------------------------------------------  
> > [0]PETSC ERROR: Argument out of range  
> > [0]PETSC ERROR: 2147483818 is too big for PetscInt, you may need to ./configure using --with-64-bit-indices  
> > [0]PETSC ERROR: WARNING! There are unused option(s) set! Could be the program crashed before usage or a spelling mistake, etc!  
> > …  
> > Fatal error. Calling MPI\_Abort() to abort PyLith application.  
> > …  
> > RuntimeError: Error detected while in PETSc function.  
> > Thank you very much for your time and assistance.  
> > Best regards,  
> > Xiaoyang

---

<div class="post-metadata">

**Author:** ![baagaard](https://yyz2.discourse-cdn.com/flex036/user_avatar/community.geodynamics.org/baagaard/32/615_2.png) [@baagaard](https://community.geodynamics.org/u/baagaard)\
**Post date:** [July 17, 2025, 2:40pm UTC](https://community.geodynamics.org/t/petsc-error-in-poroelastic-simulation-with-pylith-4-2-0/4219/2 "2025-07-17T14:40:41Z")

</div>

It would help if you could provide more information, including the entire output after `Solving problem`.

Are you running in serial or parallel? How many cells and vertices are in the input mesh? Does the same problem (all parameters exactly the same) run with a coarser mesh?

---

<div class="post-metadata">

**Author:** ![yangxiao](https://yyz2.discourse-cdn.com/flex036/user_avatar/community.geodynamics.org/yangxiao/32/2323_2.png) [@yangxiao](https://community.geodynamics.org/u/yangxiao)\
**Post date:** [July 17, 2025, 4:43pm UTC](https://community.geodynamics.org/t/petsc-error-in-poroelastic-simulation-with-pylith-4-2-0/4219/3 "2025-07-17T16:43:09Z")

</div>

All the files I used are included in the attachments below. As the model requires a relatively precise stress distribution on the fault, further simplification may not be feasible. The file named error.txt contains the error message I encountered; I would be very grateful if you could kindly take a look at it.The model file exceeds 10 MB, so the upload was unsuccessful.  
[file.zip](https://community.geodynamics.org/uploads/short-url/aMkjmQ9LgWz2wJBTNW4gkOJH8Kf.zip) (35.6 KB)

---

<div class="post-metadata">

**Author:** ![baagaard](https://yyz2.discourse-cdn.com/flex036/user_avatar/community.geodynamics.org/baagaard/32/615_2.png) [@baagaard](https://community.geodynamics.org/u/baagaard)\
**Post date:** [July 17, 2025, 4:51pm UTC](https://community.geodynamics.org/t/petsc-error-in-poroelastic-simulation-with-pylith-4-2-0/4219/4 "2025-07-17T16:51:31Z")

</div>

The PETSc stack trace indicates the error is coming during preallocation of the sparse matrix. This could mean the 64-bit indices are needed or there is some other problem.

Are you running in serial or parallel? How many cells and vertices are in the input mesh?

I am not suggesting that you simplify the mesh or problem for your final run, but checking if a coarse mesh produces the same error can help identify source of the error. For example, if a much coarser mesh produces the same error, then the error is probably related to problem setup. If the coarse mesh does _not_ produce the same error, then it could be related to the mesh or the size of the mesh.

---

<div class="post-metadata">

**Author:** ![yangxiao](https://yyz2.discourse-cdn.com/flex036/user_avatar/community.geodynamics.org/yangxiao/32/2323_2.png) [@yangxiao](https://community.geodynamics.org/u/yangxiao)\
**Post date:** [July 17, 2025, 5:35pm UTC](https://community.geodynamics.org/t/petsc-error-in-poroelastic-simulation-with-pylith-4-2-0/4219/5 "2025-07-17T17:35:42Z")

</div>

At the moment, I am using single-core serial computation, as my previous attempts at running the model in parallel resulted in no error messages, but the computation did not progress.The computation shows a total of 249,899 vertices (nodes) and 1,369,327 cells (elements), distributed across 21 mesh blocks.

---

<div class="post-metadata">

**Author:** ![baagaard](https://yyz2.discourse-cdn.com/flex036/user_avatar/community.geodynamics.org/baagaard/32/615_2.png) [@baagaard](https://community.geodynamics.org/u/baagaard)\
**Post date:** [July 17, 2025, 5:58pm UTC](https://community.geodynamics.org/t/petsc-error-in-poroelastic-simulation-with-pylith-4-2-0/4219/6 "2025-07-17T17:58:56Z")

</div>

I noticed that this a simulation with poroelasticity and faults. We worked on better solver settings for this case at the PyLith hackathon last month. For the solver settings to work, they require an updated version of PETSc. I will try to find time next week to finalize those updates and put together a bugfix release.

In the meantime, the only workarounds I know are to remove the faults or use a much coarser mesh.

---

<div class="post-metadata">

**Author:** ![yangxiao](https://yyz2.discourse-cdn.com/flex036/user_avatar/community.geodynamics.org/yangxiao/32/2323_2.png) [@yangxiao](https://community.geodynamics.org/u/yangxiao)\
**Post date:** [July 17, 2025, 6:02pm UTC](https://community.geodynamics.org/t/petsc-error-in-poroelastic-simulation-with-pylith-4-2-0/4219/7 "2025-07-17T18:02:42Z")

</div>

Thank you very much for your kind assistance and prompt response. I sincerely look forward to your further updates.

---

<div class="post-metadata">

**Author:** ![yangxiao](https://yyz2.discourse-cdn.com/flex036/user_avatar/community.geodynamics.org/yangxiao/32/2323_2.png) [@yangxiao](https://community.geodynamics.org/u/yangxiao)\
**Post date:** [August 17, 2025, 3:33pm UTC](https://community.geodynamics.org/t/petsc-error-in-poroelastic-simulation-with-pylith-4-2-0/4219/8 "2025-08-17T15:33:14Z")

</div>

**Dear baagaard,**

Over the past two weeks, I have attempted various adjustments, but unfortunately the same error still remains. I was therefore wondering whether the forthcoming version of your program might help resolve the simulations of poroelastic models requiring large storage space. My sincere apologies for troubling you once again, but may I kindly ask when you expect to release the updated version? We are very much looking forward to your update.

Wishing you continued success, and thank you once again for your kind support.

Best regards,  
Xiaoyang

---

<div class="post-metadata">

**Author:** ![baagaard](https://yyz2.discourse-cdn.com/flex036/user_avatar/community.geodynamics.org/baagaard/32/615_2.png) [@baagaard](https://community.geodynamics.org/u/baagaard)\
**Post date:** [August 17, 2025, 10:44pm UTC](https://community.geodynamics.org/t/petsc-error-in-poroelastic-simulation-with-pylith-4-2-0/4219/9 "2025-08-17T22:44:04Z")

</div>

I am finalizing the bugfix release and anticipate getting it out this week. If everything goes smoothly, I hope to have the release files posted on Wednesday.

---

<div class="post-metadata">

**Author:** ![yangxiao](https://yyz2.discourse-cdn.com/flex036/user_avatar/community.geodynamics.org/yangxiao/32/2323_2.png) [@yangxiao](https://community.geodynamics.org/u/yangxiao)\
**Post date:** [August 18, 2025, 3:00am UTC](https://community.geodynamics.org/t/petsc-error-in-poroelastic-simulation-with-pylith-4-2-0/4219/10 "2025-08-18T03:00:06Z")

</div>

Thank you very much for your reply! I look forward to the new release and wish you all the best！

---

<div class="post-metadata">

**Author:** ![baagaard](https://yyz2.discourse-cdn.com/flex036/user_avatar/community.geodynamics.org/baagaard/32/615_2.png) [@baagaard](https://community.geodynamics.org/u/baagaard)\
**Post date:** [August 22, 2025, 5:47pm UTC](https://community.geodynamics.org/t/petsc-error-in-poroelastic-simulation-with-pylith-4-2-0/4219/11 "2025-08-22T17:47:47Z")

</div>

We have fixed the solver specification issues for poroelasticity with a fault in PyLith v4.2.1.

---

<div class="post-metadata">

**Author:** ![yangxiao](https://yyz2.discourse-cdn.com/flex036/user_avatar/community.geodynamics.org/yangxiao/32/2323_2.png) [@yangxiao](https://community.geodynamics.org/u/yangxiao)\
**Post date:** [August 25, 2025, 1:16pm UTC](https://community.geodynamics.org/t/petsc-error-in-poroelastic-simulation-with-pylith-4-2-0/4219/13 "2025-08-25T13:16:07Z")

</div>

Thank you very much for your update and reminder! I have tried many further tests since then, and I found that when using parallel computation, the memory-related errors no longer occur, and for a model size of 13 MB, the calculation converges very quickly. However, when I use a finer mesh (e.g., a model size of 35 MB), the computation takes a very long time, constantly showing:

```auto
>> /public1/home/a8s000279/pylith-4.2.1-linux-x86_64/lib/python3.12/site-packages/pylith/problems/TimeDependent.py:132:run
 -- timedependent(info)
 -- Solving problem.
0 TS dt 1742. time 0.
    0 SNES Function norm 2.235523221572e-05

```

I am not sure whether the calculation has entered a deadlock bug or is still running slowly, so I would like to consult you about this situation. In addition, when I include fault surface analysis in the 13 MB model and change `solution = pylith.problems.SolnDispPresTracStrainVelPdotTdot` to `solution = pylith.problems.SolnDispPresTracStrainVelPdotTdotLagrange`, the same issue occurs. I am uncertain whether the computation is still running normally in these two cases.

---

<div class="post-metadata">

**Author:** ![baagaard](https://yyz2.discourse-cdn.com/flex036/user_avatar/community.geodynamics.org/baagaard/32/615_2.png) [@baagaard](https://community.geodynamics.org/u/baagaard)\
**Post date:** [August 25, 2025, 2:23pm UTC](https://community.geodynamics.org/t/petsc-error-in-poroelastic-simulation-with-pylith-4-2-0/4219/14 "2025-08-25T14:23:51Z")

</div>

There are several important notes regarding the solver settings in

> **[PETSc Options — PyLith 4.2.1 documentation](https://pylith.readthedocs.io/en/v4.2.1/user/run-pylith/petsc-options.html#solver-options)**

When running in parallel, the current variable point block Jacobi preconditioner will be very poor if the fault is aligned with the split in the domain among processes. We try to avoid this by penalizing this behavior in the partitioner, but that does not always prevent this behavior. This will be resolved in the v5.0.0 release when we build the cohesive cells in parallel. The current workaround is to run in serial.

Start by running the simulation with the finer mesh in serial without state variables. Does the solution converge in a reasonable amount of time?

---

<div class="post-metadata">

**Author:** ![yangxiao](https://yyz2.discourse-cdn.com/flex036/user_avatar/community.geodynamics.org/yangxiao/32/2323_2.png) [@yangxiao](https://community.geodynamics.org/u/yangxiao)\
**Post date:** [August 25, 2025, 3:28pm UTC](https://community.geodynamics.org/t/petsc-error-in-poroelastic-simulation-with-pylith-4-2-0/4219/15 "2025-08-25T15:28:27Z")

</div>

Thank you very much for your help. I just checked, and although the computation was very slow, it has already completed. I will continue to try simulations that include the fault surface.If run in serial, large models may directly cause segmentation faults or the errors I mentioned above.

---

<div class="post-metadata">

**Author:** ![baagaard](https://yyz2.discourse-cdn.com/flex036/user_avatar/community.geodynamics.org/baagaard/32/615_2.png) [@baagaard](https://community.geodynamics.org/u/baagaard)\
**Post date:** [August 25, 2025, 3:42pm UTC](https://community.geodynamics.org/t/petsc-error-in-poroelastic-simulation-with-pylith-4-2-0/4219/16 "2025-08-25T15:42:15Z")

</div>

Do the large models result in segmentation faults or other errors with PyLith v4.2.1?

---

<div class="post-metadata">

**Author:** ![yangxiao](https://yyz2.discourse-cdn.com/flex036/user_avatar/community.geodynamics.org/yangxiao/32/2323_2.png) [@yangxiao](https://community.geodynamics.org/u/yangxiao)\
**Post date:** [August 25, 2025, 5:00pm UTC](https://community.geodynamics.org/t/petsc-error-in-poroelastic-simulation-with-pylith-4-2-0/4219/17 "2025-08-25T17:00:36Z")

</div>

Yes, I suspect that the error may be caused by the fact that a single CPU core in my system cannot handle such a large memory requirement, but I am not entirely sure since I currently do not have access to another computational server for comparison. Additionally, I would like to ask you about an issue in my configuration file: after adding

[pylithapp.petsc]

# Turn on TS, KSP, and SNES monitors

ts\_monitor = True  
ksp\_monitor = True  
snes\_monitor = True  
ksp\_converged\_reason = True  
snes\_converged\_reason = True

# Trigger error if linear or nonlinear solvers fail to converge

ts\_error\_if\_step\_fails = True  
ksp\_error\_if\_not\_converged = True  
snes\_error\_if\_not\_converged = True

the simulation fails to run. Even if I only keep `ts_monitor = True`, the error still occurs. I would like to know how I can estimate the computation time for a single run. The error messages I receive include:

[0]PETSC ERROR: --------------------- Error Message --------------------------------------------------------------  
[0]PETSC ERROR: No support for this operation for this object type  
[0]PETSC ERROR: Unsupported viewer True  
[0]PETSC ERROR: WARNING! There are unused option(s) set! Could be the program crashed before usage or a spelling mistake, etc!  
[0]PETSC ERROR: Option left: name:-fieldsplit\_displacement\_ksp\_type value: gmres source: code  
[0]PETSC ERROR: Option left: name:-fieldsplit\_displacement\_pc\_type value: ml source: code  
[0]PETSC ERROR: Option left: name:-fieldsplit\_pressure\_pc\_type value: bjacobi source: code

---

<div class="post-metadata">

**Author:** ![baagaard](https://yyz2.discourse-cdn.com/flex036/user_avatar/community.geodynamics.org/baagaard/32/615_2.png) [@baagaard](https://community.geodynamics.org/u/baagaard)\
**Post date:** [August 25, 2025, 5:37pm UTC](https://community.geodynamics.org/t/petsc-error-in-poroelastic-simulation-with-pylith-4-2-0/4219/18 "2025-08-25T17:37:49Z")

</div>

The interface to the PETsc option `ts_monitor` has changed. Setting `ts_monitor=` (without `True`) is the new way to enable it.

Note: All of these monitors should be turned on by default except `ksp_monitor`.

---

<div class="post-metadata">

**Author:** ![yangxiao](https://yyz2.discourse-cdn.com/flex036/user_avatar/community.geodynamics.org/yangxiao/32/2323_2.png) [@yangxiao](https://community.geodynamics.org/u/yangxiao)\
**Post date:** [August 25, 2025, 5:44pm UTC](https://community.geodynamics.org/t/petsc-error-in-poroelastic-simulation-with-pylith-4-2-0/4219/20 "2025-08-25T17:44:38Z")

</div>

Thank you very much for your kind help. By the same token, would the others also be in the form of `ksp_monitor =` and `snes_monitor =`?

---

<div class="post-metadata">

**Author:** ![baagaard](https://yyz2.discourse-cdn.com/flex036/user_avatar/community.geodynamics.org/baagaard/32/615_2.png) [@baagaard](https://community.geodynamics.org/u/baagaard)\
**Post date:** [August 25, 2025, 5:59pm UTC](https://community.geodynamics.org/t/petsc-error-in-poroelastic-simulation-with-pylith-4-2-0/4219/21 "2025-08-25T17:59:14Z")

</div>

Yes, the new interface has been standardized across all three monitors (ts, snes, and ksp).

---

<div class="post-metadata">

**Author:** ![yangxiao](https://yyz2.discourse-cdn.com/flex036/user_avatar/community.geodynamics.org/yangxiao/32/2323_2.png) [@yangxiao](https://community.geodynamics.org/u/yangxiao)\
**Post date:** [August 26, 2025, 1:05am UTC](https://community.geodynamics.org/t/petsc-error-in-poroelastic-simulation-with-pylith-4-2-0/4219/22 "2025-08-26T01:05:06Z")

</div>

Thank you very much once again for your generous help！

[Next page](https://community.geodynamics.org/t/petsc-error-in-poroelastic-simulation-with-pylith-4-2-0/4219.md?page=2)
