|
[Sponsors] |
February 24, 2019, 04:21 |
Why my program cannot ran in parallel???
|
#1 |
Member
Dongxu Wang
Join Date: Sep 2018
Location: China
Posts: 33
Rep Power: 8 |
Hi FOAMers,
I am doing some modifications on interFOAM, OpenFOAM v6. It is something about the dynamic mesh and I have changed the functions "pimple.loop()" to another one which is developed by myself. My new program runs good with the single core but will crash if I run it parallel. Here is the error information: Code:
[1] --> FOAM FATAL IO ERROR: [1] incorrect first token, expected '(', found on line 0 the punctuation token ':' [1] [1] file: IOstream at line 0. [1] [1] From function Foam::Istream& Foam::operator>>(Foam::Istream&, Foam::List<T>&) [with T = Foam::Field<Foam::Vector<double> >] [1] in file /home/wdx/OpenFOAM-6/src/OpenFOAM/lnInclude/ListIO.C at line 131. [1] FOAM parallel run exiting Code:
[1] --> FOAM FATAL IO ERROR: [1] incorrect first token, expected <int> or '(', found on line 0 the word 'g' [1] [1] file: IOstream at line 0. [1] [1] From function Foam::Istream& Foam::operator>>(Foam::Istream&, Foam::List<T>&) [with T = Foam::Field<Foam::Vector<double> >] [1] in file /home/wdx/OpenFOAM-6/src/OpenFOAM/lnInclude/ListIO.C at line 148. [1] FOAM parallel run exiting [1] [32] [32] [32] --> FOAM FATAL IO ERROR: [32] error in IOstream "IOstream" for operation operator>>(Istream&, List<T>&) : reading first token [32] [32] file: IOstream at line 0. [32] [32] From function void Foam::IOstream::fatalCheck(const char*) const [32] in file db/IOstreams/IOstreams/IOstream.C at line 109. [32] FOAM parallel run exiting [32] [8] [8] [8] --> FOAM FATAL IO ERROR: [8] error in IOstream "IOstream" for operation operator>>(Istream&, List<T>&) : reading first token [8] [8] file: IOstream at line 0. [8] [8] From function void Foam::IOstream::fatalCheck(const char*) const [8] in file db/IOstreams/IOstreams/IOstream.C at line 109. [8] FOAM parallel run exiting Code:
scalarField sumPhi ( fvc::surfaceSum(mag(phi))().primitiveField() ); I don't know much about the parallel running, but I am very confused why this happens? Could anyone give me some suggestions? Thanks a lot! WDX Last edited by wdx_cfd; February 24, 2019 at 22:36. |
|
February 24, 2019, 16:51 |
|
#2 | |
Senior Member
Andrew Somorjai
Join Date: May 2013
Posts: 175
Rep Power: 13 |
Quote:
Code:
scalarField sumPhi ( fvc::surfaceSum(mag(phi))().primitiveField() ); |
||
February 24, 2019, 20:42 |
|
#3 | |
Member
Dongxu Wang
Join Date: Sep 2018
Location: China
Posts: 33
Rep Power: 8 |
Quote:
Thank you for your reply. The entire code is a little bit complicated because I modified both the solver and the sixDof module. So updating the entire code is not an easy thing... I think the problem is due to my newly added criterion for the pimple outer loop. Once the pimple outer loop is stopped by it, the program will crash (when parallel running). I'll continue to find out the reason why this error occurs. |
||
June 27, 2019, 06:49 |
|
#4 | |
Member
Hosein
Join Date: Nov 2011
Location: Germany
Posts: 94
Rep Power: 15 |
Quote:
I doubt that the problem would be because of "CourantNo.H". Cause interFoam already works perfectly fine in parallel . To pinpoint the real trouble you might switch to run in debug mode. Moreover, a basic understanding of how MPI works and how OF manages it is needed(at the very least, in case you want to remedy this on your own). |
||
April 14, 2023, 00:15 |
|
#5 | |
New Member
Lin Xiangfeng
Join Date: Dec 2016
Posts: 11
Rep Power: 10 |
Quote:
|
||
April 14, 2023, 04:56 |
|
#6 | |
Senior Member
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,715
Rep Power: 40 |
Quote:
Examples, Code:
// Exit when there are more than N cells with excess temperature volScalarField T = ....; while (....) { label nTooHot = 0; forAll(T, celli) { if (T[celli] > 1000) ++nTooHot; } if (nTooHot > 20) { Pout<< "Have " << nTooHot << " cells exceeding temperature" << nl; break; } } There are several remedies, depending on which logic you actually intend. For example, Code:
// Break on overall value. label nTooHot = ...; // summation loop as before // make into a global reduce(nTooHot, sumOp<label>()); if (nTooHot > 20) { break; } // This is frequently used, so there is a convenient wrapper. label nTooHot = ...; // summation loop as before if (returnReduce(nTooHot, sumOp<label>()) > 20) { break; } Code:
// Break on local logic label nTooHot = ...; // summation loop as before bool needToStop = (nTooHot > 20); // a) if (returnReduce(needToStop, orOp<bool>())) break; // b) if (returnReduce((nTooHot > 20), orOp<bool>())) break; // c) reduce(needToStop, orOp<bool>()); if (needToStop) { break; } // Using OpenFOAM 2212 if (returnReduceOr(nTooHot > 20)) { break; } |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Run Mode:Platform MPI Local Parallel core problem | mztcu | CFX | 0 | October 13, 2016 04:14 |
[snappyHexMesh] Error while running SnappyHex in parallel | mg.mithun | OpenFOAM Meshing & Mesh Conversion | 1 | February 10, 2016 14:13 |
[mesh manipulation] Importing Multiple Meshes | thomasnwalshiii | OpenFOAM Meshing & Mesh Conversion | 18 | December 19, 2015 19:57 |
Explicitly filtered LES | saeedi | Main CFD Forum | 16 | October 14, 2015 12:58 |
Update boundary conditions calculated by an external program | CedricVH | OpenFOAM | 2 | January 15, 2010 12:55 |