Run a simple 3D strike slip model using Pylith 5, met conversion problem

Hi there,

I construct a strike slip 3D viscoelastic model (with elastic crust and viscoelastic model, relaxation time about 11 yr), with 30km thick crust and applied a uniform slip on the fault interface (only in the crust). I originally run it on Pylith 4 for 2000yr of simulation time and it runs well and I got ground surface displacement as expected. Later, I figured that Pylith 5 may perform better in parallelization computation and I tried to use Pylith 5 (binary code) to rerun this model to check if Pylith 5 works as expected. But I found the simulation stop at the 64 steps and shows errors like:
65 TS dt 0.15 time 9.25

**0 SNES Function norm 5.302845345018e-04**

  **Linear solve converged due to CONVERGED_ATOL iterations 25**

**1 SNES Function norm 2.851916728773e-09**

  **Linear solve did not converge due to DIVERGED_DTOL iterations 0**

[0]PETSC ERROR: --------------------- Error Message --------------------------------------------------------------

[0]PETSC ERROR: KSPSolve() has not converged, reason DIVERGED_DTOL

[0]PETSC ERROR: See FAQ — PETSc 3.25.2 documentation for trouble shooting.

[0]PETSC ERROR: PETSc Development Git Revision: v3.25.2-216-g1c60be80d13 Git Date: 2026-06-05 21:49:36 +0000

[0]PETSC ERROR: /Users/qingjun/Software/pylith-5.0.1-macOS-12.0-arm64/bin/mpinemesis with 1 MPI process(es) and PETSC_ARCH on QingjundeMac-mini.local by qingjun Sat Jun 20 13:09:26 2026

[0]PETSC ERROR: Configure options: --prefix=/Users/baagaard/scratch/build/clang-17.0/cig/pylith-binary-arm64/dist --with-c2html=0 --with-x=0 --with-clanguage=C --with-mpicompilers=1 --with-shared-libraries=1 --with-64-bit-points=1 --with-large-file-io=1 --with-hdf5-include=/Users/baagaard/scratch/build/clang-17.0/cig/pylith-binary-arm64/dist/include --with-hdf5-lib=“-L/Users/baagaard/scratch/build/clang-17.0/cig/pylith-binary-arm64/dist/lib -lhdf5_hl -lhdf5” --download-parmetis=1 --download-metis=1 --download-f2cblaslapack=1 --download-ml --with-fc=0 --with-hwloc=0 --with-ssl=0 --with-x=0 --with-c2html=0 --with-lgrind=0 --with-hdf5=1 --with-zlib=1 --LIBS=-lz --with-debugging=0 --with-fc=0 CFLAGS=-mmacos-version-min=12.0 CXXFLAGS=“-mmacos-version-min=12.0 -DMPICH_IGNORE_CXX_SEEK” FCFLAGS= CPPFLAGS=“-I/Users/baagaard/scratch/build/clang-17.0/cig/pylith-binary-arm64/dist/include " LDFLAGS=”-L/Users/baagaard/scratch/build/clang-17.0/cig/pylith-binary-arm64/dist/lib -mmacos-version-min=12.0" PETSC_DIR=/Users/baagaard/scratch/build/clang-17.0/cig/pylith-binary-arm64/build/cig/petsc-pylith PETSC_ARCH=arch-pylith

[0]PETSC ERROR: #1 KSPSolve_Private() at /Users/baagaard/scratch/build/clang-17.0/cig/pylith-binary-arm64/build/cig/petsc-pylith/src/ksp/ksp/interface/itfunc.c:1001

[0]PETSC ERROR: #2 KSPSolve() at /Users/baagaard/scratch/build/clang-17.0/cig/pylith-binary-arm64/build/cig/petsc-pylith/src/ksp/ksp/interface/itfunc.c:1094

[0]PETSC ERROR: #3 SNESSolve_NEWTONLS() at /Users/baagaard/scratch/build/clang-17.0/cig/pylith-binary-arm64/build/cig/petsc-pylith/src/snes/impls/ls/ls.c:220

[0]PETSC ERROR: #4 SNESSolve() at /Users/baagaard/scratch/build/clang-17.0/cig/pylith-binary-arm64/build/cig/petsc-pylith/src/snes/interface/snes.c:4892

[0]PETSC ERROR: #5 TSTheta_SNESSolve() at /Users/baagaard/scratch/build/clang-17.0/cig/pylith-binary-arm64/build/cig/petsc-pylith/src/ts/impls/implicit/theta/theta.c:172

[0]PETSC ERROR: #6 TSStep_Theta() at /Users/baagaard/scratch/build/clang-17.0/cig/pylith-binary-arm64/build/cig/petsc-pylith/src/ts/impls/implicit/theta/theta.c:223

[0]PETSC ERROR: #7 TSStep() at /Users/baagaard/scratch/build/clang-17.0/cig/pylith-binary-arm64/build/cig/petsc-pylith/src/ts/interface/ts.c:3599

[0]PETSC ERROR: #8 TSSolve() at /Users/baagaard/scratch/build/clang-17.0/cig/pylith-binary-arm64/build/cig/petsc-pylith/src/ts/interface/ts.c:4262

[0]PETSC ERROR: #9 void pylith::problems::TimeDependent::solve()() at ../../../pylith-5.0.1/libsrc/pylith/problems/TimeDependent.cc:476

Fatal error. Calling MPI_Abort() to abort PyLith application.

Traceback (most recent call last):

File “/Users/qingjun/Software/pylith-5.0.1-macOS-12.0-arm64/lib/python3.12/site-packages/pylith/apps/PetscApplication.py”, line 55, in onComputeNodes

**self.main(\*args, \*\*kwds)**

File “/Users/qingjun/Software/pylith-5.0.1-macOS-12.0-arm64/lib/python3.12/site-packages/pylith/apps/PyLithApp.py”, line 95, in main

**self.problem.run(self)**

File “/Users/qingjun/Software/pylith-5.0.1-macOS-12.0-arm64/lib/python3.12/site-packages/pylith/problems/TimeDependent.py”, line 138, in run

**ModuleTimeDependent.solve(self)**

File “/Users/qingjun/Software/pylith-5.0.1-macOS-12.0-arm64/lib/python3.12/site-packages/pylith/problems/problems.py”, line 217, in solve

**return \_problems.TimeDependent_solve(self)**

       **^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^**

RuntimeError: Error detected while in PETSc function.

C++ traceback (5 frames):

[0] 3 libpylith.0.dylib 0x00000001067432dc _ZN6pylith13ExternalErrorCI1NS_5ErrorEERKNS_12ErrorMessageE + 36

[1] 4 libpylith.0.dylib 0x00000001068a89bc _ZN6pylith8problems13TimeDependent5solveEv + 528

[2] 5 _problems.so 0x00000001063b86ac _ZL25_wrap_TimeDependent_solveP7_objectS0_ + 224

[3] 39 mpinemesis 0x000000010441cb84 main + 616

[4] 40 dyld 0x0000000193348274 start + 2840

Abort(-1) on node 0 (rank 0 in comm 0): application called MPI_Abort(MPI_COMM_WORLD, -1) - process 0

/Users/qingjun/Software/pylith-5.0.1-macOS-12.0-arm64/bin/nemesis: mpiexec: exit 255

/Users/qingjun/Software/pylith-5.0.1-macOS-12.0-arm64/bin/pylith: /Users/qingjun/Software/pylith-5.0.1-macOS-12.0-arm64/bin/nemesis: exit 1

The configure files used in Pylith 5 are slightly changed based on the Pylith 4 version, and the tolerance threshold both set as:
snes_atol = 1.0e-9

snes_rtol = 1.0e-12

ksp_atol = 1.0e-12

ksp_rtol = 1.0e-12

And in Pylith 5 (similar in Pylith 4) I set
[pylithapp.timedependent]

initial_dt = 3.0*year

start_time = -10.0*year

end_time = 2000.0*year

scales.time_scale = 20.0*year

[pylithapp.problem.scales]

length_scale = 10.0*km
Could anybody help me about how to make Pylith 5 simulation converge smoothly?
Thanks in advance!
Qingjun Meng

Are you using a uniform time step or an adaptive time step? Please rerun the v5 simulation, adding the command-line argument --petsc.ksp_monitor_true_residual, capture all output to a log file, and post the log file.

I used a uniform dt=3yr,please find the attached output.txt file. Later, I found when I give a proper length_scale=10km in .cfg file, the simulation converges easily and does not claps again. If not setting the length_scale, I suppose it will use a default value (1*km?) and simulation stops at the 65th step, with the output as attached. It seems the code could be so sensitive to the scale value and I should make it as realistic as possible.

output.txt (362.0 KB)

Thanks,
Qingjun

The default preconditioner for simulations with a fault (variable point-block Jacobi) introduces a relationship between the length scale and the discretization size. As a result, the solver is sensitive to the length scale used in the nondimensionalization. As noted in the PyLith manual on the section of nondimensionalization for elasticity, the length scale should be set to the nominal discretization size. In the examples, we use the discretization size on the fault.