|
[Sponsors] |
New Application halts without error in parallel run |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
April 20, 2016, 10:58 |
Solved: New Application halts without error in parallel run
|
#1 |
New Member
P. Silkeit
Join Date: Jun 2015
Posts: 6
Rep Power: 10 |
Dear FOAMers,
I'm working on an apllication which utilizes the values of a scalarField interpolated to the faces and the area of the faces of a faceZone to calculate a scalar value at an observer point at an artificial time step which is stored in a scalarListList. The application runs fine on a single core and produces the correct results, when the calculation is performed in parallel the application stalls without aborting or an error message when the calculation is performed for the first time. After some research into the matter i think the parallelization does not work automatically since i am not working with the usual fields. The search lead me to try the following approach to write out the data ( i think the calculation runs fine in parallel aswell but its a processor comunication problem but thats just a guess...) Code:
// The important variable scalarListList stuff // the stuff i want to calculate stuff = scalarListList( number of observers); forAll(observers,obsI) { //artificially calculated timesteps stuff[obsI]=scalarList( number of artificial time steps ) } // The calculation of the variable forAll(observerPoints,pointI) { forAll(zoneFaces,faceI) { stuff[pointI][artificialTimeI]= calculation dependent on pointI and faceI; // the correct artificialTimeI is found in side the above calculation } } // attempt to gather and write the variable List<List< List<scalar> >> gatheredStuff(Pstream::nProcs()); gatheredStuff[Pstream::myProcNo()] = stuff; Pstream::gatherList(gatheredStuff); // Only the master proc should write out the accumulated data if (Pstream::master()) { if(runTime.write()) { mkDir(runTime.path()/"Results"); fileName outputFile("Results.TXT"); OFstream os(runTime.path()/"Results"/outputFile); os << "Observer Points Test " << endl; forAll(artificialTimeSteps, stepI) { os << timeSteps[stepI]; os << "\t"; forAll(observerPoints,pointI) { os << gatheredStuff[pointI][stepI]; os << "\t"; } os << endl; } } } Any input, suggestion or help giving me a hint why this freezes and how to prevent this is highly appreciated. Best regards, Patrick Last edited by psilkeit; April 26, 2016 at 10:36. Reason: Solved |
|
Tags |
parallel, parallel code |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
problem during mpi in server: expected Scalar, found on line 0 the word 'nan' | muth | OpenFOAM Running, Solving & CFD | 3 | August 27, 2018 04:18 |
Some questions about a multi region case run in parallel | zfaraday | OpenFOAM Running, Solving & CFD | 5 | February 23, 2017 10:25 |
Case running in serial, but Parallel run gives error | atmcfd | OpenFOAM Running, Solving & CFD | 18 | March 26, 2016 12:40 |
Can not run OpenFOAM in parallel in clusters, help! | ripperjack | OpenFOAM Running, Solving & CFD | 5 | May 6, 2014 15:25 |
parallel Grief: BoundaryFields ok in single CPU but NOT in Parallel | JR22 | OpenFOAM Running, Solving & CFD | 2 | April 19, 2013 16:49 |