Commit 43f6c58a authored by Daniel Wortmann's avatar Daniel Wortmann

Added usage tracking module, bugfix in rw_noco

parent 9d9906c2
......@@ -62,8 +62,6 @@
READ (24,*)
READ (24,8036) noco%l_ss,noco%l_mperp,noco%l_constr
BACKSPACE (24)
inpchar= 'XXXXXXXX'
!!$ IF ( (inpchar(1:8)=='sso_opt=') .OR. (noco%l_ss .AND. noco%l_soc) ) THEN
!!$ BACKSPACE (24)
!!$ READ (24,fmt='(45x,2l1)') input%sso_opt(1),input%sso_opt(2)
......
......@@ -12,6 +12,7 @@ juDFT/hdf_tools_rw_var.F90
juDFT/hdf_tools_stride.F90)
endif()
set(fleur_F90 ${fleur_F90}
juDFT/usage_data.F90
juDFT/info.F90
juDFT/init.F90
juDFT/juDFT.F90
......
......@@ -4,10 +4,11 @@
! of the MIT license as expressed in the LICENSE file in more detail.
!--------------------------------------------------------------------------------
MODULE m_juDFT
USE m_juDFT_stop
USE m_juDFT_time
USE m_juDFT_init
USE m_judft_args
USE m_judft_info
END MODULE m_juDFT
MODULE m_juDFT
USE m_juDFT_stop
USE m_juDFT_time
USE m_juDFT_init
USE m_judft_args
USE m_judft_info
USE m_judft_usage
END MODULE m_juDFT
......@@ -49,6 +49,7 @@ CONTAINS
END SUBROUTINE judfT_file_readable
SUBROUTINE juDFT_error(message,calledby,hint,no,warning,file,line)
USE m_judft_usage
IMPLICIT NONE
CHARACTER*(*),INTENT(IN) :: message
CHARACTER*(*),OPTIONAL,INTENT(IN) :: calledby,hint
......@@ -123,6 +124,10 @@ CONTAINS
ENDIF
WRITE(0,*)
WRITE(0,"(10(a,/))") (TRIM(text(n)),n=1,linenr)
CALL add_usage_data("Error",message)
CALL send_usage_data()
CALL juDFT_STOP()
ENDIF
WRITE(0,*)
......@@ -145,6 +150,7 @@ CONTAINS
! If irank is present every mpi process has to call this routine.
! Otherwise only a single mpi process is allowed to call the routine.
USE m_xmlOutput
USE m_judft_usage
IMPLICIT NONE
#ifdef CPP_MPI
INCLUDE 'mpif.h'
......@@ -177,6 +183,7 @@ CONTAINS
WRITE(0,*) "*****************************************"
CALL writetimes()
CALL print_memory_info()
CALL send_usage_data()
#ifdef CPP_MPI
IF(PRESENT(irank)) THEN
CALL MPI_BARRIER(MPI_COMM_WORLD,ierr)
......
......@@ -271,6 +271,7 @@ CONTAINS
! writes all times to file
SUBROUTINE writetimes(stdout)
USE m_judft_usage
IMPLICIT NONE
LOGICAL,INTENT(IN),OPTIONAL::stdout
INTEGER :: fn,irank=0
......@@ -297,6 +298,7 @@ CONTAINS
globaltimer%starttime=-1
ENDIF
WRITE(fn,"('Total execution time: ',i0,'sec')") INT(globaltimer%time)
CALL add_usage_data("Runtime",INT(globaltimer%time))
CALL priv_writetimes_longest(globaltimer,fid=fn)
WRITE(fn,"('Total execution time: ',i0,'sec, minimal timing printed:',i0,'sec')") &
......
!--------------------------------------------------------------------------------
! Copyright (c) 2016 Peter Grünberg Institut, Forschungszentrum Jülich, Germany
! This file is part of FLEUR and available as free software under the conditions
! of the MIT license as expressed in the LICENSE file in more detail.
!--------------------------------------------------------------------------------
MODULE m_judft_usage
IMPLICIT NONE
PRIVATE
CHARACTER(LEN=99),PARAMETER:: URL_STRING="www.flapw.de/collect.pl"
INTEGER,PARAMETER :: MAX_NO_KEYS=20
CHARACTER(LEN=20) :: keys(MAX_NO_KEYS)
CHARACTER(LEN=20) :: values(MAX_NO_KEYS)
INTEGER :: no_keys=0
INTERFACE add_usage_data
MODULE PROCEDURE::add_usage_data_s,add_usage_data_i,add_usage_data_l
END INTERFACE add_usage_data
PUBLIC :: add_usage_data,send_usage_data
CONTAINS
SUBROUTINE add_usage_data_s(key,VALUE)
IMPLICIT NONE
CHARACTER(len=*),INTENT(IN)::key,VALUE
no_keys=no_keys+1
IF (no_keys>MAX_NO_KEYS) STOP "BUG, too many keys in usage_data"
keys(no_keys) =key
values(no_keys)=VALUE
END SUBROUTINE add_usage_data_s
SUBROUTINE add_usage_data_i(key,VALUE)
IMPLICIT NONE
CHARACTER(len=*),INTENT(IN):: key
INTEGER,intent(in) :: value
CHARACTER(len=20)::txt
WRITE(txt,*) VALUE
CALL add_usage_data_s(key,txt)
END SUBROUTINE add_usage_data_i
SUBROUTINE add_usage_data_l(key,VALUE)
IMPLICIT NONE
CHARACTER(len=*),INTENT(IN):: key
LOGICAL,INTENT(in) :: VALUE
CHARACTER(len=20)::txt
txt=MERGE("TRUE ","FALSE",value)
CALL add_usage_data_s(key,txt)
END SUBROUTINE add_usage_data_l
SUBROUTINE send_usage_data()
IMPLICIT NONE
INTEGER :: i,ierr,pid,dt(8)
INTEGER*8 :: r
#ifdef CPP_MPI
INCLUDE 'mpif.h'
CALL MPI_IRANK(MPI_COMM_WORLD,i,ierr)
IF (i.NE.0) RETURN
#endif
!#ifdef CPP_ALLOW_USAGE_DATA
CALL DATE_AND_TIME(values = dt)
r = (dt(1) - 1970) * 365_8 * 24 * 60 * 60 * 1000 + &
dt(2) * 31_8 * 24 * 60 * 60 * 1000 + &
dt(3) * 24_8 * 60 * 60 * 1000 + dt(5) * 60 * 60 * 1000 + &
dt(6) * 60 * 1000 + dt(7) * 1000 + dt(8)
pid = GETPID()
r=r*1000+pid
!First write a json file
OPEN(unit=961,file="usage.json",status='replace')
WRITE(961,*) '{'
WRITE(961,*) ' "url":"',TRIM(ADJUSTL(URL_STRING)),'",'
WRITE(961,"(a,i0,a)") ' "random":"',r,'",'
WRITE(961,*) ' "data": {'
DO i=1,no_keys
WRITE(961,*) ' "',TRIM(ADJUSTL(keys(i))),'":"',TRIM(ADJUSTL(values(i))),'",'
ENDDO
WRITE(961,*) ' }'
WRITE(961,*) '}'
CLOSE(961)
#ifdef CPP_CURL
IF (judft_was_argument("-no_send")) THEN
PRINT *,"As requested by command line option usage data was not send, please send usage.json manually"
ELSE
!Send using curl
CALL system('curl -H "Content-Type: application/json" --data @usage.json '\\URL_STRING)
PRINT *,"Usage data send using curl: usage.json"
ENDIF
#else
PRINT *,'curl not found in compilation. Please send usage.json manually'
#endif
!#else
! PRINT *,"No usage data collected"
!#endif
END SUBROUTINE send_usage_data
END MODULE m_judft_usage
......@@ -694,6 +694,20 @@
!Finalize the MPI setup
CALL setupMPI(kpts%nkpt,mpi)
!Collect some usage info
CALL add_usage_data("A-Types",atoms%ntype)
CALL add_usage_data("Atoms",atoms%nat)
CALL add_usage_data("Real",sym%invs.AND..NOT.noco%l_noco)
CALL add_usage_data("Spins",input%jspins)
CALL add_usage_data("Noco",noco%l_noco)
CALL add_usage_data("SOC",noco%l_soc)
CALL add_usage_data("SpinSpiral",noco%l_ss)
CALL add_usage_data("PlaneWaves",DIMENSION%nvd)
CALL add_usage_data("LOs",atoms%nlotot)
CALL add_usage_data("Iterations",input%itmax)
IF (mpi%irank.EQ.0) THEN
CALL setStartingDensity(noco%l_noco)
END IF
......
......@@ -24,14 +24,15 @@ CONTAINS
WRITE(*,*) "--------------------------------------------------------"
#ifdef CPP_MPI
write(*,*) "Number of MPI-tasks: ",mpi%isize
!$ write(*,*) "Number of OMP-threads:",omp
#else
if (omp==-1) THEN
write(*,*) "No OpenMP version of FLEUR."
else
write(*,*) "Number of OMP-threads:",omp
endif
CALL add_usage_data("MPI-PE",mpi%isize)
#endif
IF (omp==-1) THEN
write(*,*) "No OpenMP version of FLEUR."
CALL add_usage_data("OMP",0)
ELSE
WRITE(*,*) "Number of OMP-threads:",omp
CALL add_usage_data("OMP",omp)
ENDIF
endif
IF (mpi%isize==1) THEN
!give some info on available parallelisation
......
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