CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Running, Solving & CFD

Using #codeStream to set initial field for parallel run

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   June 23, 2012, 21:47
Default Using #codeStream to set initial field for parallel run
  #1
Senior Member
 
Hisham's Avatar
 
Hisham El Safti
Join Date: Apr 2011
Location: Braunschweig, Germany
Posts: 247
Blog Entries: 10
Rep Power: 8
Hisham is on a distinguished road
Dear Foamers

I use the #codeStream feature to set up an initial field. This works fine for running on a single core. However, after decomposing the case it does not work in parallel and gives an error that has nothing to do with the field in question. It actually took me all day to figure out that removing the #codeStream fixed the case.

So can anyone kindly confirm whether it is possible or not to use #codeStream to set initial fields for parallel runs?

Best regards,
Hisham El Safti
Hisham is offline   Reply With Quote

Old   June 24, 2012, 04:18
Default
  #2
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,915
Rep Power: 40
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by Hisham View Post
Dear Foamers

I use the #codeStream feature to set up an initial field. This works fine for running on a single core. However, after decomposing the case it does not work in parallel and gives an error that has nothing to do with the field in question. It actually took me all day to figure out that removing the #codeStream fixed the case.

So can anyone kindly confirm whether it is possible or not to use #codeStream to set initial fields for parallel runs?

Best regards,
Hisham El Safti
Are you sure that your initialization routine is correctly parallelized? For instance if you have local variables then chances are good that you might need some strategically place reduce-operations.
gschaider is offline   Reply With Quote

Old   June 25, 2012, 06:51
Default
  #3
Senior Member
 
Hisham's Avatar
 
Hisham El Safti
Join Date: Apr 2011
Location: Braunschweig, Germany
Posts: 247
Blog Entries: 10
Rep Power: 8
Hisham is on a distinguished road
Hello Bernhard,

Actually I think your remark definitely points what's wrong. I'll try to give more info. I'm developing a solver in which I have an object (derived from a new class) assigned to each cellZone. The objects are contained (in the solver) in a pointer list (the pointers are for a mother class). Each cellZone might have an object from a different child class.

The need for this is that each child class has its own implemented calculations (model). To save the numbers from the time step calculations (to allow for run continuation) an IOField<scalarField>, an IOField<vectorField> and an IOField<symmTensorField> are used to store numerical values (in solver) from the objects and are reread if present. The advantage of this is that not all objects need to save the same number of variables.

So I think maybe there is a lot of traffic between processors ... I really have little ideas about how to reduce this. I would appreciate your advice. I can also email you the solver and a case if you're interested!

Thanks in advance
and best regards
Hisham El Safti
Hisham is offline   Reply With Quote

Old   June 25, 2012, 07:29
Default
  #4
Super Moderator
 
niklas's Avatar
 
Niklas Nordin
Join Date: Mar 2009
Location: Stockholm, Sweden
Posts: 693
Rep Power: 19
niklas will become famous soon enough
what's the error?

in etc/controlDict, is this set?
fileModificationChecking timeStamp;
niklas is offline   Reply With Quote

Old   June 25, 2012, 08:48
Default
  #5
Senior Member
 
Hisham's Avatar
 
Hisham El Safti
Join Date: Apr 2011
Location: Braunschweig, Germany
Posts: 247
Blog Entries: 10
Rep Power: 8
Hisham is on a distinguished road
Hello Niklas

In controlDict:
fileModificationChecking timeStampMaster;

