Commit 43f8062c authored by giannozz's avatar giannozz

Final cleanup of check_stop machinery - only real change in the end:

max_seconds is stored into module check_stop and no longer in input_parameters


git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@13774 c92efa57-630b-4861-b058-cf58834340f0
parent 29dbc5dd
......@@ -52,6 +52,7 @@ SUBROUTINE f2libcpv(lib_comm,nim,npt,npl,nta,nbn,ndg,retval,infile)
USE mp_global, ONLY : mp_startup
USE io_global, ONLY : ionode, ionode_id
USE environment, ONLY : environment_start
USE check_stop, ONLY : check_stop_init
USE mp_images, ONLY : intra_image_comm
USE command_line_options, ONLY : set_command_line
USE parallel_include
......@@ -108,6 +109,8 @@ SUBROUTINE f2libcpv(lib_comm,nim,npt,npl,nta,nbn,ndg,retval,infile)
! call to void routine for user define / plugin patches initializations
! temporary moved to init_run
! CALL plugin_initialization()
!
CALL check_stop_init()
!
CALL cpr_loop( 1 )
!
......
......@@ -23,6 +23,7 @@ PROGRAM main
USE mp_global, ONLY : mp_startup
USE io_global, ONLY : ionode, ionode_id
USE environment, ONLY : environment_start
USE check_stop, ONLY : check_stop_init
USE mp_images, ONLY : intra_image_comm
USE command_line_options, ONLY : input_file_
!
......@@ -59,6 +60,8 @@ PROGRAM main
! call to void routine for user define / plugin patches initializations
! temporary moved to init_run
! CALL plugin_initialization()
!
CALL check_stop_init()
!
CALL cpr_loop( 1 )
!
......
......@@ -182,7 +182,8 @@ MODULE input
!
! ... Other modules
!
USE cp_main_variables, ONLY : nprint_nfi
USE check_stop, ONLY : max_seconds_ => max_seconds
USE cp_main_variables, ONLY : nprint_nfi
USE wave_base, ONLY : frice_ => frice
USE ions_base, ONLY : fricp_ => fricp
USE cell_base, ONLY : frich_ => frich
......@@ -198,8 +199,6 @@ MODULE input
efield2_ => efield2
!
USE uspp_param, ONLY : nvb
USE check_stop, ONLY : check_stop_init
USE funct, ONLY : dft_is_hybrid
!
USE input_parameters, ONLY: &
electron_dynamics, electron_damping, electron_temperature, &
......@@ -215,6 +214,7 @@ MODULE input
tefield, epol, efield, tefield2, epol2, efield2, remove_rigid_rot, &
iesr, saverho, rd_for, assume_isolated, wf_collect, &
memory, ref_cell, tcpbo, max_seconds
USE funct, ONLY : dft_is_hybrid
!
IMPLICIT NONE
!
......@@ -341,6 +341,8 @@ MODULE input
ampre_ = ampre
taurdr_ = .FALSE.
!
max_seconds_ = max_seconds
!
SELECT CASE ( TRIM( restart_mode ) )
!
CASE( 'from_scratch' )
......@@ -708,8 +710,6 @@ MODULE input
IF( .NOT. trd_ht .AND. ibrav == 0 ) &
CALL errore(' iosys ',' ibrav = 0 but CELL_PARAMETERS not present in stdin ', 1 )
CALL check_stop_init ( max_seconds )
RETURN
END SUBROUTINE set_control_flags
!
......
......@@ -280,6 +280,7 @@ cpr.o : wannier.o
cpr_loop.o : ../../Modules/ions_base.o
cpr_loop.o : ../../Modules/kind.o
cpr_mod.o : ../../Modules/kind.o
cprstart.o : ../../Modules/check_stop.o
cprstart.o : ../../Modules/command_line_options.o
cprstart.o : ../../Modules/environment.o
cprstart.o : ../../Modules/io_global.o
......@@ -736,6 +737,7 @@ makov_payne.o : ../../UtilXlib/mp.o
makov_payne.o : ../../UtilXlib/parallel_include.o
makov_payne.o : ions_positions.o
makov_payne.o : mainvar.o
manycp.o : ../../Modules/check_stop.o
manycp.o : ../../Modules/command_line_options.o
manycp.o : ../../Modules/environment.o
manycp.o : ../../Modules/input_parameters.o
......
......@@ -30,6 +30,7 @@ PROGRAM manycp
USE mp_global, ONLY : mp_startup
USE mp_images, ONLY : my_image_id
USE read_input, ONLY : read_input_file
USE check_stop, ONLY : check_stop_init
USE command_line_options, ONLY: input_file_
!
IMPLICIT NONE
......@@ -95,6 +96,8 @@ PROGRAM manycp
!
CALL iosys()
!
CALL check_stop_init()
!
CALL cpr_loop( 1 )
!
CALL stop_run( )
......
......@@ -26,7 +26,7 @@
USE klist, ONLY : nks
USE lsda_mod, ONLY : lsda
USE fixed_occ, ONLY : tfixed_occ
USE phcom, ONLY : time_max => max_seconds
USE check_stop, ONLY : time_max => max_seconds
USE qpoint, ONLY : xq
USE disp, ONLY : nq1, nq2, nq3
USE output, ONLY : fildvscf, fildrho
......
......@@ -32,7 +32,7 @@ subroutine bcast_ph_input ( )
use io_files, ONLY : tmp_dir, prefix
USE control_flags, only: iverbosity, modenum
USE ramanm, ONLY: lraman, elop, dek, eth_rps, eth_ns
USE input_parameters, ONLY: max_seconds
USE check_stop, ONLY: max_seconds
USE ions_base, ONLY : amass
USE io_global, ONLY : ionode_id
USE run_info, ONLY : title
......
......@@ -25,7 +25,8 @@ SUBROUTINE phq_readin()
USE mp, ONLY : mp_bcast,mp_barrier
USE mp_world, ONLY : world_comm
USE ions_base, ONLY : amass, atm
USE input_parameters, ONLY : max_seconds, nk1, nk2, nk3, k1, k2, k3
USE check_stop, ONLY : max_seconds
USE input_parameters, ONLY : nk1, nk2, nk3, k1, k2, k3
USE start_k, ONLY : reset_grid
USE klist, ONLY : xk, nks, nkstot, lgauss, two_fermi_energies, ltetra
USE control_flags, ONLY : gamma_only, tqr, restart, lkpoint_dir
......
......@@ -36,7 +36,7 @@ MODULE check_stop
LOGICAL :: tinit = .FALSE.
!
PRIVATE
PUBLIC :: check_stop_init, check_stop_now, stopped_by_user
PUBLIC :: check_stop_init, check_stop_now, max_seconds, stopped_by_user
!
CONTAINS
!
......@@ -46,8 +46,6 @@ MODULE check_stop
SUBROUTINE check_stop_init( max_seconds_ )
!-----------------------------------------------------------------------
!
! FIXME: following line to be removed
USE input_parameters, ONLY : max_second__ => max_seconds
USE io_global, ONLY : stdout
USE io_files, ONLY : prefix, exit_file
#if defined(__TRAP_SIGUSR1) || defined(__TERMINATE_GRACEFULLY)
......@@ -57,8 +55,7 @@ MODULE check_stop
IMPLICIT NONE
REAL(dp), INTENT(IN), OPTIONAL :: max_seconds_
!
IF ( tinit ) &
WRITE( UNIT = stdout, &
IF ( tinit ) WRITE( UNIT = stdout, &
FMT = '(/,5X,"WARNING: check_stop already initialized")' )
!
! ... the exit_file name is set here
......@@ -71,11 +68,10 @@ MODULE check_stop
!
IF ( PRESENT(max_seconds_) ) THEN
max_seconds = max_seconds_
ELSE IF ( max_second__ > 0.0_dp ) THEN
max_seconds = max_second__
END IF
!
init_second = f_wall()
!
tinit = .TRUE.
!
#if defined(__TRAP_SIGUSR1) || defined(__TERMINATE_GRACEFULLY)
......
......@@ -22,8 +22,7 @@ subroutine bcast_ph_input ( )
niter_ph, lnoloc, alpha_mix, tr2_ph, recover, &
ldisp, reduce_io, zue, zeu, epsil, trans, &
ldiag, lqdir, search_sym, electron_phonon, &
qplot, only_init, only_wfc, low_directory_check, &
max_seconds
qplot, only_init, only_wfc, low_directory_check
USE gamma_gamma, ONLY : asr
USE disp, ONLY : nq1, nq2, nq3
USE partial, ONLY : nat_todo
......@@ -32,6 +31,7 @@ subroutine bcast_ph_input ( )
use io_files, ONLY : tmp_dir, prefix
USE control_flags, only: iverbosity, modenum
USE ramanm, ONLY: lraman, elop, dek, eth_rps, eth_ns
USE check_stop, ONLY: max_seconds
USE input_parameters, ONLY : nk1, nk2, nk3, k1, k2, k3
USE ions_base, ONLY : amass
USE io_global, ONLY : meta_ionode_id
......
......@@ -138,6 +138,7 @@ alpha2f.o : elph_tetra_mod.o
alpha2f.o : io_dyn_mat.o
alpha2f.o : phcom.o
bcast_ph_input.o : ../../LR_Modules/lrcom.o
bcast_ph_input.o : ../../Modules/check_stop.o
bcast_ph_input.o : ../../Modules/control_flags.o
bcast_ph_input.o : ../../Modules/input_parameters.o
bcast_ph_input.o : ../../Modules/io_files.o
......
......@@ -204,8 +204,7 @@ MODULE control_ph
current_iq, & ! current q point
start_q, last_q ! initial q in the list, last_q in the list
REAL(DP) :: tr2_ph ! threshold for phonon calculation
REAL(DP) :: alpha_mix(maxter), & ! the mixing parameter
max_seconds = 1.0D+7 ! max CPU time
REAL(DP) :: alpha_mix(maxter) ! the mixing parameter
CHARACTER(LEN=10) :: where_rec='no_recover'! where the ph run recovered
CHARACTER(LEN=12) :: electron_phonon
CHARACTER(LEN=256) :: flmixdpot, tmp_dir_ph, tmp_dir_phq
......
......@@ -22,6 +22,7 @@ SUBROUTINE phq_readin()
USE mp, ONLY : mp_bcast
USE mp_world, ONLY : world_comm
USE ions_base, ONLY : amass, atm
USE check_stop, ONLY : max_seconds
USE input_parameters, ONLY : nk1, nk2, nk3, k1, k2, k3
USE start_k, ONLY : reset_grid
USE klist, ONLY : xk, nks, nkstot, lgauss, two_fermi_energies, ltetra
......@@ -43,7 +44,7 @@ SUBROUTINE phq_readin()
ext_recover, ext_restart, u_from_file, ldiag, &
search_sym, lqdir, electron_phonon, tmp_dir_phq, &
rec_code_read, qplot, only_init, only_wfc, &
low_directory_check, max_seconds
low_directory_check
USE save_ph, ONLY : tmp_dir_save, save_ph_input_variables
USE gamma_gamma, ONLY : asr
......@@ -79,7 +80,6 @@ SUBROUTINE phq_readin()
! YAMBO <
USE elph_tetra_mod,ONLY : elph_tetra, lshift_q, in_alpha2f
USE ktetra, ONLY : tetra_type
USE check_stop, ONLY : check_stop_init
!
IMPLICIT NONE
!
......@@ -825,8 +825,6 @@ SUBROUTINE phq_readin()
CALL save_ph_input_variables()
!
CALL check_stop_init( max_seconds)
!
RETURN
!
END SUBROUTINE phq_readin
......@@ -151,7 +151,10 @@ SUBROUTINE iosys()
!
USE extrapolation, ONLY : pot_order, wfc_order
USE control_flags, ONLY : isolve, max_cg_iter, david, tr2, imix, gamma_only,&
nmix, iverbosity, niter, &
nmix, iverbosity, smallmem, niter, &
io_level, ethr, lscf, lbfgs, lmd, &
lbands, lconstrain, restart, twfcollect, &
llondon, do_makov_payne, lxdm, &
remove_rigid_rot_ => remove_rigid_rot, &
diago_full_acc_ => diago_full_acc, &
tolp_ => tolp, &
......@@ -164,13 +167,10 @@ SUBROUTINE iosys()
tqr_ => tqr, &
tq_smoothing_ => tq_smoothing, &
tbeta_smoothing_ => tbeta_smoothing, &
io_level, ethr, lscf, lbfgs, lmd, &
lbands, lconstrain, restart, twfcollect, &
llondon, do_makov_payne, lxdm, &
ts_vdw_ => ts_vdw, &
lecrpa_ => lecrpa, &
smallmem
USE control_flags, ONLY: scf_must_converge_ => scf_must_converge
scf_must_converge_=> scf_must_converge
USE check_stop, ONLY : max_seconds_ => max_seconds
!
USE wvfct, ONLY : nbnd_ => nbnd
USE gvecw, ONLY : ecfixed_ => ecfixed, &
......@@ -212,7 +212,6 @@ SUBROUTINE iosys()
USE qmmm, ONLY : qmmm_config
USE check_stop, ONLY : check_stop_init
!
! ... CONTROL namelist
!
......@@ -222,7 +221,7 @@ SUBROUTINE iosys()
pseudo_dir, disk_io, tefield, dipfield, lberry, &
gdir, nppstr, wf_collect,lelfield,lorbm,efield, &
nberrycyc, lkpoint_dir, efield_cart, lecrpa, &
vdw_table_name, memory, tqmmm, max_seconds, &
vdw_table_name, memory, max_seconds, tqmmm, &
efield_phase, gate
!
......@@ -1615,8 +1614,6 @@ SUBROUTINE iosys()
CALL pw_init_qexsd_input(qexsd_input_obj, obj_tagname="input")
CALL deallocate_input_parameters ()
!
CALL check_stop_init ( max_seconds )
!
! ... Initialize temporary directory(-ies)
!
CALL check_tempdir ( tmp_dir, exst, parallelfs )
......@@ -1631,7 +1628,9 @@ SUBROUTINE iosys()
END IF
IF ( TRIM(wfc_dir) /= TRIM(tmp_dir) ) &
CALL check_tempdir( wfc_dir, exst, parallelfs )
!
max_seconds_ = max_seconds
!
RETURN
!
END SUBROUTINE iosys
......
......@@ -12,6 +12,7 @@ SUBROUTINE run_driver ( srvaddress, exit_status )
!!
USE io_global, ONLY : stdout, ionode, ionode_id
USE parameters, ONLY : ntypx, npk, lmaxx
USE check_stop, ONLY : check_stop_init
USE mp_global, ONLY : mp_bcast, mp_global_end, intra_image_comm
USE control_flags, ONLY : gamma_only, conv_elec, istep, ethr, lscf, lmd
USE cellmd, ONLY : lmovecell
......@@ -69,6 +70,8 @@ SUBROUTINE run_driver ( srvaddress, exit_status )
!
CALL plugin_initialization()
!
CALL check_stop_init()
!
! ... We do a fake run so that the G vectors are initialized
! ... based on the pw input. This is needed to guarantee smooth energy
! ... upon PW restart in NPT runs. Probably can be done in a smarter way
......
......@@ -40,7 +40,7 @@ SUBROUTINE run_pwscf ( exit_status )
USE control_flags, ONLY : conv_ions, istep, nstep, restart, lmd, lbfgs
USE command_line_options, ONLY : command_line
USE force_mod, ONLY : lforce, lstres, sigma, force
USE check_stop, ONLY : check_stop_now
USE check_stop, ONLY : check_stop_init, check_stop_now
USE mp_images, ONLY : intra_image_comm
USE extrapolation, ONLY : update_file, update_pot
USE scf, ONLY : rho
......@@ -88,6 +88,8 @@ SUBROUTINE run_pwscf ( exit_status )
!
CALL plugin_initialization()
!
CALL check_stop_init()
!
CALL setup ()
!
CALL qmmm_update_positions()
......
......@@ -28,8 +28,7 @@ SUBROUTINE do_cond(done)
USE io_files, ONLY: tmp_dir, prefix
!!! RECOVER
USE cond_restart
USE input_parameters, ONLY: max_seconds
USE check_stop, ONLY: check_stop_init, check_stop_now
USE check_stop, ONLY: max_seconds, check_stop_init, check_stop_now
!!!
USE noncollin_module, ONLY : noncolin, i_cons
USE io_global, ONLY : stdout, ionode, ionode_id
......
......@@ -34,7 +34,6 @@ do_cond.o : ../../Modules/check_stop.o
do_cond.o : ../../Modules/constants.o
do_cond.o : ../../Modules/environment.o
do_cond.o : ../../Modules/gvecw.o
do_cond.o : ../../Modules/input_parameters.o
do_cond.o : ../../Modules/io_files.o
do_cond.o : ../../Modules/io_global.o
do_cond.o : ../../Modules/ions_base.o
......
......@@ -31,8 +31,8 @@ SUBROUTINE lr_readin
USE io_global, ONLY : ionode, ionode_id, stdout
USE klist, ONLY : nks, wk, nelec, lgauss, ltetra
USE fixed_occ, ONLY : tfixed_occ
USE input_parameters, ONLY : degauss, nosym, wfcdir, outdir,&
& max_seconds
USE input_parameters, ONLY : degauss, nosym, wfcdir, outdir
USE check_stop, ONLY : max_seconds
USE realus, ONLY : real_space, real_space_debug,&
& init_realspace_vars, qpointlist,&
& betapointlist
......
......@@ -399,6 +399,7 @@ lr_read_wf.o : lr_exx_kernel.o
lr_read_wf.o : lr_variables.o
lr_readin.o : ../../LR_Modules/lrcom.o
lr_readin.o : ../../Modules/cell_base.o
lr_readin.o : ../../Modules/check_stop.o
lr_readin.o : ../../Modules/constants.o
lr_readin.o : ../../Modules/control_flags.o
lr_readin.o : ../../Modules/fft_base.o
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment