PyLith Hints, Tips, and Tricks
Installation
Issues related to installing PyLith.
Binaries
- Error:
'import site' failed; use -v for traceback --LOTS OF OUTPUT-- TypeError: stat() argument 1 must be encoded string without NULL bytes, not str
We have seen this error on Darwin system running OS X 10.5 and later. Files downloaded from the web are marked with an extra attribute that can prevent python from starting up properly. The best solution in these cases is to download PyLith using command line tools:
mkdir pylith
cd pylith
curl -O http://www.geodynamics.org/cig/software/pylith/pylith-1.6.2-darwin-10.6.8.tgz
tar -zxf pylith-1.6.2-darwin-10.6.8.tgz
Installing from source using the PyLith installer utility
ADD STUFF HERE
Meshing
Issues related to generating a mesh to use as input for PyLith.
Best Practices
- Always check the quality of your mesh BEFORE running a PyLith simulation. The ideal aspect ratio is 1.0.
- LaGriT
Aspect ratios should be greater than about 0.2 in quasi-static simulations and greater than about 0.4 in dynamic simulations. Use the command "quality" to show a summary of the element quality.
- CUBIT
Aspect ratios should be less than about 4.0 in quasi-static simulations and less than about 2.0 in dynamic simulations. Use the "Quality" command to show a summary of the element quality. See the "Mesh Quality Assessment" section of the CUBIT manual for more information about the various quality checks. We find the aspect ratio and condition number checks the most useful. We generally use condition number smoothing to improve the mesh quality.
- LaGriT
- Always check your nodesets/psets to make sure they match the desired boundaries, etc. Nodesets/pets for Dirichlet boundary conditions cannot overlap if they set the same components (i.e., x-component, y-component, z-component), but they can overlap if they set difference components.
CUBIT
- Nonplanar fault geometry
See examples/2d/subduction and Sessions III and IV of the 2011 Crustal Deformation Modeling tutorial.
- Varying discretization size with distance from the fault
See examples/2d/subduction.
LaGriT
- Using surface meshes to identify the fault surface is a development feature that is fragile and untested. Use with extreme caution. Identifying faults using psets is a much more thoroughly tested feature.
General
Errors
- Spatial database:
RuntimeError: Error occurred while reading spatial database file 'FILENAME'. I/O error while reading SimpleDB data.
Make sure the num-locs values in the header matches the number of lines of data and that the last line of data includes an end-of-line character.
Nondimensionalization
It is VERY IMPORTANT to make sure that the scales used in the nondimensionalization are appropriate for your problem. PyLith can solve problems across an extremely wide range of spatial and temporal scales if the appropriate scales are used in the nondimensionalization.
Due to roundoff errors and convergence tolerances in the iterative solvers, PyLith relies on reasonable scales in the solution in constructing the friction criterion and preconditioning the system. Failure to set appropriate scales in the nondimensionalization will cause the solution to be garbage.
- Quasi-static problems:
Default values:: relaxation_time = 1.0*year length_scale = 1.0*km pressure_scale = 3.0e+10*Pa Recommended values: relaxation_time = TIME_STEP length_scale = DISCRETIZATION_SIZE or DISPLACEMENT_MAGNITUDE pressure_scale = SHEAR_MODULUS - Dynamic problems:
Default values: shear_wave_speed = 3.0*km/s density = 3000.0*kg/m**3 wave_period = 1.0*s Recommended values: shear_wave_speed = MINIMUM_SHEAR_WAVE_SPEED density = DENSITY wave_period = MINIMUM_WAVE_PERIOD
Runnning PyLith on a cluster
Issues related to running PyLith on a cluster or other parallel computer.
Submitting to a batch systems
We recommend that you create a pylithapp.cfg file in your $HOME/.pyre/pylithapp directory. This file will automatically be read every time you run PyLith, so all of your PyLith simulations will use the batch parameters. If you do not always submit jobs to the batch system (e.g., sometimes run trivial test jobs on a compute node or the frontend), then name the file something like pylithapp_batch.cfg. However, in this case you must specify this .cfg file on the command line because it will not be read automatically.
PBS/Torque
pylithapp.cfg:
[pylithapp]
scheduler = pbs
[pylithapp.pbs]
shell = /bin/bash
qsub-options = -V -m bea -M johndoe@university.edu
[pylithapp.launcher]
command = mpirun -np ${nodes} -machinefile ${PBS_NODEFILE}
Command line arguments:
--nodes=NUMPROCS --scheduler.ppn=N --job.name=NAME --job.stdout=LOG_FILE
# NPROCS = total number of processes
# N = number of processes per compute node
# NAME = name of job in queue
# LOG_FILE = name of file where stdout will be written
The stdout file will not appear in the working directory until the end of the run. During the run a temporary file exists in the Torque spool directory (e.g., /opt/torque/spool) of the machine with process 0 with the stdout and stderr.
Sun Grid Engine
The Sun Grid Engine can be setup to work seamlessly with OpenMPI, eliminating the need for a hosts file. See the Sun Grid Engine documentation for how to create a Parallel Environment for OpenMPI ORTE. Alternatively you can use other Parallel Environments (i.e., pe-name) but you need to specify additional options for the launcher.
pylithapp.cfg:
[pylithapp]
scheduler = sge
[pylithapp.pbs]
shell = /bin/bash
pe-name = orte
qsub-options = -V -m bea -M johndoe@university.edu -j y
[pylithapp.launcher]
command = mpirun -np ${nodes}
# Use the options below if not using the OpenMPI ORTE Parallel Environment
#command = mpirun -np ${nodes}-machinefile ${PE_HOSTFILE} -n ${NSLOTS}
Command line arguments:
--nodes=NPROCS --job.name=NAME --job.stdout=LOG_FILE
# NPROCS = total number of processes
# NAME = name of job in queue
# LOG_FILE = name of file where stdout will be written
Quasi-static Modeling
Issues related to static or quasi-static modeling. The governing equations do not include intertial terms.
Fault friction (spontaneous rupture)
Convergence issues (diverged line searches, lots of SNES iterations, etc)
Recommended solver settings for quasi-static simulations with fault friction.
Dynamic Modeling
Issues related to dynamic modeling. The governing equations include intertial terms.
Feature Requests
Add your requests for features here following the template provided.
- My feature
Add a brief description of how it would be used and any ideas on user specified parameters, implementation, etc.
- Your feature here
Your description here.
