PyFoam killing my SSH sessions
Dear Foamers,
I recently decided to switch to PyFoam to run and monitor my cases. However, I encountered an annoying issue: some PyFoam functions seem to kill my SSH sessions. Here's the kind of output I get: Code:
<some output> |
Greetings Vincent,
That's a curious occurrence. A few questions:
Bruno |
Quote:
I've never seen that kind of behaviour and can only guess (although most guesses say "it's not my (PyFoam) fault but a weird thing where the termination signal of the thread that runs the OF-command". But that is a REALLY wild guess) |
1 Attachment(s)
Quote:
Thank you for answering so quickly. Here are the answers to your questions:
Allrun.py Code:
#!/usr/bin/python |
Quote:
Thank you for your answer. In the example output I posted, the killing happens right at the end of the execution of the blockMesh utility using a Runner object (see the Allrun.py script posted above). The script should then proceed with the execution of various utilities and a solver. Vincent |
Quote:
|
Greetings to all!
Quote:
I'm not familiar enough with Python to know this, but when using bash scripts, it's possible to use the "-e" set option: Code:
set -e Code:
set +e Best regards, Bruno |
Quote:
One thing: it seems that the output from PyFoam messes up some terminals. What you could try is to add the "--silent"-option to the Runner calls. This will print nothing to the terminal but you should still have the log-files (don't use "--progress" because it tends to make this worse: some terminals have problem with '\r') Other option is to go to PyFoam.Execution.BasicRunner.py and add print-statemtents before self.run.interrupt() to find out how the interrupt got there (there should also be traces in ~/pyFoam/log/general and the PyFoamState.TheState in the case should read "Interrupted" if PyFoam thinks that someone Ctrl-C'ed it (but that is only diagnostic and I wouldn't know how to fix this) |
Thank you for your advice, gentlemen. I will try to do what Bernhard suggests ASAP and I'll come back if I make any progress.
Regards, Vincent |
Update
Quote:
I suppressed the terminal output using the --silent option. Killings still occurred. I noticed that they seem to happend preferably at the end of the execution of utilities (all of them) and quite randomly. I tried to run the utilities using the UtilityRunner class and killings stopped occurring. However, I still get errors like: Code:
Getting LinuxMem: [Errno 2] No such file or directory: '/proc/27467/status' |
Quote:
Anyway: If you're doing scripts PyFoam.Execution.UtilitiyRunner might be the better choice anyway (the PyFoam.Applications-classes are mainly for quickly "translating" what you did on the shell to a script) |
Solution found
Quote:
|
Quote:
I have been working on the problem again. I still get the getLinuxMem errors I mentioned. After testing on several configurations, it seems to be happening more frequently on my production configuration than on my dev computer. There are major differences between them, but the most important one is that the production computer has much faster processors than the development one. This also happens only on very 'small' cases. When processing big amounts of data, I do not see these messages. So my hypothesis would be: maybe this is just a matter of execution speed. Maybe the process started using any Runner class terminates so quickly that when any function using its PID is run, it cannot do its work as expected. What do you think about that? |
I guess I was right
I added " && sleep N", where N is a number to be chosen for every task, to give PyFoam enough time to sort things out. So the typical call looks like
Code:
UtilityRunner( |
Quote:
The problem (as you said) is timing: pyFoam puts the utility into another thread so that it can "look at it from outside". Problem is that sometimes the utility is finished before PyFoam can have a first look. |
Quote:
|
All times are GMT -4. The time now is 16:30. |