The case runs in serial OK. The error in the parallel run happens in:
Code:
volSymmTensorField strain
(
    IOobject
    (
        "strain",
        runTime.timeName(),
        mesh,
	IOobject::NO_READ,
        IOobject::NO_WRITE
     ),
     0.5*twoSymm(fvc::grad(D))
);
The error is (using 8 cores):
Code:
[6] #0  Foam::error::printStack(Foam::Ostream&)[4] #0  [5] #0  Foam::error::printStack(Foam::Ostream&)Foam::error::printStack(Foam::Ostream&)[2] #0  Foam::error::printStack(Foam::Ostream&)[3] #0  Foam::error::printStack(Foam::Ostream&) in "/opt/openfoam201/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
[2] #1  Foam::sigFpe::sigHandler(int) in "/opt/openfoam201/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
[4] #1  Foam::sigFpe::sigHandler(int) in "/opt/openfoam201/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
[3] #1  Foam::sigFpe::sigHandler(int) in "/opt/openfoam201/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
[2] #2   in "/opt/openfoam201/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
[4] #2   in "/opt/openfoam in "/lib/x86_64-linux-gnu/libc.so.6"
[4] #3   in "/opt/openfoam201/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
[6] #1  Foam::sigFpe::sigHandler(int)201/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
[5] #1   in "/lib/x86_64-linux-gnu/libc.so.6"
[2] #3Foam::sigFpe::sigHandler(int)  Foam::tmp<Foam::GeometricField<Foam::SphericalTensor<double>, Foam::fvPatchField, Foam::volMesh> > Foam::operator*<Foam::SphericalTensor<double>, Foam::fvPatchField, Foam::volMesh>(Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&, Foam::tmp<Foam::GeometricField<Foam::SphericalTensor<double>, Foam::fvPatchField, Foam::volMesh> > const&)Foam::tmp<Foam::GeometricField<Foam::SphericalTensor<double>, Foam::fvPatchField, Foam::volMesh> > Foam::operator*<Foam::SphericalTensor<double>, Foam::fvPatchField, Foam::volMesh>(Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&, Foam::tmp<Foam::GeometricField<Foam::SphericalTensor<double>, Foam::fvPatchField, Foam::volMesh> > const&) in  in "/opt/openfoam201/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
[5] #2   in "/home/hisham/OpenFOAM/hisham-2.0.1/platforms/linux64GccDPOpt/bin/geotechFoam"
[4] #4  "/opt/openfoam201/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
[3] #2   in "/opt/openfoam201/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
[6] #2   in "/lib/x86_64-linux-gnu/libc.so.6"
[3] #3  
 in "/lib/x86_64-linux-gnu/libc.so.6"
[6] #3  [4]  in "/home/hisham/OpenFOAM/hisham-2.0.1/platforms/linux64GccDPOpt/bin/geotechFoam"
[4] #5  __libc_start_mainFoam::tmp<Foam::GeometricField<Foam::SphericalTensor<double>, Foam::fvPatchField, Foam::volMesh> > Foam::operator*<Foam::SphericalTensor<double>, Foam::fvPatchField, Foam::volMesh>(Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&, Foam::tmp<Foam::GeometricField<Foam::SphericalTensor<double>, Foam::fvPatchField, Foam::volMesh> > const&)Foam::tmp<Foam::GeometricField<Foam::SphericalTensor<double>, Foam::fvPatchField, Foam::volMesh> > Foam::operator*<Foam::SphericalTensor<double>, Foam::fvPatchField, Foam::volMesh>(Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&, Foam::tmp<Foam::GeometricField<Foam::SphericalTensor<double>, Foam::fvPatchField, Foam::volMesh> > const&) in "/home/hisham/OpenFOAM/hisham-2.0.1/platforms/linux64GccDPOpt/bin/geotechFoam"
[3] #4   in "/lib/x86_64-linux-gnu/libc.so.6"
[4] #6   in "/home/hisham/OpenFOAM/hisham-2.0.1/platforms/linux64GccDPOpt/bin/geotechFoam"
[2] #4   in "/home/hisham/OpenFOAM/hisham-2.0.1/platforms/linux64GccDPOpt/bin/geotechFoam"
[6] #4  


 in "/lib/x86_64-linux-gnu/libc.so.6"
