Bureaucrats, cc_docs_admin, cc_staff
2,306
edits
No edit summary |
No edit summary |
||
Line 7: | Line 7: | ||
However, if you have access to the source code of the software and/or if you are the author, you can implement a checkpoint/restart functionality in the program yourself. The essential steps are: | However, if you have access to the source code of the software and/or if you are the author, you can implement a checkpoint/restart functionality in the program yourself. The essential steps are: | ||
* | * The creation of a checkpoint file is done periodically, with a suggested frequency of every 2 to 24 hours | ||
* | * While writing the checkpoint file, it's important to remember that the program could be interrupted at any moment and this for a variety of reasons. As a consequence, | ||
** | ** It is preferable to not delete the preceding checkpoint when creating the new one. | ||
** | ** The creation of the checkpoint file can be made ''atomic'' by performing an operation which confirms the end of the checkpoint process. For example, the checkpoint file can be initially named based on the date and time and, as the final step, a symbolic link ''latest-version'' is pointed at this new checkpoint file. Another more advanced method would be to create a second file which contains a hash of the checkpoint file's content by means of which the restart function can verify the integrity of the checkpoint when it is loaded. | ||
** | ** Once the atomic write has been completed, one can choose whether or not to delete any older checkpoints. | ||
Afin de ne pas réinventer la roue, surtout si la modification du code source n'est pas une option, nous suggérons l'utilisation de [http://dmtcp.sourceforge.net/ DMTCP]. | Afin de ne pas réinventer la roue, surtout si la modification du code source n'est pas une option, nous suggérons l'utilisation de [http://dmtcp.sourceforge.net/ DMTCP]. |