Pickling Segmentation Fault/ Inconsistent behaviour

More
4 years 4 months ago #2988 by hvwahl
Hi everyone,

to restart a simulation I'm using data pickled in a previous run. To ensure that the meshes are the same, I take a copy of the mesh from a pickled GridFunction. Using this copy a create new FESpace and a new GridFunction into which I copy the data from the pickled GridFunction.

When I try to pickle this new grid function I sometimes get a segmentation fault. Attached is a MWE (run once with 'restart=False' and then with 'True').

Can anyone help me to avoid these segmentation faults?

Best wishes,
Henry

PS: This inconsistency is both on mac an linux, self build on commits gee9a66d1 and gac4d9b1f (NGSolve 2006).
More
4 years 4 months ago #2989 by hvwahl
Update:

The issue seems to stem from the fact that I delete the unpickled GridFunction. I thought this would not be problematic, since I explicitly copy the mesh
Code:
mesh = Mesh(_gfu_pic.space.mesh.ngmesh.Copy())

Is there a better way to copy the mesh?

Best wishes,
Henry
More
4 years 4 months ago #2990 by matthiash
Hi Henry,

Thanks for the report and the update. We are on it and already found the issue (it's about pointers in the netgen::Mesh, which are not correctly set in the copy). The fix will be on master soon.

Best,
Matthias
More
4 years 4 months ago #2991 by hvwahl
Hi Matthias,

thank for the quick reply and fix :) !

Best wishes,
Henry
More
4 years 4 months ago #2995 by matthiash
Fix is online, a new release is in the pipeline.
Best,
Matthias
The following user(s) said Thank You: hvwahl
Time to create page: 0.111 seconds