Commit 44a0f65f authored by Marco Govoni's avatar Marco Govoni
Browse files

Added barrier.

parent d2792373
......@@ -46,6 +46,7 @@ SUBROUTINE do_setup
INTEGER, ALLOCATABLE :: ngk_g(:)
REAL(DP) :: xkg(3)
REAL(DP) :: alat
CHARACTER(LEN=6) :: cik
!
CALL start_clock('do_setup')
!
......@@ -85,16 +86,16 @@ SUBROUTINE do_setup
!
CALL io_push_title('System Overview')
CALL io_push_value('gamma_only',gamma_only,20)
IF( mpime == root ) CALL json%add('system.gamma_only',gamma_only)
IF( mpime == root ) CALL json%add('system.basis.gamma_only',gamma_only)
CALL io_push_value('ecutwfc [Ry]',ecutwfc,20)
IF( mpime == root ) CALL json%add('system.ecutwfc',ecutwfc)
IF( mpime == root ) CALL json%add('system.basis.ecutwfc:ry',ecutwfc)
CALL io_push_es0('omega [au^3]',omega,20)
IF( mpime == root ) CALL json%add('system.omega',omega)
IF( mpime == root ) CALL json%add('system.cell.omega:au',omega)
IF ( gamma_only ) THEN
auxi = npw
CALL mp_sum(auxi,intra_bgrp_comm)
CALL io_push_value('glob. #G',auxi,20)
IF( mpime == root ) CALL json%add('system.globg',auxi)
IF( mpime == root ) CALL json%add('system.basis.globg',auxi)
ELSE
ALLOCATE( ngk_g(nkstot) )
!npool = nproc_image / nproc_pool
......@@ -112,33 +113,33 @@ SUBROUTINE do_setup
ngk_g = ngk_g / nbgrp
npwx_g = MAXVAL( ngk_g(1:nkstot) )
CALL io_push_value('glob. #PW',npwx_g,20)
IF( mpime == root ) CALL json%add('system.globpw',npwx_g)
IF( mpime == root ) CALL json%add('system.basis.globpw',npwx_g)
DEALLOCATE( ngk_g )
ENDIF
CALL io_push_value('nbnd',nbnd,20)
IF( mpime == root ) CALL json%add('system.nbnd',nbnd)
IF( mpime == root ) CALL json%add('system.electron.nbnd',nbnd)
CALL io_push_value('nkstot',nkstot,20)
IF( mpime == root ) CALL json%add('system.nkstot',nkstot)
IF( mpime == root ) CALL json%add('system.electron.nkstot',nkstot)
CALL io_push_value('nspin',nspin,20)
IF( mpime == root ) CALL json%add('system.nspin',nspin)
IF( mpime == root ) CALL json%add('system.electron.nspin',nspin)
CALL io_push_value('nelec',nelec,20)
IF( mpime == root ) CALL json%add('system.nelec',nelec)
IF( mpime == root ) CALL json%add('system.electron.nelec',nelec)
IF(nspin == 2) THEN
CALL io_push_value('nelup',nelup,20)
IF( mpime == root ) CALL json%add('system.nelup',nelup)
IF( mpime == root ) CALL json%add('system.electron.nelup',nelup)
CALL io_push_value('neldw',neldw,20)
IF( mpime == root ) CALL json%add('system.neldw',neldw)
IF( mpime == root ) CALL json%add('system.electron.neldw',neldw)
ENDIF
CALL io_push_value('npol',npol,20)
IF( mpime == root ) CALL json%add('system.npol',npol)
IF( mpime == root ) CALL json%add('system.electron.npol',npol)
CALL io_push_value('lsda',lsda,20)
IF( mpime == root ) CALL json%add('system.lsda',lsda)
IF( mpime == root ) CALL json%add('system.electron.lsda',lsda)
CALL io_push_value('noncolin',noncolin,20)
IF( mpime == root ) CALL json%add('system.noncolin',noncolin)
IF( mpime == root ) CALL json%add('system.electron.noncolin',noncolin)
CALL io_push_value('lspinorb',lspinorb,20)
IF( mpime == root ) CALL json%add('system.lspinorb',lspinorb)
IF( mpime == root ) CALL json%add('system.electron.lspinorb',lspinorb)
CALL io_push_value('domag',domag,20)
IF( mpime == root ) CALL json%add('system.domag',domag)
IF( mpime == root ) CALL json%add('system.electron.domag',domag)
CALL io_push_bar
!
alat = celldm(1)
......@@ -153,44 +154,44 @@ SUBROUTINE do_setup
WRITE( stdout, '( 5x," = ",3f14.6)') alat*at(2,1:3)
WRITE( stdout, '( 5x," = ",3f14.6)') alat*at(3,1:3)
WRITE( stdout, '( 5x," ")')
IF( mpime == root ) THEN
CALL json%add('system.basis.sFFT.ngm',ngms_g)
CALL json%add('system.basis.sFFT.nr1',dffts%nr1)
CALL json%add('system.basis.sFFT.nr2',dffts%nr2)
CALL json%add('system.basis.sFFT.nr3',dffts%nr3)
CALL json%add('system.basis.dFFT.ngm',ngm_g)
CALL json%add('system.basis.dFFT.nr1',dfftp%nr1)
CALL json%add('system.basis.dFFT.nr2',dfftp%nr2)
CALL json%add('system.basis.dFFT.nr3',dfftp%nr3)
CALL json%add('system.cell.a1:au',alat*at(1:3,1))
CALL json%add('system.cell.a2:au',alat*at(1:3,2))
CALL json%add('system.cell.a3:au',alat*at(1:3,3))
CALL json%add('system.cell.alat:au',alat)
ENDIF
!
IF ( gamma_only ) THEN
WRITE( stdout, '(5x,"number of ks points=",i6)') nkstot
WRITE( stdout, '(23x,"cart. coord. in units 2pi/alat")')
DO ik = 1, nkstot
WRITE( stdout, '(8x,"k(",i5,") = (",3f12.7,"), wk =",f12.7)') ik, &
(xk (ipol, ik) , ipol = 1, 3) , wk (ik)
ENDDO
WRITE( stdout, '(/23x,"cryst. coord.")')
DO ik = 1, nkstot
DO ipol = 1, 3
xkg(ipol) = at(1,ipol)*xk(1,ik) + at(2,ipol)*xk(2,ik) + &
at(3,ipol)*xk(3,ik)
! xkg are the component in the crystal RL basis
ENDDO
WRITE( stdout, '(8x,"k(",i5,") = (",3f12.7,"), wk =",f12.7)') &
ik, (xkg (ipol) , ipol = 1, 3) , wk (ik)
ENDDO
WRITE( stdout, * )
ELSE
WRITE( stdout, '(5x,"number of ks points=",i6)') nkstot
WRITE( stdout, '(23x,"cart. coord. in units 2pi/alat")')
DO ik = 1, nkstot
WRITE( stdout, '(8x,"k(",i5,") = (",3f12.7,"), wk =",f12.7)') ik, &
(xk (ipol, ik) , ipol = 1, 3) , wk (ik)
ENDDO
WRITE( stdout, '(/23x,"cryst. coord.")')
DO ik = 1, nkstot
DO ipol = 1, 3
xkg(ipol) = at(1,ipol)*xk(1,ik) + at(2,ipol)*xk(2,ik) + &
at(3,ipol)*xk(3,ik)
! xkg are the component in the crystal RL basis
ENDDO
WRITE( stdout, '(8x,"k(",i5,") = (",3f12.7,"), wk =",f12.7)') &
ik, (xkg (ipol) , ipol = 1, 3) , wk (ik)
WRITE( stdout, '(5x,"number of ks points=",i6)') nkstot
IF( mpime == root ) CALL json%add('system.kpt.nkstot',nkstot)
WRITE( stdout, '(23x,"cart. coord. in units 2pi/alat")')
DO ik = 1, nkstot
WRITE( cik, '(i6)') ik
WRITE( stdout, '(8x,"k(",i5,") = (",3f12.7,"), wk =",f12.7)') ik, &
(xk (ipol, ik) , ipol = 1, 3) , wk (ik)
IF( mpime == root ) CALL json%add('system.kpt.k('//TRIM(ADJUSTL(cik))//').cartcoord:tpiba',xkg(1:3))
IF( mpime == root ) CALL json%add('system.kpt.k('//TRIM(ADJUSTL(cik))//').weight',wk(ik))
ENDDO
WRITE( stdout, '(/23x,"cryst. coord.")')
DO ik = 1, nkstot
WRITE( cik, '(i6)') ik
DO ipol = 1, 3
xkg(ipol) = at(1,ipol)*xk(1,ik) + at(2,ipol)*xk(2,ik) + &
at(3,ipol)*xk(3,ik)
! xkg are the component in the crystal RL basis
ENDDO
WRITE( stdout, * )
END IF
WRITE( stdout, '(8x,"k(",i5,") = (",3f12.7,"), wk =",f12.7)') &
ik, (xkg (ipol) , ipol = 1, 3) , wk (ik)
IF( mpime == root ) CALL json%add('system.kpt.k('//TRIM(ADJUSTL(cik))//').crystcoord',xkg(1:3))
ENDDO
WRITE( stdout, * )
!
IF( mpime == root ) THEN
OPEN( NEWUNIT=iunit, FILE=TRIM(logfile) )
......
......@@ -123,7 +123,8 @@ CONTAINS
SUBROUTINE west_environment_end( code )
!
USE json_module, ONLY : json_file
USE mp_world, ONLY : mpime,root
USE mp_world, ONLY : mpime,root,world_comm
USE mp, ONLY : mp_barrier
USE westcom, ONLY : logfile
!
IMPLICIT NONE
......@@ -133,6 +134,7 @@ CONTAINS
TYPE(json_file) :: json
CHARACTER(LEN=9) :: cdate, ctime
CHARACTER(LEN=80) :: time_str
LOGICAL :: found
!
IF ( meta_ionode ) WRITE( stdout, * )
!
......@@ -162,9 +164,9 @@ CONTAINS
CALL json%initialize()
CALL json%load_file(filename=TRIM(logfile))
!
CALL json%add('run.completed', .TRUE. )
CALL json%add('run.endtime', TRIM(ctime) )
CALL json%add('run.enddate', TRIM(cdate) )
CALL json%update('run.job.completed', .TRUE., found)
CALL json%add('run.job.endtime', TRIM(ctime) )
CALL json%add('run.job.enddate', TRIM(cdate) )
!
OPEN( NEWUNIT=iunit,FILE=TRIM(logfile) )
CALL json%print_file( iunit )
......@@ -172,7 +174,9 @@ CONTAINS
!
CALL json%destroy()
!
ENDIF
ENDIF
!
CALL mp_barrier(world_comm)
!
END SUBROUTINE
!
......@@ -223,8 +227,9 @@ CONTAINS
!
CALL json%initialize()
!
CALL json%add('run.startdate', TRIM(cdate) )
CALL json%add('run.starttime', TRIM(ctime) )
CALL json%add('run.job.startdate', TRIM(cdate) )
CALL json%add('run.job.starttime', TRIM(ctime) )
CALL json%add('run.job.completed', .FALSE. )
CALL json%add('run.software.program', TRIM(code) )
CALL json%add('run.software.version', TRIM(west_version_number) )
IF( TRIM (west_svn_revision) /= "unknown" ) CALL json%add('init.svn', TRIM(west_svn_revision) )
......
......@@ -20,6 +20,7 @@ SUBROUTINE west_print_clocks( )
USE mytime, ONLY : nclock, clock_label, cputime, walltime, &
notrunning, called, t0cpu, t0wall
USE westcom, ONLY : logfile
USE mp_world, ONLY : mpime, root
!
IMPLICIT NONE
!
......@@ -29,9 +30,10 @@ SUBROUTINE west_print_clocks( )
INTEGER :: iunit, nmax
REAL(DP), EXTERNAL :: scnds, cclock
!
CALL json%initialize()
!
CALL json%load_file(filename=TRIM(logfile))
IF( mpime == root ) THEN
CALL json%initialize()
CALL json%load_file(filename=TRIM(logfile))
ENDIF
!
DO n = 1, nclock
!
......@@ -56,17 +58,21 @@ SUBROUTINE west_print_clocks( )
!
nmax = called(n)
!
CALL json%add('timing.'//TRIM(clock_label(n))//'.cpu',elapsed_cpu_time)
CALL json%add('timing.'//TRIM(clock_label(n))//'.wall',elapsed_wall_time)
CALL json%add('timing.'//TRIM(clock_label(n))//'.nocalls',nmax)
IF( mpime == root ) THEN
CALL json%add('timing.'//TRIM(clock_label(n))//'.cpu',elapsed_cpu_time)
CALL json%add('timing.'//TRIM(clock_label(n))//'.wall',elapsed_wall_time)
CALL json%add('timing.'//TRIM(clock_label(n))//'.nocalls',nmax)
ENDIF
!
ENDDO
!
OPEN( NEWUNIT=iunit,FILE=TRIM(logfile))
CALL json%print_file( iunit )
CLOSE( iunit )
!
CALL json%destroy()
IF( mpime == root ) THEN
OPEN( NEWUNIT=iunit,FILE=TRIM(logfile))
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