|
[Sponsors] |
Can I modify runTimeWrite() to output results into one folder? |
![]() |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
![]() |
![]() |
#1 |
Member
Ovie Doro
Join Date: Jul 2009
Posts: 99
Rep Power: 17 ![]() |
Hi,
I am running computations on a cluster using over 100 processors. However, my computations always get terminated because I exceed the number of files permitted in the work directory as the computation results are duplicated over all the processors with new set of files created for each output time step. My question: is there anyway I can configure runTimeWrite() to write the results for each particular variable at each time step into the same file? What I mean is, instead of having a folder for each time step, is it possible to have one folder (say results) with one file for each output variable where the results at each time step is written into that same file but separated by white space or any delimiter of choice? Or is there some other way to get around this? Thanks. |
|
![]() |
![]() |
![]() |
![]() |
#2 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 ![]() ![]() ![]() ![]() ![]() ![]() |
Greetings Ovie,
There is a variable in the controlDict file that controls the removal of previous times: Code:
purgeWrite 0; ![]() Additionally, you might want to increase the value for writeInterval, but I guess you've already tried that. Best regards, Bruno
__________________
|
|
![]() |
![]() |
![]() |
![]() |
#3 |
Member
Ovie Doro
Join Date: Jul 2009
Posts: 99
Rep Power: 17 ![]() |
Thanks Bruno.
I am aware of the different write options available in controlDict. However I was hoping I could modify the write() function in regIOobject so I can write just ONE GIANT FILE for each variable and then transfer to a directory or cluster where I dont have file size/number restrictions for post processing. In any case, I have looked at the code and its pretty daunting to pull this off. I would stick to the purgeWrite option and write the last few time steps. Hopefully I would be able to make meaningful animations out of the results. Thanks for your reply. |
|
![]() |
![]() |
![]() |
![]() |
#4 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 ![]() ![]() ![]() ![]() ![]() ![]() |
Hi Ovie,
Sorry about that. I should have paid more attention to what you wrote. Is FUSE (Filesystem in Userspace) an option in the cluster? You would mount a single file to be used as a file system. This would allow you to keep everything in a single file, while still using a normal OpenFOAM... although the cluster quota management system might see the very same FUSE layer and interpret the same file limit issue. There is also a possible solution of using an Embedded File System, but it's not very practical either. But if you do wish to use this, I believe that looking here (regIOobjectWrite) would be a good starting point for figuring out how to do a quick replacement of the normal system for the Embedded system. But, if I were in your shoes, I would simply aim for finding a good place to launch a shell script from within the solver (somewhere close or inside "runTime.write()"), and do so only on the first processor ($FOAM_APP/test/parallel is a good reference for knowing who's the first processor). The shell script would then take care of doing some grunt work and package the most recent time snapshot from all processors into a single tar file and remove that time snapshot after that - the option for compression would be actived in controlDict and not in the tar filling part. When the simulation would be complete, you would get the case folder back into your personal system and then unpack all tar files in a single blow, in such a manner that the files would all go into the desired places on their own ![]() The downside to this method is that you might hit the file limit nonetheless after a while. But for that you could run a timed script that would pull files from the cluster every once in a while. If you still want to make each variable to be stuffed into a single file, that will require some serious overhauling of the way OpenFOAM handles each file. Best regards, Bruno
__________________
|
|
![]() |
![]() |
![]() |
![]() |
#5 | ||
Member
Ovie Doro
Join Date: Jul 2009
Posts: 99
Rep Power: 17 ![]() |
Greetings Bruno,
Quote:
![]() Your ideas really sound fascinating and well thought out. Most of the suggestions are completely new to me though (like the FUSE and Embedded File System options.) In any case, there are too many restrictions regarding user installed software on the cluster so I dont fancy my chances very much with those options if they are not already available. In any case I would try to confirm the possibility of using either. Quote:
Thanks for your responses.. |
|||
![]() |
![]() |
![]() |
![]() |
#6 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 ![]() ![]() ![]() ![]() ![]() ![]() |
Hi Ovie,
Yes, for FUSE, you'll have to ask your cluster administrator to know if such is or can be installed. After that, if I'm not mistaken, you can build your own FUSE based system (wikipedia link). But the simplest way would be to mount a file that is formatted into ext2/3 or zfs or whichever filesystem you desire (example on how to do this). The file space would be contained to that single sized file, for example 500MB, but would allow you to stuff in as much as it can fit. As for the Embedded File System, it's a library that you would have to build yourself and then change OpenFOAM's code to plug it to the new library. A bunch of OpenFOAM's core code would need to be changed, but this way the new modified OpenFOAM would always work with a single file for each case ![]() As for the quickest implementation (aside from the FUSE/mount one), what I have in mind is:
![]() ![]() Either one of these solutions are enticing to implement, but time is of the essence. Good luck! Keep us posted. If you have any questions, feel free to ask! Best regards, Bruno
__________________
|
|
![]() |
![]() |
![]() |
![]() |
#7 |
Member
Ovie Doro
Join Date: Jul 2009
Posts: 99
Rep Power: 17 ![]() |
Waoo!!...
![]() You are very kind indeed! Thanks so much for the help. But right now I am grappling with validating results from my phase change simulation for which I am to make a presentation in a few days. I would take a look at your very detailed work steps afterwards. But be sure that this dude is very thankful for your help. NB Just on the side (and please dont bother if you dont have to) do you have any ideas on how to implement 1-D simulations in OpenFOAM? I mean, does it make sense to solve the pEqn.H for 1-D simulations? I am trying to simulate 1-D stefan problems and I cant get my mind around solving continuity in 1-D. Just asking. Thanks again.. |
|
![]() |
![]() |
![]() |
![]() |
#8 | |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 ![]() ![]() ![]() ![]() ![]() ![]() |
Hi Ovie,
You're welcome ![]() ![]() ![]() Quote:
Good luck! Best regards, Bruno
__________________
|
||
![]() |
![]() |
![]() |
![]() |
#9 |
Senior Member
David Gaden
Join Date: Apr 2009
Location: Winnipeg, Canada
Posts: 437
Rep Power: 22 ![]() |
If you are comfortable writing OpenFOAM classes, you could write a class that extends regIOobject, and give it all your output fields as member variables. For its writeData() function, you can open a file in constant named after the time name, and use writeData() for each of the fields to this file. Lastly, set purgeWrite to 1, as you don't need the duplicate output going to case/timeName.
Just an idea. |
|
![]() |
![]() |
![]() |
![]() |
#10 | ||
Member
Ovie Doro
Join Date: Jul 2009
Posts: 99
Rep Power: 17 ![]() |
Quote:
Quote:
Thanks guys for the responses.. |
|||
![]() |
![]() |
![]() |
![]() |
#11 | |
Senior Member
David Gaden
Join Date: Apr 2009
Location: Winnipeg, Canada
Posts: 437
Rep Power: 22 ![]() |
Quote:
I envision changing the way the solver stores its data. Rather than creating global scale fields (e.g. volScalarField, volVectorField) in createFields.H, you create your custom object ioDataCompressor (or whatever you want to name it). e.g.: Code:
ioDataCompressor myData(runTime, mesh); Then instead of Code:
solve(fvm::ddt(U) + ...) Code:
solver(fvm::ddt(myData.U()) + ...) Code:
ofStream( fileName ); os << "// U field" << endl; U.writeData(os); os << "// p field" << endl; p.writeData(os); os << "// T field" << endl; T.writeData(os); I don't know what you intend to do with the data once it's done. If you are outputting it in this manner, you will have all the data, but the standard post-processors won't work. You'd either have to write some mini application that unloads the data to what the post processors expect, or use your own data processing strategy, such as MATLAB scripts or something like that. |
||
![]() |
![]() |
![]() |
![]() |
#12 |
Senior Member
David Gaden
Join Date: Apr 2009
Location: Winnipeg, Canada
Posts: 437
Rep Power: 22 ![]() |
It might be easier to have some function that copies all your case/timeName directories into a zip file and deletes them periodically.
|
|
![]() |
![]() |
![]() |
![]() |
#13 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 ![]() ![]() ![]() ![]() ![]() ![]() |
Greetings to all!
I'm reviving this thread simply to do a somewhat important update for future users reading this thread: There is no need to modify the solver itself for running scripts whenever a time snapshot is saved! Simply read this wiki page I just recently added to openfoamwiki.net: Tip Function Object systemCall This will allow you to do system calls to shell scripts at the instances described in the wiki page. Additionally, this is something already built-in OpenFOAM and not documented well enough, although I haven't tracked down when it was added... Best regards, Bruno
__________________
|
|
![]() |
![]() |
![]() |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Different Results from Fluent 5.5 and Fluent 6.0 | Rajeev Kumar Singh | FLUENT | 6 | December 19, 2010 12:33 |
Output transient file to csv | Ben | CFX | 3 | September 23, 2008 09:17 |
CFX-5.7 MPICH Parallel Problem (Output of Results) | James Date | CFX | 7 | February 15, 2005 17:03 |
Help with DPM UDF for OUTPUT needed | Zhengcai Ye | FLUENT | 0 | January 5, 2004 17:58 |
Automating Fluent Results output | Rajil Saraswat | FLUENT | 7 | May 21, 2003 03:35 |