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

parallel problem: merging a list

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 1 Post By wyldckat
  • 1 Post By dogukanteber

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 28, 2015, 06:51
Default parallel problem: merging a list
  #1
Senior Member
 
Freedom
Join Date: May 2014
Posts: 209
Rep Power: 12
wenxu is on a distinguished road
Hello, everyone.

Could anyone give me some hints how to gather statistics from different processors? e.g. the first two numbers of the list are calculated on processor 0, the second two numbers of the list are calculated on processor 1, etc. In other words, we have 8 cells of a computational domain and split the domain into 4 partitions.

processor 0: 8 (1 1 0 0 0 0 0 0);
processor 1: 8 (0 0 2 2 0 0 0 0);
processor 2: 8 (0 0 0 0 3 3 0 0);
processor 3: 8 (0 0 0 0 0 0 4 4);

Then how can I gather the list from all processors like: 8 (1 1 2 2 3 3 4 4)?

Any suggestion is appreciated! Thank you in advance!

regards,
wenxu
wenxu is offline   Reply With Quote

Old   March 1, 2015, 04:05
Default
  #2
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Greetings wenxu,

There's a test for that! Seriously, there is a test application in OpenFOAM's source code for merging lists from parallel processors, in the folder: "test/parallel" - you can see the path to this folder by running:
Code:
echo $FOAM_APP/test/parallel
Best regards,
Bruno
jherb likes this.
__________________
wyldckat is offline   Reply With Quote

Old   August 28, 2022, 11:28
Default
  #3
New Member
 
Doğukan Teber
Join Date: Jul 2022
Location: Izmir, Türkiye
Posts: 13
Rep Power: 3
dogukanteber is on a distinguished road
Probably the problem is solved but for anyone who encounters the same problem in the future:

Code:
#include "PstreamReduceOps.H"
reduce(data, sumOp<labelList>());
Hope this helps

dogukanteber
dlahaye likes this.

Last edited by dogukanteber; August 28, 2022 at 14:32.
dogukanteber is offline   Reply With Quote

Reply


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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem running OpenFOAM 2.2.x in parallel in Centos 5 lvalvare OpenFOAM Running, Solving & CFD 33 December 9, 2020 08:44
[swak4Foam] swak4foam building problem GGerber OpenFOAM Community Contributions 54 April 24, 2015 16:02
CFX parallel hp MPI problem fluidmechanics CFX 5 June 19, 2013 19:05
problem in the CFX12.1 parallel computation BalanceChen ANSYS 2 July 7, 2011 10:26
parallel mode - small problem? co2 FLUENT 2 June 1, 2004 23:47


All times are GMT -4. The time now is 15:12.