31 $
'module ['//trim(chpt_name)//
'] already registered')
40 $
'Parent module ['//
'FRAME'//
'] not registered')
44 call mntr_mod_reg(chpt_id,lpmid,chpt_name,
'Checkpointing I/O')
49 $
'CHP_TOT',
'Checkpointing total time',.false.)
52 $
'CHP_INI',
'Checkpointing initialisation time',.true.)
55 call rprm_sec_reg(chpt_sec_id,chpt_id,
'_'//adjustl(chpt_name),
56 $
'Runtime paramere section for checkpoint module')
60 call rprm_rp_reg(chpt_ifrst_id,chpt_sec_id,
'READCHKPT',
61 $
'Restat from checkpoint',rpar_log,0,0.0,.false.,
' ')
63 call rprm_rp_reg(chpt_fnum_id,chpt_sec_id,
'CHKPFNUMBER',
64 $
'Restart file number',rpar_int,1,0.0,.false.,
' ')
66 call rprm_rp_reg(chpt_step_id,chpt_sec_id,
'CHKPINTERVAL',
67 $
'Checkpiont saving frequency (number of time steps)',
68 $ rpar_int,500,0.0,.false.,
' ')
77 ltim = dnekclock() - ltim
100 character*200 lstring
103 logical chkpts_is_initialised
107 if (chpt_ifinit)
then
109 $
'module ['//trim(chpt_name)//
'] already initiaised.')
111 if (.not.chkpts_is_initialised())
then
113 $
'required submodule module not initiaised.')
122 call rprm_rp_get(itmp,rtmp,ltmp,ctmp,chpt_ifrst_id,rpar_log)
124 call rprm_rp_get(itmp,rtmp,ltmp,ctmp,chpt_fnum_id,rpar_int)
126 call rprm_rp_get(itmp,rtmp,ltmp,ctmp,chpt_step_id,rpar_int)
131 chpt_set_i = chpt_fnum - 1
132 if (chpt_set_i.ge.chpt_nset)
then
133 write(str,
'(I2)') chpt_nset + 1
134 lstring =
'chpt_fnum must be in the range: 1-'//trim(str)
138 chpt_set_o = mod(chpt_set_i+1,chpt_nset)
148 if (nsteps.lt.3*lstdl)
then
149 call mntr_abort(chpt_id,
'too short run for multi-file restart')
153 if (chpt_step.lt.2*lstdl.or.chpt_step.gt.nsteps)
then
155 call mntr_warn(chpt_id,
'wrong chpt_step; resetting to NSTEPS')
161 chpt_nstep = nsteps - lstdl - 1
163 itmp = chpt_nstep + chpt_step -1
164 if (mod(itmp,chpt_step).ge.(chpt_step-lstdl))
then
165 itmp = lstdl + mod(itmp,chpt_step) + 1 - chpt_step
166 chpt_nstep = chpt_nstep - itmp
173 if (chkpts_is_initialised()) chpt_ifinit=.true.
176 ltim = dnekclock() - ltim
210 if(chpt_ifrst.and.istep.le.chpt_istep)
then
212 elseif (istep.gt.chpt_istep)
then
216 chpt_nstep = nsteps - lstdl -1
218 itmp = chpt_nstep + chpt_step -1
219 if (mod(itmp,chpt_step).ge.(chpt_step-lstdl))
then
220 itmp = lstdl + mod(itmp,chpt_step) + 1 - chpt_step
221 chpt_nstep = chpt_nstep - itmp
225 itmp = istep + chpt_step -1
226 if (istep.gt.(nsteps-lstdl))
then
227 chpt_stepc = nsteps-istep+1
228 elseif (istep.lt.chpt_nstep.and.
229 $ mod(itmp,chpt_step).ge.(chpt_step-lstdl))
then
230 chpt_stepc = chpt_step - mod(itmp,chpt_step)
238 if (istep.lt.chpt_nstep.and.mod(istep,chpt_step).eq.0)
then
239 chpt_reset = mod(chpt_set_o+1,chpt_nset)
240 elseif (chpt_reset.ge.0)
then
241 chpt_set_o = chpt_reset
262 integer step_cnt, set_out
264 step_cnt = chpt_stepc
subroutine chkpt_init()
Initilise checkpointing module.
subroutine chkpt_main
Main checkpoint interface.
subroutine chkpt_get_fset(step_cnt, set_out)
Get step count to the checkpoint and a set number.
subroutine chkpt_register()
Register checkpointing module.
logical function chkpt_is_initialised()
Check if module was initialised.
subroutine chkpts_init
Dummy replacement for checkpoint initialisation.
subroutine chkpts_read
Dummy replacement for checkpoint reader.
subroutine chkpts_register
Dummy replacement for checkpoint registration.
subroutine chkpts_write
Dummy replacement for checkpoint writer.
subroutine mntr_tmr_is_name_reg(mid, mname)
Check if timer name is registered and return its id.
subroutine mntr_warn(mid, logs)
Write warning message.
subroutine mntr_tmr_add(mid, icount, time)
Check if timer id is registered. This operation is performed locally.
subroutine mntr_mod_is_name_reg(mid, mname)
Check if module name is registered and return its id.
subroutine mntr_abort(mid, logs)
Abort simulation.
subroutine mntr_mod_reg(mid, pmid, mname, mdscr)
Register new module.
subroutine mntr_get_step_delay(dstep)
Get step delay.
subroutine mntr_tmr_reg(mid, pmid, modid, mname, mdscr, ifsum)
Register new timer.
subroutine mntr_set_step_delay(dstep)
Set number of steps necessary to write proper checkpointing.
subroutine rprm_rp_get(ipval, rpval, lpval, cpval, rpid, ptype)
Get runtime parameter form active section. This operation is performed locally.
subroutine rprm_rp_reg(rpid, mid, pname, pdscr, ptype, ipval, rpval, lpval, cpval)
Register new runtime parameter.
subroutine rprm_sec_set_act(ifact, rpid)
Set section's activation flag. Master value is broadcasted.
subroutine rprm_sec_reg(rpid, mid, pname, pdscr)
Register new parameter section.