Suggestion for monitoring a calculation

Miscellaneous discussion topics about Code_Saturne (development, ...)
Post Reply
Claus Andersen

Suggestion for monitoring a calculation

Post by Claus Andersen »

I was wondering if the CS developers had anything planned for monitoring a running calculation within the GUI?

I think a tab under 'prepare batch calculation' or similar would be much much more manageable than what I currently do, which is to

1) Have the listing file open in an editor (kate) and refresh once in awhile.
2) Running 'tail -f listing' in a terminal.
3) Running several terminals with instances of tail + grep to follow values of interest.
4) Plotting probes in 'grace' manually once in awhile.
5) Insert your own fav. method here
 
The listing file layout makes it very convenient to tail + grep for variables, and I think it would be relatively easy (I have to be careful now :) ) to implement a tab with check buttons as to which value to monitor and display them in said tab.

In this particular calculation it is important to monitor the 'derive' of TempC because it is a very good indication of when the calculation is about to go haywire. So tail'ing and grep'ing for "c TempC" gives a nice output to the terminal:

tail -f listing |grep "c  TempC"
c  TempC        0.38462E+00       6   0.56370E-06   0.33516E+00
c  TempC        0.38467E+00       6   0.67851E-06   0.33398E+00
c  TempC        0.38472E+00       6   0.63438E-06   0.32037E+00
c  TempC        0.38477E+00       6   0.74836E-06   0.31588E+00
c  TempC        0.38483E+00       6   0.73776E-06   0.33650E+00
c  TempC        0.38488E+00       6   0.60145E-06   0.33999E+00

The same goes for monitoring the progression of the calculation:
tail -f listing |grep INSTANT
INSTANT    0.633000000E+00   TIME STEP NUMBER             633
INSTANT    0.634000000E+00   TIME STEP NUMBER             634
INSTANT    0.635000000E+00   TIME STEP NUMBER             635
INSTANT    0.636000000E+00   TIME STEP NUMBER             636
INSTANT    0.637000000E+00   TIME STEP NUMBER             637
INSTANT    0.638000000E+00   TIME STEP NUMBER             638

As far as I've read, 'grace' can monitor a file for changes, but I haven't had success with that yet. 
 
So it's a feature request - NICE to have, not need to have :)
 
Regards,

Claus
David Monfort

Re: Suggestion for monitoring a calculation

Post by David Monfort »

Hello Claus,

We clearly want to improve how Code_Saturne outputs the different pieces of information. We are going to split the current "listing" into several ones, probably one for the options, one for the simulation performance, one to follow the simulation convergence. This way, the user should more easily see where the calculation is and how it performs. All of this should be there in a 2.1 version.

As for the "live-plotting", we could imagine doing something when the interface is plugged into SALOME, but we would need to change a few things in the way we handle probes writing (we currently buffer the output for a better I/O performance).

Anyway, feel free to request other features / enhancements.

David
Alexandre CHATELAIN

Re: Suggestion for monitoring a calculation

Post by Alexandre CHATELAIN »

Hello Claus,
Here is a small (yet interesting ;-) ) shell script to monitor live a Code_Saturne simulation using xmgrace and a pipe file.
You can use it and see if it works for you.
 
Alex.
Attachments
Monitor_Code_Saturne.sh.txt
(3 KiB) Downloaded 241 times
Claus Andersen

Re: Suggestion for monitoring a calculation

Post by Claus Andersen »

Very interesting! Im testing it just now; I do however, get some intermittent "[Error] fifo : read error on real time input" messages.
It's a very neat script and does exactly what I proposed in my initial post - thank you for posting it!
Regards,
Claus
Alexandre CHATELAIN

Re: Suggestion for monitoring a calculation

Post by Alexandre CHATELAIN »

I tryed a small modification in the way data is written in the named pipe, and I have no more error messages... Here is the new version.

Maybe you could try it.

Alex.
Attachments
Monitor_Code_Saturne.sh.txt
(2.93 KiB) Downloaded 223 times
Claus Andersen

Re: Suggestion for monitoring a calculation

Post by Claus Andersen »

Yep, it works now :) I now have a nice graph of a calculation failing horribly :D
Now, if there were some way of of incorporating it into the launch script so it would copy it-self to the tmp folder and launch when 'Code_Saturne batch running' was pressed... Hmm
Anyway, thanks again for posting the script !
Regards,
Claus
David Monfort

Re: Suggestion for monitoring a calculation

Post by David Monfort »

Alexandre, thanks for providing such script! This surely can prove to be useful for people ;) However, I'd like to precise that the "real-time" monitoring will not really be real-time due to possible buffering (depending on the system).

Claus, the idea is seducing... but the script seems a bit difficult to generalize. You may have to wait for our own development to have "real-time" monitoring (probably in 2.1 version).

Thank you all,

David
Eduard Pauna

Re: Suggestion for monitoring a calculation

Post by Eduard Pauna »

Alexandre, I thank you for the script. I did some modification on your script and added a menu list in order to choose what to plot. I attach here  my scripts if someone needs them. All the files have to be copied in /usr/bin or in other location in which case you have to modify the path in monitoring.sh.
Attachments
monitoring-tar.gz
(11.4 KiB) Downloaded 218 times
Post Reply