Utility library hpcsperf : Différence entre versions
m |
m (moved Useful Control Routines to Utility library hpcsperf: structure change) |
(Aucune différence)
|
Version depuis le 1 de décembre 2011 à 14:14
en construction(cette page s'adresse principalement aux développeurs) |
under construction(this page is mainly for developers) |
library hpcsperf
stuck/looping program protection
- start_dead_process_timer
call start_dead_process_timer(value_in_seconds)
sets the maximum value of the allowable interval between calls to i_am_alive - i_am_alive
call i_am_alive
resets the dead process timer
C language example
void main() { int timeout=15; /* set timeout to 15 seconds */ useconds_t j=5000000; start_dead_process_timer(&timeout); while(1){ fprintf(stderr,"sleeping %d seconds \n",j/1000000); i_am_alive(); usleep(j); j=j+3000000; } }
FORTRAN language example
program stuck integer timeout integer i timeout=10 call start_dead_process_timer(timeout) do while(1.eq.1) i=i+1 enddo stop end