- Thank you received: 24
Pickling Segmentation Fault/ Inconsistent behaviour
4 years 4 months ago #2988
by hvwahl
Pickling Segmentation Fault/ Inconsistent behaviour was created 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).
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).
Attachments:
4 years 4 months ago #2989
by hvwahl
Replied by hvwahl on topic Pickling Segmentation Fault/ Inconsistent behaviour
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
Is there a better way to copy the mesh?
Best wishes,
Henry
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
4 years 4 months ago #2990
by matthiash
Replied by matthiash on topic Pickling Segmentation Fault/ Inconsistent behaviour
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
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
4 years 4 months ago #2991
by hvwahl
Replied by hvwahl on topic Pickling Segmentation Fault/ Inconsistent behaviour
Hi Matthias,
thank for the quick reply and fix !
Best wishes,
Henry
thank for the quick reply and fix !
Best wishes,
Henry
Time to create page: 0.111 seconds