int checkpoint_here(int flag)
err = checkpoint_here(flag)
For FORTRAN programs:
EXTERNAL CHECKPOINT_HERE
INTEGER CHECKPOINT_HERE
INTEGER FLAG
PARAMETER (CKPT_IMMEDIATE=0, CKPT_PERIODIC=1)
ERR = CHECKPOINT_HERE(FLAG)
If CKPT_IMMEDIATE is passed to checkpoint_here, a checkpoint is started immediately.
If instead, CKPT_PERIODIC is passed to checkpoint_here, all nodes first coordinate themselves and check if a timer has expired since last checkpoint or the starting of the program. This timer is maintained on node 0 process of the application. If timer has expired, then a checkpoint is initiated by checkpoint_here().
CALL MULT_MATRIX(A, B, C)
ERR = CHECKPOINT_HERE(CKPT_IMMEDIATE)
IF (ERR .EQ. -1 .AND. MYNODE() .EQ. 0 ) THEN
WRITE (*,*) 'CHECKPOINT_HERE FAILED with ', ERR
STOP
ENDIF
IF (ERR .EQ. 1 .AND. MYNODE() .EQ. 0 ) THEN
WRITE (*,*) 'WE JUST RECOVERED FROM A CHECKPOINT'
ENDIF