[5] #3  [3]  in "/home/hisham/OpenFOAM[2]  in "/home/hisham/OpenFOAM/hisham-2.0.1/platforms/linux64GccDPOpt/bin/geotechFoam"
[2] #5  __libc_start_mainFoam::tmp<Foam::GeometricField<Foam::SphericalTensor<double>, Foam::fvPatchField, Foam::volMesh> > Foam::operator*<Foam::SphericalTensor<double>, Foam::fvPatchField, Foam::volMesh>(Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&, Foam::tmp<Foam::GeometricField<Foam::SphericalTensor<double>, Foam::fvPatchField, Foam::volMesh> > const&)[4]  in "/home/hisham/Op/hisham-2.0.1/platforms/linux64GcenFOAM/hisham-2.0.1/platforms/linux64GccDcDPOpt/bin/geotechFoam"
[3] #5  __libc_start_mainPOpt/bin/geotechFoam"
[numubuntu-System-Product-Name:27284] *** Process received signal ***
[numubuntu-System-Product-Name:27284] Signal: Floating point exception (8)
[numubuntu-System-Product-Name:27284] Signal code:  (-6)
[numubuntu-System-Product-Name:27284] Failing at address: 0x3e900006a94
[numubuntu-System-Product-Name:27284] [ 0] /lib/x86_64-linux-gnu/libc.so.6(+0x33d80) [0x7f943d10bd80]
[numubuntu-System-Product-Name:27284] [ 1] /lib/x86_64-linux-gnu/libc.so.6(gsignal+0x35) [0x7f943d10bd05]
[numubuntu-System-Product-Name:27284] [ 2] /lib/x86_64-linux-gnu/libc.so.6(+0x33d80) [0x7f943d10bd80]
[numubuntu-System-Product-Name:27284] [ 3] geotechFoam(_ZN4FoammlINS_15SphericalTensorIdEENS_12fvPatchFieldENS_7volMeshEEENS_3tmpINS_14GeometricFieldIT_T0_T1_EEEERKNS6_IdS8_S9_EERKSB_+0x321) [0x4b4db1]
[numubuntu-System-Product-Name:27284] [ 4] geotechFoam() [0x44c6e9]
[numubuntu-System-Product-Name:27284] [ 5] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xff) [0x7f943d0f6eff]
[numubuntu-System-Product-Name:27284] [ 6] geotechFoam() [0x429bb9]
[numubuntu-System-Product-Name:27284] *** End of error message ***
--------------------------------------------------------------------------
mpirun noticed that process rank 4 with PID 27284 on node numubuntu-System-Product-Name exited on signal 8 (Floating point exception).
--------------------------------------------------------------------------
Hisham
Hisham is offline   Reply With Quote

Old   June 25, 2012, 09:18
Default
  #6
Super Moderator
 
niklas's Avatar
 
Niklas Nordin
Join Date: Mar 2009
Location: Stockholm, Sweden
Posts: 693
Rep Power: 19
niklas will become famous soon enough
what happens when you switch to using timeStamp instead of timeStampMaster?
niklas is offline   Reply With Quote

Old   June 25, 2012, 09:39
Default
  #7
Super Moderator
 
niklas's Avatar
 
Niklas Nordin
Join Date: Mar 2009
Location: Stockholm, Sweden
Posts: 693
Rep Power: 19
niklas will become famous soon enough
does this work? (it should)
volSymmTensorField strain = 0.5*twoSymm(fvc::grad(D));

the only problem I can think of is that you're trying to register all processor-meshes on the same
timeName()/mesh database.
niklas is offline   Reply With Quote

Old   June 25, 2012, 09:48
Default
  #8
Senior Member
 
Hisham's Avatar
 
Hisham El Safti
Join Date: Apr 2011
Location: Braunschweig, Germany
Posts: 247
Blog Entries: 10
Rep Power: 8
Hisham is on a distinguished road
I will check that now. But it is worth mentioning that there is a timeVaryingMapped BC that is distributed to several processors. I found here that this could be a problem (actually the case has ran without the codeFixed (using the timeVaryMap BC) but I had to modify the mesh and afterwards it didn't work ... Further modifications of the mesh does not help!
Hisham is offline   Reply With Quote

Reply

Tags
codestream, initial, parallel

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Moving mesh Niklas Wikstrom (Wikstrom) OpenFOAM Running, Solving & CFD 122 June 15, 2014 06:20
Floating point exception error Alan OpenFOAM Running, Solving & CFD 10 April 6, 2012 14:02
alphaEqn.H in twoPhaseEulerFoam cheng1988sjtu OpenFOAM Bugs 14 September 18, 2011 13:46
Upgraded from Karmic Koala 9.10 to Lucid Lynx10.04.3 bookie56 OpenFOAM Installation 8 August 13, 2011 04:03
Error log vw.cfd OpenFOAM 6 August 7, 2009 05:44


All times are GMT -4. The time now is 01:49.