Commit 506d9a85 authored by Marco Govoni's avatar Marco Govoni
Browse files

Moved fetch_input in Tools. Started summary.json.

parent 6ea6eda0
......@@ -18,7 +18,6 @@ IO_KERNEL_OBJS = \
mpiio.o \
my_mkdir.o \
fetch_namelist.o \
fetch_input.o \
cubefile.o \
pdep_io.o \
pdep_db.o \
......
......@@ -5,16 +5,18 @@ include ../../make.inc
# location of needed modules
MODFLAGS= $(MOD_FLAG)../../iotk/src $(MOD_FLAG)../../Modules $(MOD_FLAG)../../LAXlib \
$(MOD_FLAG)../../FFTXlib $(MOD_FLAG)../../PW/src \
$(MOD_FLAG)../Libraries/Json \
$(MOD_FLAG)../Modules \
$(MOD_FLAG).
IFLAGS=
TOOLS_OBJS = \
io_push.o \
fetch_input.o \
exx_go.o \
exx_ungo.o \
report_dynamical_memory.o \
io_push.o \
parse_command_arguments.o \
set_dirs.o \
do_setup.o \
......@@ -36,7 +38,7 @@ read_pwout.o \
bar.o
PWOBJS = ../../PW/src/libpw.a
QEMODS = ../../Modules/libqemod.a ../../FFTXlib/libqefft.a ../../LAXlib/libqela.a
QEMODS = ../../Modules/libqemod.a ../../FFTXlib/libqefft.a ../../LAXlib/libqela.a ../Libraries/Json/libjson.a
TLDEPS= bindir mods libs pw
......
......@@ -14,7 +14,7 @@
SUBROUTINE fetch_input( num_drivers, driver )
!-----------------------------------------------------------------------
!
USE json_module
USE json_module, ONLY : json_file
USE pwcom
USE westcom
USE io_files, ONLY : tmp_dir, prefix
......@@ -47,19 +47,18 @@ SUBROUTINE fetch_input( num_drivers, driver )
!
CALL start_clock('fetch_input')
!
! Input from (-i), output from (-o)
!
CALL parse_command_arguments()
!
! PRESETS
!
! ** input_west **
IF ( ANY(driver(:)==1) ) THEN
qe_prefix = 'pwscf'
west_prefix = 'west'
CALL get_environment_variable( 'ESPRESSO_TMPDIR', outdir )
IF ( trim( outdir ) == ' ' ) outdir = './'
ENDIF
!
! ** wstat_control **
IF ( ANY(driver(:)==2) ) THEN
wstat_calculation = 'S'
n_pdep_eigen = 1
n_pdep_times = 4
......@@ -72,8 +71,10 @@ SUBROUTINE fetch_input( num_drivers, driver )
l_kinetic_only = .false.
l_minimize_exx_if_active = .false.
l_use_ecutrho = .false.
ENDIF
!
! ** wfreq_control **
IF ( ANY(driver(:)==3) ) THEN
wfreq_calculation = 'XWGQ'
n_pdep_eigen_to_use = 2
qp_bandrange = (/ 1, 2 /)
......@@ -92,8 +93,10 @@ SUBROUTINE fetch_input( num_drivers, driver )
o_restart_time = 0._DP
ecut_spectralf = (/ -2._DP, 2._DP /)
n_spectralf = 10
ENDIF
!
! ** westpp_control **
IF ( ANY(driver(:)==4) ) THEN
westpp_calculation = 'r'
westpp_range = (/ 1, 2 /)
westpp_format = 'C'
......@@ -103,6 +106,7 @@ SUBROUTINE fetch_input( num_drivers, driver )
westpp_nr = 100
westpp_rmax = 1.d0
westpp_epsinfty = 1.d0
ENDIF
!
! READ the input
!
......@@ -111,7 +115,6 @@ SUBROUTINE fetch_input( num_drivers, driver )
!
CALL json%initialize()
CALL json%load_file( filename = main_input_file )
! if (json%failed())
!
IF ( ANY(driver(:)==1) ) THEN
CALL json%get('input_west.qe_prefix', cval, found)
......
......@@ -19,11 +19,11 @@ SUBROUTINE parse_command_arguments( )
IMPLICIT NONE
!
INTEGER :: nargs, iiarg
LOGICAL :: ifound, ofound
LOGICAL :: ifound !, ofound
CHARACTER(LEN=256) :: string
!
ifound = .FALSE.
ofound = .FALSE.
!ofound = .FALSE.
!
nargs = command_argument_count()
string = ' '
......@@ -37,16 +37,17 @@ SUBROUTINE parse_command_arguments( )
ifound =.TRUE.
ENDIF
!
IF ( .NOT. ofound .AND. TRIM( string ) == '-o' ) THEN
CALL get_command_argument( ( iiarg + 1 ) , main_output_file )
ofound =.TRUE.
ENDIF
!IF ( .NOT. ofound .AND. TRIM( string ) == '-o' ) THEN
! CALL get_command_argument( ( iiarg + 1 ) , main_output_file )
! ofound =.TRUE.
!ENDIF
!
IF( ifound .AND. ofound ) EXIT
!IF( ifound .AND. ofound ) EXIT
IF( ifound ) EXIT
!
ENDDO
!
IF( .NOT. ifound ) CALL errore('parse_cmd','Cannot find input file (-i)',1)
IF( .NOT. ofound ) CALL errore('parse_cmd','Cannot find output file (-o)',1)
!IF( .NOT. ofound ) CALL errore('parse_cmd','Cannot find output file (-o)',1)
!
END SUBROUTINE
......@@ -49,6 +49,11 @@ CONTAINS
#if defined(__INTEL_COMPILER)
CALL remove_stack_limit ( )
#endif
!
! Input from (-i), output from (-o)
!
CALL parse_command_arguments()
CALL fetch_input(1,(/1/))
!
! ... use ".FALSE." to disable all clocks except the total cpu time clock
! ... use ".TRUE." to enable clocks
......@@ -134,9 +139,11 @@ CONTAINS
!
SUBROUTINE west_opening_message( code )
!
USE json_module, ONLY : json_file
USE io_global, ONLY : stdout
USE global_version, ONLY : version_number, svn_revision
USE west_version, ONLY : west_version_number, west_svn_revision
USE mp_world, ONLY : mpime,root
!
! I/O
!
......@@ -144,6 +151,8 @@ CONTAINS
!
! Workspace
!
TYPE(json_file) :: json
INTEGER :: iunit
CHARACTER(LEN=9) :: cdate, ctime
!
CALL date_and_tim( cdate, ctime )
......@@ -168,7 +177,29 @@ CONTAINS
WRITE( stdout, '(/5X,"Based on the Quantum ESPRESSO v. ",A)') TRIM (version_number)
ENDIF
!
RETURN
IF( mpime == root ) THEN
!
CALL json%initialize()
!
CALL json%add('init.date', TRIM(cdate) )
CALL json%add('init.time', TRIM(ctime) )
CALL json%add('init.program', TRIM(code) )
CALL json%add('init.version', TRIM(west_version_number) )
IF( TRIM (west_svn_revision) /= "unknown" ) CALL json%add('init.svn', TRIM(west_svn_revision) )
CALL json%add('init.website',"http://www.west-code.org")
CALL json%add('init.citation',"M. Govoni et al., J. Chem. Theory Comput. 11, 2680 (2015).")
CALL json%add('init.qeversion', TRIM(version_number) )
IF( TRIM (svn_revision) /= "unknown" ) CALL json%add('init.qesvn', TRIM(svn_revision) )
!
!OPEN(UNIT=4000,FILE=TRIM(ADJUSTL(west_output_dir))//"/summary.json")
OPEN( NEWUNIT=iunit,FILE="summary.json" )
CALL json%print_file( iunit )
CLOSE( iunit )
!
CALL json%destroy()
!
ENDIF
!
END SUBROUTINE
!
!
......@@ -201,9 +232,10 @@ CONTAINS
!
! ... Report the mpi/openmp status
!
USE json_module, ONLY : json_file
USE io_global, ONLY : stdout
USE mp_global, ONLY : nimage,npool,nbgrp,nproc_image,nproc_pool,nproc_bgrp
USE mp_world, ONLY : nproc
USE mp_world, ONLY : nproc,mpime,root
USE io_push, ONLY : io_push_title,io_push_bar
!
IMPLICIT NONE
......@@ -213,6 +245,8 @@ CONTAINS
#endif
!
INTEGER :: nth, ncores
TYPE(json_file) :: json
INTEGER :: iunit
!
#if defined(__OPENMP)
nth = omp_get_max_threads()
......@@ -244,6 +278,30 @@ CONTAINS
WRITE(stdout, "(5x, '#prc = ',i12)") ncores
CALL io_push_bar()
#endif
!
IF( mpime == root ) THEN
!
CALL json%initialize()
!
CALL json%load_file(filename='summary.json')
!
CALL json%add('parallel.nranks', nproc )
CALL json%add('parallel.nimage', nimage )
CALL json%add('parallel.npool', npool )
CALL json%add('parallel.nbgrp', nbgrp )
CALL json%add('parallel.nrg', nproc_bgrp )
CALL json%add('parallel.nproc', ncores )
#if defined(__OPENMP)
CALL json%add('parallel.nthreads', nth )
#endif
!
OPEN( NEWUNIT=iunit,FILE="summary.json" )
CALL json%print_file( iunit )
CLOSE( iunit )
!
CALL json%destroy()
!
ENDIF
!
END SUBROUTINE
!
......
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