|
[Sponsors] |
Segmentation Fault when using class based on KinematicParcel in parallel |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
August 13, 2008, 16:34 |
Version: 1.5
How to reprodu
|
#1 |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Version: 1.5
How to reproduce: Using the rhoTurbTwinParcelFoam and the simplifiedSiwek-case. Decompose the case for 8 processors. The run fails at the first timestep with a segmentation fault: [7] #6 Foam:stream& Foam::operator<<>(Foam:stream&, Foam::KinematicParcel<foam::basicthermoparcel> const&) at ~/OpenFOAM/OpenFOAM-1.5-debug/src/lagrangian/intermediate/lnInclude/KinematicPar celIO.C:218 The problem seems to be the line there reinterpret_cast<const>(p.typeId()), because typeID() is the only accessor-method in KinematicParcel that doesn't have a return-reference variant. So propably that cast trys to access the address of the returned temporary value (and the memory following it) Possible fixes: 1. Quick and dirty: replace that line with reinterpret_cast<const>(&p.typeId_) 2. Add a reference-variant for typeId() and do it like Thermo & ReactingParcel: reinterpret_cast<const>( &const_cast<kinematicparcel<parceltype>&>(p).typeI d() ),
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request |
|
August 18, 2008, 07:18 |
Thanks - we put it in.
|
#2 |
Senior Member
Mattijs Janssens
Join Date: Mar 2009
Posts: 1,419
Rep Power: 26 |
Thanks - we put it in.
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Segmentation fault with parallel computing | Prad | Main CFD Forum | 0 | December 11, 2008 08:44 |
Segmentation fault. | Nari | Siemens | 3 | November 8, 2007 06:04 |
Segmentation fault | billy | OpenFOAM Installation | 20 | April 23, 2007 23:57 |
Segmentation Fault | Victor | Main CFD Forum | 5 | April 5, 2005 09:09 |
Fluent parallel: segmentation fault? | hp | FLUENT | 2 | September 6, 2001 15:18 |