Checkpoint/restart of an example application

As an example application we use a program, which iterates indefinitely and reserves with every iteration additional memory for one char. This memory space is filled with an asterisk and it is printed out. Before continuing with the next iteration, it sleeps one second. This program is included in the test suite, ckpt-test.tgz, is called t-20001030-01, and can be automagically executed by invoking its corresponding script t-20001030-01.sh.

Let us first fire up this program:

bash[1015]%./t-20001030-01
*
**
***
****
*****
******
*******
********
*********
**********
***********
************
*************
**************
***************
****************
*****************
******************
*******************
********************
*********************
and send it a checkpoint signal (in a different window):
bash[1001]%ps -u
zegerh   10380  0.0  1.0  1772 1016 pts/7    S    15:18   0:00 -bash
zegerh   10489  0.3  1.6  3428 1580 pts/7    S    15:24   0:00 ./t-20001030-01
 .
 .
 .

dasnix2:[~]
bash[1002]%kill -USR1 10489
Now the application may be restarted as follows:
dasnix2:[~]
bash[1003]%ckpt/checkpointFile 
**********************
***********************
************************
*************************
**************************
***************************
It is seen that the application starts exactly at the point where it left off.



Zeger Hendrikse
2000-11-22