|
[Sponsors] |
bash script for pseudo-parallel usage of reconstructPar |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
May 18, 2009, 14:43 |
bash script for pseudo-parallel usage of reconstructPar
|
#1 |
Senior Member
Kent Wardle
Join Date: Mar 2009
Location: Illinois, USA
Posts: 219
Rep Power: 21 |
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.) |
|
July 22, 2009, 10:42 |
parallel reconstruction (slightly improved)
|
#2 |
Senior Member
Kent Wardle
Join Date: Mar 2009
Location: Illinois, USA
Posts: 219
Rep Power: 21 |
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 |
|
August 15, 2009, 10:55 |
Nice and useful
|
#3 |
Member
Jean-Peer Lorenz
Join Date: Mar 2009
Location: Rostock, Germany
Posts: 33
Rep Power: 17 |
Works well for me. Thank you for sharing such nice and useful tool. Helps to save some time on multiprocessor machines.
Regards. |
|
August 16, 2009, 17:51 |
Nice!
|
#4 |
New Member
Oskar
Join Date: Mar 2009
Location: Finland
Posts: 12
Rep Power: 17 |
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? |
|
November 1, 2009, 14:35 |
Bugs?
|
#5 |
New Member
Join Date: Oct 2009
Posts: 11
Rep Power: 16 |
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 Last edited by Bastian; November 1, 2009 at 15:19. |
|
November 4, 2009, 10:15 |
|
#6 |
Senior Member
Kent Wardle
Join Date: Mar 2009
Location: Illinois, USA
Posts: 219
Rep Power: 21 |
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.
|
|
November 4, 2009, 14:24 |
|
#7 |
New Member
Join Date: Oct 2009
Posts: 11
Rep Power: 16 |
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 |
|
October 18, 2010, 05:03 |
|
#8 |
Senior Member
|
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)))
__________________
Best regards, Dr. Alexander VAKHRUSHEV Christian Doppler Laboratory for "Metallurgical Applications of Magnetohydrodynamics" Simulation and Modelling of Metallurgical Processes Department of Metallurgy University of Leoben http://smmp.unileoben.ac.at |
|
October 18, 2010, 05:44 |
|
#9 |
Member
Join Date: Dec 2009
Posts: 36
Rep Power: 16 |
Thanks to Kent, until now it's working perfectly for me.
|
|
March 24, 2011, 15:39 |
|
#10 |
Senior Member
|
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! |
|
March 26, 2011, 15:13 |
|
#11 |
Senior Member
Fabian Braennstroem
Join Date: Mar 2009
Posts: 407
Rep Power: 19 |
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 |
|
January 31, 2014, 07:51 |
|
#12 |
New Member
Nikola Pilipovic
Join Date: Nov 2013
Posts: 6
Rep Power: 12 |
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 |
|
March 28, 2014, 12:44 |
|
#13 |
Senior Member
Kent Wardle
Join Date: Mar 2009
Location: Illinois, USA
Posts: 219
Rep Power: 21 |
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 ? |
|
April 11, 2014, 18:01 |
|
#14 |
New Member
Nikola Pilipovic
Join Date: Nov 2013
Posts: 6
Rep Power: 12 |
Yes I figured it out, in the same way as you have explained in your answer.
Sorry for a late reply. Thanks. |
|
May 6, 2014, 22:05 |
|
#15 |
Member
Niu
Join Date: Apr 2014
Posts: 55
Rep Power: 12 |
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 ! |
|
August 14, 2014, 14:37 |
|
#16 |
Senior Member
Join Date: Jan 2013
Posts: 372
Rep Power: 14 |
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 |
|
August 15, 2014, 01:39 |
|
#17 |
Member
hannes
Join Date: Mar 2013
Posts: 47
Rep Power: 13 |
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 |
|
August 15, 2014, 06:20 |
|
#18 |
Senior Member
Join Date: Jan 2013
Posts: 372
Rep Power: 14 |
Thank you, it works very well.
|
|
August 15, 2014, 09:56 |
|
#19 |
Senior Member
Kent Wardle
Join Date: Mar 2009
Location: Illinois, USA
Posts: 219
Rep Power: 21 |
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 |
|
August 15, 2014, 16:46 |
|
#20 |
Senior Member
Join Date: Jan 2013
Posts: 372
Rep Power: 14 |
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? |
|
Tags |
parallel processing, reconstructpar |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Running decomposePar / reconstructPar as parallel apps? | carcass | OpenFOAM Running, Solving & CFD | 3 | January 17, 2024 07:19 |
Script to Run Parallel Jobs in Rocks Cluster | asaha | OpenFOAM Running, Solving & CFD | 12 | July 4, 2012 22:51 |
Core usage on CFX parallel processing | alterego | CFX | 6 | December 21, 2011 05:45 |
Swap usage on parallel run | nikhilesh | OpenFOAM Running, Solving & CFD | 0 | April 30, 2009 09:50 |
TASCflow,problem with script and parallel mode | Zbynek Hrncir | CFX | 0 | October 2, 2001 07:30 |