# About Pylith MemoryError

**URL:** <https://community.geodynamics.org/t/about-pylith-memoryerror/499>\
**Category:** PyLith\
**Created:** [March 13, 2019, 5:58pm UTC](https://community.geodynamics.org/t/about-pylith-memoryerror/499 "2019-03-13T17:58:22Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kefu\_He](https://avatars.discourse-cdn.com/v4/letter/k/ad7895/32.png) [@Kefu\_He](https://community.geodynamics.org/u/Kefu_He)\
**Post date:** [March 13, 2019, 5:58pm UTC](https://community.geodynamics.org/t/about-pylith-memoryerror/499/1 "2019-03-13T17:58:22Z")

</div>

I want to know why did I encounter this bug(See attached figure) and how can I fix the problem, so I send this email to you and hope to receive your reply. Thank you very much.  
 ![Screenshot%20from%202019-03-11%2009-32-23](https://canada1.discourse-cdn.com/flex036/uploads/geodynamics/original/1X/19d8bb96c3551fc06c35a5842859ab456e26fe51.png)

---

<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:** [March 13, 2019, 7:03pm UTC](https://community.geodynamics.org/t/about-pylith-memoryerror/499/2 "2019-03-13T19:03:34Z")

</div>

This error suggests there is a problem with the HDF5 file that is being used to generate the corresponding Xdmf file. I suggest using the HDF5 tool `h5dump` to examine the contents of the HDF5 file. If the HDF5 file looks good (metadata and data both look correct), then please upload that file so that we can debug the script that generates the Xdmf file.

We might be able to provide more suggestions if you describe what you are doing, for example:

- What version of the code are you using? Did you build it yourself or are you using the binary? You can get this information using `pylith --version`.
- Have you succeeded in running other simulations with HDF5 output?
- Are you running in parallel? If so, are you running on multiple compute nodes and what sort of filesystem are you writing to?

---

<div class="post-metadata">

**Author:** ![Kefu\_He](https://avatars.discourse-cdn.com/v4/letter/k/ad7895/32.png) [@Kefu\_He](https://community.geodynamics.org/u/Kefu_He)\
**Post date:** [March 14, 2019, 4:07am UTC](https://community.geodynamics.org/t/about-pylith-memoryerror/499/3 "2019-03-14T04:07:12Z")

</div>

Thanks for your reply. My test is about viscoelastic relaxation. I’m using the v 2.2.1 version of the code and the binary. I have succeed in other simulations with HDF5 output. I didn’t run the code in parallel.

The same simulation, when I change **dt = 20.0\*day** , it succeed, but not **dt = 7.0\*year**. The relevant code as follow.  
[pylithapp.problem.formulation.time\_step]  
# Define the total time for the simulation and the time step size.  
total\_time = 20.0_day  
dt = 1.0_day  
The result(succeed) about ground surface displacement h5 file:  
[kfhe@localhost kfwc10034\_2]$ h5dump -H ./output/covisco-groundsurf.h5  
HDF5 “./output/covisco-groundsurf.h5” {  
GROUP “/” {  
GROUP “geometry” {  
DATASET “vertices” {  
DATATYPE H5T\_IEEE\_F64LE  
DATASPACE SIMPLE { ( 9596, 3 ) / ( 9596, 3 ) }  
}  
}  
DATASET “time” {  
DATATYPE H5T\_IEEE\_F64LE  
DATASPACE SIMPLE { ( 21, 1, 1 ) / ( H5S\_UNLIMITED, 1, 1 ) }  
}  
GROUP “topology” {  
DATASET “cells” {  
DATATYPE H5T\_IEEE\_F64LE  
DATASPACE SIMPLE { ( 18770, 3 ) / ( 18770, 3 ) }  
ATTRIBUTE “cell\_dim” {  
DATATYPE H5T\_STD\_I32LE  
DATASPACE SCALAR  
}  
}  
}  
GROUP “vertex\_fields” {  
DATASET “displacement” {  
DATATYPE H5T\_IEEE\_F64LE  
DATASPACE SIMPLE { ( 21, 9596, 3 ) / ( H5S\_UNLIMITED, 9596, 3 ) }  
ATTRIBUTE “vector\_field\_type” {  
DATATYPE H5T\_STRING {  
STRSIZE 7;  
STRPAD H5T\_STR\_NULLTERM;  
CSET H5T\_CSET\_ASCII;  
CTYPE H5T\_C\_S1;  
}  
DATASPACE SCALAR  
}  
}  
}  
}  
}

&  
[pylithapp.problem.formulation.time\_step]  
# Define the total time for the simulation and the time step size.  
total\_time = 7.0_year  
dt = 1.0_day

The result(error) about ground surface displacement h5 file:

```
[kfhe@localhost kfwc10034_2]$ h5dump -H covisco-groundsurf.h5 
HDF5 "covisco-groundsurf.h5" {
GROUP "/" {
   GROUP "geometry" {
      DATASET "vertices" {
         DATATYPE H5T_IEEE_F64LE
         DATASPACE SIMPLE { ( 9596, 3 ) / ( 9596, 3 ) }
      }
   }
   GROUP "topology" {
      DATASET "cells" {
         DATATYPE H5T_IEEE_F64LE
         DATASPACE SIMPLE { ( 18770, 3 ) / ( 18770, 3 ) }
      }
   }
}
}
```

---

<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:** [March 14, 2019, 11:07pm UTC](https://community.geodynamics.org/t/about-pylith-memoryerror/499/4 "2019-03-14T23:07:56Z")

</div>

The ground displacement file that caused a problem doesn’t have any displacements in it. This might happen if there was an error during the simulation. I would carefully check your log file to make sure the solution is converging at every time step. We recommend the PETSc settings that force an error if the linear or nonlinear solvers fail to converge:

```auto
[petsc]
ksp_error_if_not_converged = true
snes_error_if_not_converged = true

```

I would also check to make sure you are not running out of disk space. If you are writing output at every time step, you may want to switch to writing every 5th or 10th time step.

---

<div class="post-metadata">

**Author:** ![Kefu\_He](https://avatars.discourse-cdn.com/v4/letter/k/ad7895/32.png) [@Kefu\_He](https://community.geodynamics.org/u/Kefu_He)\
**Post date:** [March 18, 2019, 7:38am UTC](https://community.geodynamics.org/t/about-pylith-memoryerror/499/5 "2019-03-18T07:38:47Z")

</div>

Thank you very much. The problem which I encountered sure is out of disk space. I modify the output interval as you suggest and the problem disappear.

Thank you once again.
