bash script for pseudo-parallel usage of reconstructPar
1 Attachment(s)
All,
I thought I would post this as maybe someone else will find it useful. I wrote a short script (not necessarily pretty, but it works...) that runs reconstructPar in pseudo-parallel mode by breaking the time directories into a number of ranges and running multiple instances of reconstructPar. For lack of a better name I have called it parReconstructPar. Enjoy. -Kent (The forum won't take a file without an extension so it is uploaded as a .txt -- just save it somewhere in your path as parReconstructPar and make it executable.) |
parallel reconstruction (slightly improved)
All,
Here is an updated version of my bash script for parallel reconstruction with a few minor modifications--it lists the total number of directories remaining to be reconstructed. I suppose it would be relatively simple to also put in an estimate for the time remaining but I think I'll save that for later. parReconstructPar Note that this is geared toward reconstruction of a large number of time directories from a long transient run--if you just want to reconstruct a single time directory this is NOT what you need. Also, it basically assumes you currently have no other reconstructed time directories in your base case directory besides 0. I would love to hear if anyone has found this to be useful. -Kent |
Nice and useful
Works well for me. Thank you for sharing such nice and useful tool. Helps to save some time on multiprocessor machines.
Regards. |
Nice!
Always good to have utilities that make using OpenFOAM more efficient (and that you don't have to study for many days to figure out how to use).
...user interface, when oh when? |
Bugs?
Hi,
I tried to use it with a case I started from time=10 s (to continue it). First reconstructPar job exists with an error. In the end, I have the files that were reconstructed by the 2. and following instances of reconstructPar (so everything from 11.3 s). But the last timeStep (15 s) is missing as well. My fault or does it just work from 0 on? Would like to use it though, so if you would fix that in case it's a bug... Thanks! Bastian |
Well, I guess strictly speaking that is not a bug, just a deficiency of the simplistic method I am using and I mentioned that it assumes you are reconstructing from the smallest time dir in your processor0 directory since it figures out the total number of time directories there and breaks it up into chunks. There is probably an easy fix to generalize this so that you could start the reconstruction from a different value (like t=10s in your case)--I don't know that I have time in the near term (next few weeks) to look at this again, so if someone else wants to run with it and post back that would be awesome.
|
Hhhmm I'm pretty sure that that (10 s) was the smallest dir in my processor0, since I usually delete all processor dirs after reconstructing. And only if i reconstruct I can continue from another time. But I'll have a look again.
Bastian |
1 Attachment(s)
Kent,
thank you very much to your contribution, I found this script very useful for me! Here I attach my bash script, which reconstructs only those case files, which are not reconstructed yet. It is not parallel, but perhaps someone will find it useful for common usage))) |
Thanks to Kent, until now it's working perfectly for me.
|
Thanks a lot, Kent!
It worked nicely for me, using a dual-core with hyperthreading. A thing a little bit surprising though: It counted down nicely from around 1000 timesteps. But the last one before it ended was around 200. This was causing not more than a bit of curiosity, for sure it's not a problem! Thanks for the tool again! |
Hi,
I wonder, if anyone tried to rewrite reconstructPar/Mesh to run in real parallel... foamToEnsight is able to write data and mesh in parallel to a 'serial' file quite quickly, so it should be possible to write direct openfoam data as well!? Did anyone tried this yet? Best REgards Fabian |
Hi Kent,
This works great, only one question, in my case it always run 2 or 3 processors for reconstructing the case, is there some way to change the code and push it to use more processors, or I am doing something wrong there? Best Regards Nikola |
Maybe you have already sorted this out, but I just noticed I never replied to this post. Not sure what is happening. If you run the script name without args you will see that you run it using:
parReconstructPar <number of processors for reconstruction> <name of output file, optional> Is it not using 8 processes if you run the script as: parReconstructPar 8 ? |
Yes I figured it out, in the same way as you have explained in your answer.
Sorry for a late reply. Thanks. |
Hello kent !
I 'm also counter this problem, and Ithink this script is useful to me ! I have download it but I don't know how to run it ? would you mind telling me how to get it work? Thanks ! |
Dear Kent,
Thank you very much for your sharing the file. In my case, I only need to reconstruct one of the variables, so the command is: Code:
reconstructPar -fields '(U)' Code:
appflag="-noZero -fields '(U)'" Thank you. OFFO |
1 Attachment(s)
Dear all,
thank you Kent for this great tool. I picked it up and added some extra features. With this script you can specify the fields to reconstruct and it is possible to specify the timeframe (start,end). The syntax for using slightly differs from the normal reconstructPar but it is explained in the file. Hope somebody finds it useful Hannes |
Thank you, it works very well.
|
Hannes,
Beautiful work! Thanks for your contribution in adding several features that make the script more flexible and that I am sure will be useful to many people. -Kent |
Hello Hannes,
When I have four parallel runs to preform the reconstruct, there only two are running, the other are not. Is this caused by that fact that the my computer memory is not enough to support the reconstruct? |
All times are GMT -4. The time now is 07:13. |