CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Programming & Development

Read parallel meshes

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

Reply
 
LinkBack Thread Tools Display Modes
Old   March 4, 2014, 05:44
Default Read parallel meshes
  #1
Member
 
Join Date: May 2012
Location: Dresden, Germany
Posts: 32
Rep Power: 5
dl6tud is on a distinguished road
I would like to read the meshes of all processors when computing in parallel. The idea is to have all meshes on each processor.

I create a "Time-Object" for each processor as

Quote:
PtrList<Time> time(Pstream::nProcs());

forAll(time, procI)
{
time.set
(
procI,
new Time
(
Time::controlDictName,
args.rootPath(),
args.globalCaseName()/fileName(word("processor") + name(procI))
)
);
}
Then, I create the meshes with
Quote:
PtrList<fvMesh> pMesh(Pstream::nProcs());
forAll(pMesh, procI)
{
pMesh.set
(
procI,
new fvMesh
(
IOobject
(
Foam::fvMesh::defaultRegion,
time[procI].timeName(),
time[procI],
IOobject::MUST_READ
)
)
);
}
The second step fails with

Quote:
Message from processor 0 not fully consumed. messageSize:20620 bytes of which only 0 consumed.
At the moment I have no idea, why OF tries to communicate with the other processors when reading the meshes. Maybe for the boundaries?
dl6tud is offline   Reply With Quote

Old   March 5, 2014, 14:04
Default
  #2
ngj
Senior Member
 
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Rotterdam, The Netherlands
Posts: 1,595
Rep Power: 24
ngj will become famous soon enoughngj will become famous soon enough
Hi,

Yes, the processor boundaries exchange information, so what you are trying to do will most probably not work.

May I ask, why you need all the meshes on every processor?

Kind regards,

Niels
__________________
Please note that I do not use the Friend-feature, so do not be offended, if I do not accept a request.
ngj is offline   Reply With Quote

Old   March 7, 2014, 04:45
Default
  #3
Member
 
Join Date: Jul 2011
Posts: 33
Rep Power: 6
A_Pete is on a distinguished road
Hi,

what about using gather and scatter? Not sure what you exactly want to do with the mesh, but you could use gatherList.

Code:
//- Get local mesh on processor
fvMesh mesh(refCast<const fvMesh>(obr_));

//- Gather the meshes into PtrList on master processor
PtrList<fvMesh> pMesh(Pstream::nProcs());
pMesh[Pstream::myProcNo()] = mesh;
Pstream::gatherList(pMesh);
Depending on what you want to do afterwards, you could either use scatterList or put the mesh together again from the pMesh and then scatter just this fvMesh.
A_Pete is offline   Reply With Quote

Reply

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
how to calculate mass flow rate on patches and summation of that during the run? immortality OpenFOAM Post-Processing 82 November 25, 2014 14:16
Case running in serial, but Parallel run gives error atmcfd OpenFOAM Running, Solving & CFD 10 November 24, 2013 07:35
How to setup a simple OpenFOAM cluster? TommiPLaiho OpenFOAM Installation 3 October 27, 2013 16:15
Creating large meshes (>10,000,00) in parallel fontania OpenFOAM Meshing & Mesh Conversion 4 April 16, 2012 16:14
Fluent parallel poovanna FLUENT 0 March 24, 2007 00:22


All times are GMT -4. The time now is 16:45.