Re: Sample polling program code?
- From: "dpb" <dpbozarth@xxxxxxxx>
- Date: 30 Mar 2007 11:47:09 -0700
On Mar 30, 1:15 pm, "sk8terg1rl" <sk8terg1rl_2...@xxxxxxxxxxx> wrote:
....
Fortunately I can tell when the event has finished by parsing an....
output file for zero acceleration. ...
I want to .......
- Checks every 5 seconds to see if the acceleration has gone to zero.
....
- If it has, "kill -9 $PID" the running FE analysis
Don't know what simulation tool you're using, but in the past w/ the
simulation tools I've used, there were facilities to allow utilizing
computed outputs in a generic control system model that had the
facility to do various alternative actions including having mechanisms
to terminate runs. Yours has no such facilities (recognizing some of
the ways of using the above facility were, to say the least,
"creative" in light of the intent of the original program
designers... :) )?
Depending on the OS, it may be possible to open a file for shared read
access and continue to attempt to read it for "magic" data. If it
were possible, again w/ some facility like that above to write a new
file or other output when the condition was recognized internally so
that the appearance of this new file was the key.
As for killing the process, if it comes to that, it's relatively
straightforward to parse the output of various utilities to find the
PID and utilities for killing processes by PID or name are available
for most OS'es so once you know it's time, that would seem to be the
easy part...
Not direct answer, but maybe another way is possible???
.
- Follow-Ups:
- Re: Sample polling program code?
- From: glen herrmannsfeldt
- Re: Sample polling program code?
- Prev by Date: Re: Starting to doubt fortran
- Next by Date: Re: Starting to doubt fortran
- Previous by thread: undefined variable problem
- Next by thread: Re: Sample polling program code?
- Index(es):