Parcel parallel and myProcNo problem
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 |
Briefly, how to gather all of the parcels from different processors to a single parcel List in Solver?
regards, Xu |
|
myProcNo problem
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 |
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 |
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.
|
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 |
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> > > >]': |
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 |
Thank you for your suggestions, Bruno. I messed up with quoting text and code tags.
Code:
List<IDLList<coalParcel> > gatheredParcel(Pstream::nProcs());
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 |
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 |
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 |
All times are GMT -4. The time now is 07:00. |