|
[Sponsors] |
April 24, 2015, 20:49 |
Parcel parallel and myProcNo problem
|
#1 | |
Senior Member
Freedom
Join Date: May 2014
Posts: 209
Rep Power: 12 |
Dear Foamers,
Now I have a problem about parallel, could anyone be so kind to help me? I want to statistic the particle's velocity in solver with parallel. However, it seems that the solver is calculated only with master processor. That's means the parcels are distributed at different processors but only some of them on the master processor. So how can I gather all of the parcels from different processors and statistics them? For example: Quote:
Could anyone give me some hints? Thank you very much! Best regards, Wen Xu |
||
April 24, 2015, 22:15 |
|
#2 |
Senior Member
Freedom
Join Date: May 2014
Posts: 209
Rep Power: 12 |
Briefly, how to gather all of the parcels from different processors to a single parcel List in Solver?
regards, Xu |
|
April 25, 2015, 21:09 |
|
#3 |
Senior Member
Freedom
Join Date: May 2014
Posts: 209
Rep Power: 12 |
||
April 25, 2015, 21:38 |
myProcNo problem
|
#4 |
Senior Member
Freedom
Join Date: May 2014
Posts: 209
Rep Power: 12 |
Dear Foamers,
Why the output of UPstream::myProcNo() is always equal to zero even if I use 4 processors? I assume the output should be 0,1,2 then 3, then recycle this list. Anyone can give me some hints? Thank you in advance! Regards, Wen Xu |
|
April 26, 2015, 14:12 |
|
#5 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128 |
Quick answer: Have a look into the source code folder "applications/test/parallel".
In addition, see this post: http://www.cfd-online.com/Forums/ope...tml#post378825 - post #2 |
|
April 28, 2015, 13:03 |
|
#6 |
Senior Member
Joachim Herb
Join Date: Sep 2010
Posts: 650
Rep Power: 21 |
If you use Info<< to print out the processor number it is only printed on the first processor. Use cout<< to print it on all processors.
|
|
April 28, 2015, 21:26 |
|
#7 | ||||
Senior Member
Freedom
Join Date: May 2014
Posts: 209
Rep Power: 12 |
Thank you both Bruno and Joachim. You really help me a lot!
I have look into the test case in /application/test/parallel and already know a little about parallel. Pout can print out the Inter-processor communications, so use "Pout<<" is a good choice to print the details of the processors communications. I follow this method and print out the parcels number in every processor, the code like this: Quote:
Quote:
Both Quote:
Quote:
Thank you again! Regards, Wen Xu |
|||||
April 28, 2015, 22:16 |
|
#8 |
Senior Member
Freedom
Join Date: May 2014
Posts: 209
Rep Power: 12 |
The error output like this:
Code:
/opt/openfoam230/src/OpenFOAM/lnInclude/INew.H: In member function 'Foam::autoPtr<T> Foam::INew<T>::operator()(Foam::Istream&) const [with T = Foam::ReactingMultiphaseParcel<Foam::ReactingParcel<Foam::ThermoParcel<Foam::KinematicParcel<Foam::particle> > > >]': /opt/openfoam230/src/OpenFOAM/lnInclude/ILListIO.C:58:21: instantiated from 'void Foam::ILList<LListBase, T>::read(Foam::Istream&, const INew&) [with INew = Foam::INew<Foam::ReactingMultiphaseParcel<Foam::ReactingParcel<Foam::ThermoParcel<Foam::KinematicParcel<Foam::particle> > > > >, LListBase = Foam::DLListBase, T = Foam::ReactingMultiphaseParcel<Foam::ReactingParcel<Foam::ThermoParcel<Foam::KinematicParcel<Foam::particle> > > >]' /opt/openfoam230/src/OpenFOAM/lnInclude/ILListIO.C:151:5: instantiated from 'Foam::Istream& Foam::operator>>(Foam::Istream&, Foam::ILList<LListBase, T>&) [with LListBase = Foam::DLListBase, T = Foam::ReactingMultiphaseParcel<Foam::ReactingParcel<Foam::ThermoParcel<Foam::KinematicParcel<Foam::particle> > > >]' /opt/openfoam230/src/OpenFOAM/lnInclude/gatherScatterList.C:103:17: instantiated from 'static void Foam::Pstream::gatherList(const Foam::List<Foam::UPstream::commsStruct>&, Foam::List<T>&, int, Foam::label) [with T = Foam::IDLList<Foam::ReactingMultiphaseParcel<Foam::ReactingParcel<Foam::ThermoParcel<Foam::KinematicParcel<Foam::particle> > > > >, Foam::label = int]' /opt/openfoam230/src/OpenFOAM/lnInclude/gatherScatterList.C:197:9: instantiated from 'static void Foam::Pstream::gatherList(Foam::List<T>&, int, Foam::label) [with T = Foam::IDLList<Foam::ReactingMultiphaseParcel<Foam::ReactingParcel<Foam::ThermoParcel<Foam::KinematicParcel<Foam::particle> > > > >, Foam::label = int]' ParticleStatistics.H:19:39: instantiated from here /opt/openfoam230/src/OpenFOAM/lnInclude/INew.H:62:25: error: 'New' is not a member of 'Foam::ReactingMultiphaseParcel<Foam::ReactingParcel<Foam::ThermoParcel<Foam::KinematicParcel<Foam::particle> > > >' /opt/openfoam230/src/OpenFOAM/lnInclude/INew.H:63:5: warning: control reaches end of non-void function [-Wreturn-type] make: *** [Make/linuxGccDPOpt/coalChemistryFoam.o] Error 1 Last edited by wyldckat; May 3, 2015 at 13:16. Reason: Changed [QUOTE][/QUOTE] to [CODE][/CODE] |
|
May 3, 2015, 13:40 |
|
#9 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128 |
Greetings to all!
@Wen Xu: Before I forget to mention this, for posting code and output here on the forum, you can find instructions here: Posting code and output with [CODE] As for the problem you are dealing with right out, I need more details:
Bruno
__________________
|
|
May 3, 2015, 20:51 |
|
#10 | |||
Senior Member
Freedom
Join Date: May 2014
Posts: 209
Rep Power: 12 |
Thank you for your suggestions, Bruno. I messed up with quoting text and code tags.
Code:
List<IDLList<coalParcel> > gatheredParcel(Pstream::nProcs()); gatheredParcel[Pstream::myProcNo()] = coalParcels; Pstream::gatherList(gatheredParcel);
Now, after have answered your questions, I think whether we can get the parcels' velocity and positions in every processor and write them out with a subList, then we can link these subList together? Thank you in advance! Best regards, Wen Xu |
||||
September 21, 2015, 15:43 |
|
#11 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128 |
Greetings Wen Xu,
Sorry for the late reply. I've had these questions on my to-do list for quite sometime now and only today did I finally manage to take a look into this. Besides the thread you found: http://www.cfd-online.com/Forums/ope...rocessors.html - I also found this one: http://www.cfd-online.com/Forums/ope...ion-array.html The first problem that I could figure out from one of your posts is that the list you're trying to transfer doesn't have the necessary hook-ups needed for the gather method to work. The main one missing is the "New" method, which means that each particle would be re-created on each processor. The second problem is that it seems to be a lot easier if you gather the data you need from each particle onto an independent list and then gather all of the lists. For example, gather the masses of all particles into a scalar list and then place that scalar list in another list for each processor. Then do the same for the other properties. Either way, I don't know if you've solved this problem since then. Best regards, Bruno
__________________
|
|
September 21, 2015, 21:19 |
|
#12 |
Senior Member
Freedom
Join Date: May 2014
Posts: 209
Rep Power: 12 |
Dear Bruno,
I do not solve the problem directly, but I implement this use another method---I implement a post-processing solver to statistics the particles. That means after the simulation finished, I use this solver the gather the particle properties into one scalar list for every write out time. The I statistics the gathered List of the particles. But I believe there is a convenient method to do this at run time. Thank you for you very kind help. Many thanks! Best regards, Wen |
|
|
|