Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initialize SimulatorAccess object for compositing material models. #673

Merged

Conversation

bangerth
Copy link
Contributor

This fixes the fact that compositing material models (specifically the depth dependent
and averaging material models) held pointers to base models that may need to access
the simulator, but never initialized these base models' pointers to the Simulator
object. This patch fixes this by intercepting the initializing call.

@bangerth
Copy link
Contributor Author

Let's give @Shangxin-Liu a chance to comment whether this works for him before merging.

@Shangxin-Liu
Copy link
Contributor

I've put the change to the public version of ASPECT on our cluster @bangerth. The compilation has passed. However, when I make the compositing material model test with the depth-dependent and simple compressible model, the segmentation fault still appears:

[hs002:03064] *** Process received signal ***
[hs002:03064] Signal: Segmentation fault (11)
[hs002:03064] Signal code: Address not mapped (1)
[hs002:03064] Failing at address: 0x40
[hs002:03064] [ 0] /lib64/libpthread.so.0(+0xf500) [0x7fe0f31dd500]
[hs002:03064] [ 1] /home/shangxin/aspect_public/build/aspect(_ZNK6aspect15SimulatorAccessILi3EE20get_surface_pressureEv+0x4) [0x87a6a4]
[hs002:03064] [ 2] /home/shangxin/aspect_public/build/aspect(_ZNK6aspect13MaterialModel18SimpleCompressibleILi3EE8evaluateERKNS0_19MaterialModelInputsILi3EEERNS0_20MaterialModelOutputsILi3EEE+0xcd) [0x8cf46d]
[hs002:03064] [ 3] /home/shangxin/aspect_public/build/aspect(_ZNK6aspect13MaterialModel14DepthDependentILi3EE8evaluateERKNS0_19MaterialModelInputsILi3EEERNS0_20MaterialModelOutputsILi3EEE+0x24) [0x8dcfe4]
[hs002:03064] [ 4] /home/shangxin/aspect_public/build/aspect(_ZN6aspect19AdiabaticConditions14InitialProfileILi3EE10initializeEv+0x48b) [0x6db66b]
[hs002:03064] [ 5] /home/shangxin/aspect_public/build/aspect(_ZN6aspect9SimulatorILi3EEC2EP19ompi_communicator_tRN6dealii16ParameterHandlerE+0x19d1) [0x82d991]
[hs002:03064] [ 6] /home/shangxin/aspect_public/build/aspect(main+0x468) [0x6d77e8]
[hs002:03064] [ 7] /lib64/libc.so.6(__libc_start_main+0xfd) [0x7fe0f2e5acdd]
[hs002:03064] [ 8] /home/shangxin/aspect_public/build/aspect() [0x6d0d99]

[hs002:03064] *** End of error message ***

@bangerth
Copy link
Contributor Author

OK. I'll investigate tomorrow.

@Shangxin-Liu
Copy link
Contributor

Thanks. If you need my prm file to make the tests on your cluster, I can send you my depth-dependent viscosity file.

@bangerth
Copy link
Contributor Author

Yes, either send it to me or copy it here.

This fixes the fact that compositing material models (specifically the depth dependent
and averaging material models) held pointers to base models that may need to access
the simulator, but never initialized these base models' pointers to the Simulator
object. This patch fixes this by intercepting the initializing call.
@bangerth bangerth force-pushed the fix-uninitialized-SimulatorAccess branch from b9a0909 to 68ac161 Compare November 25, 2015 19:31
* a section added to the manual on how to use these parameters to
* <li> Fixed: Whenever the base models used by either the "depth dependent"
* or "averaging" material models depended on anything that requires accessing
* the simulator, then this led segmentation faults. This is now fixed.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"led to"?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Wolfgang and Timo,

The segmentation fault problem has been solved. Thanks!

Shangxin
On Nov 25, 2015 9:14 PM, "Timo Heister" notifications@github.com wrote:

In doc/modules/changes.h
#673 (comment):

@@ -6,9 +6,15 @@
*
*

    1. - \*
    2. New: The tolerance of the preconditioners of the A and S block - \* are now available as parameters in the prm file. There is now also - \* a section added to the manual on how to use these parameters to - \*
    3. Fixed: Whenever the base models used by either the "depth dependent" - \* or "averaging" material models depended on anything that requires accessing - \* the simulator, then this led segmentation faults. This is now fixed.

"led to"?


Reply to this email directly or view it on GitHub
https://github.com/geodynamics/aspect/pull/673/files#r45938530.

@tjhei
Copy link
Member

tjhei commented Nov 26, 2015

looks good, please merge yourself after fixing the typo.

Also fix a lot of lines with trailing whitespace.
@bangerth bangerth force-pushed the fix-uninitialized-SimulatorAccess branch from 68ac161 to e2dfff0 Compare November 26, 2015 02:13
bangerth added a commit that referenced this pull request Nov 26, 2015
Initialize SimulatorAccess object for compositing material models.
@bangerth bangerth merged commit 99161bd into geodynamics:master Nov 26, 2015
@bangerth bangerth deleted the fix-uninitialized-SimulatorAccess branch November 26, 2015 02:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants