Re: How to halt a running program without losing data?



On Tue, 27 Dec 2005 00:33:12 GMT
"robin" <robin_v@xxxxxxxxxxx> wrote:

> <meek@xxxxxxxxxxxxxxx> wrote in message
> news:12JUL05.07143024@xxxxxxxxxxxxxxxxxx
> > In a previous article, beliavsky@xxxxxxx wrote:
> > >Random Programmer wrote:
> > >
> > >> Is there a Fortran command to get the program to pause if say
> > >> Ctrl-C is hit and ask the user for a halt confirmation? I
> > >> thought the best way might be to somehow change a variable that
> > >> is stored in memory (e.g. iteration count), effectively
> > >> "tricking" the program into thinking it has reached the end of
> > >> it's calculations.
>
> PL/I provides the ability to do this.
> You can interrupt a program at any time, and can then do anything you
> want, including printing the values of variables (useful if you want
> to inspect the salient value of some iterative process to see whether
> it is converging, etc), or reading in the values of any variables,
> etc. You write what you want to do in an ON-unit (effectively
> a procedure) that is entered when you interrupt from the keyboard.
>
>
Maby this helps:
http://www.g95.org/cool.html:

Corefile Resume
The execution of a G95-compiled programs can be suspended and resumed.
If you interrupt a program by sending it the QUIT signal, which is
usually bound to control-backslash the program will stop just as if it
had been sent the interrupt signal usually bound to control-C. The
difference is that the QUIT signal causes a core file to be dumped if
your ulimit allows it. G95-compiled programs can now load core files
and resume execution of a stopped program. This is available on x86
linux but will be ported to other systems soon.


Johan
.