Commit 4cf783ad authored by Matthias Redies's avatar Matthias Redies

merge develop

parents 9d326c37 d6d3c266
init/compileinfo.h
io/xml/inputSchema.h
Testing/*
*~
\#*
build
......
......@@ -16,7 +16,7 @@ build-gfortran-hdf5:
paths:
- build
script:
- cd /builds/fleur/fleur; ./configure.sh GITLAB; cd build; make
- cd /builds/fleur/fleur; ./configure.sh GITLAB; cd build; make -j 4
# only:
# - schedules
# - triggers
......@@ -100,7 +100,7 @@ build-intel:
- build.intel
script:
- set +e && source compilervars.sh intel64 && set -e ; ulimit -s unlimited
- cd /builds/fleur/fleur; FC=mpiifort FLEUR_LIBRARIES="-lmkl_scalapack_lp64;-lmkl_blacs_intelmpi_lp64" ./configure.sh -t -l intel INTEL_MPI ; cd build.intel; make
- cd /builds/fleur/fleur; FC=mpiifort FLEUR_LIBRARIES="-lmkl_scalapack_lp64;-lmkl_blacs_intelmpi_lp64" ./configure.sh -t -l intel INTEL_MPI ; cd build.intel; make -j 4
only:
- schedules
- triggers
......@@ -133,7 +133,7 @@ gfortran-coverage:
paths:
- build
script:
- cd /builds/fleur/fleur; ./configure.sh -l coverage -flags --coverage GITLAB; cd build.coverage; make
- cd /builds/fleur/fleur; ./configure.sh -l coverage -flags --coverage GITLAB; cd build.coverage; make -j 4
- lcov --capture --initial -d CMakeFiles -o baseline.info
- ulimit -s unlimited ;export juDFT_MPI="mpirun -n 2 --allow-run-as-root ";ctest
- lcov --capture -d CMakeFiles -o after.info
......
......@@ -22,10 +22,10 @@ CONTAINS
! .. Array Arguments ..
REAL, INTENT(IN) :: we(:)!(nobd)
COMPLEX, INTENT(INOUT) :: uu21(atoms%lmaxd,atoms%ntype)
COMPLEX, INTENT(INOUT) :: ud21(atoms%lmaxd,atoms%ntype)
COMPLEX, INTENT(INOUT) :: du21(atoms%lmaxd,atoms%ntype)
COMPLEX, INTENT(INOUT) :: dd21(atoms%lmaxd,atoms%ntype)
COMPLEX, INTENT(INOUT) :: uu21(0:atoms%lmaxd,atoms%ntype)
COMPLEX, INTENT(INOUT) :: ud21(0:atoms%lmaxd,atoms%ntype)
COMPLEX, INTENT(INOUT) :: du21(0:atoms%lmaxd,atoms%ntype)
COMPLEX, INTENT(INOUT) :: dd21(0:atoms%lmaxd,atoms%ntype)
COMPLEX, INTENT(INOUT) :: uulo21(atoms%nlod,atoms%ntype)
COMPLEX, INTENT(INOUT) :: dulo21(atoms%nlod,atoms%ntype)
COMPLEX, INTENT(INOUT) :: ulou21(atoms%nlod,atoms%ntype)
......
......@@ -62,7 +62,7 @@ set(inpgen_F90 ${inpgen_F90} global/constants.f90 io/xsf_io.f90
eigen/orthoglo.F90 juDFT/usage_data.F90 math/ylm4.F90
global/sort.f90 global/chkmt.f90 inpgen/inpgen.f90 inpgen/set_inp.f90 inpgen/inpgen_help.f90 io/rw_inp.f90 juDFT/juDFT.F90 global/find_enpara.f90
inpgen/closure.f90 inpgen/inpgen_arguments.F90
juDFT/info.F90 juDFT/stop.F90 juDFT/args.F90 juDFT/time.F90 juDFT/init.F90 juDFT/sysinfo.F90 io/w_inpXML.f90 kpoints/julia.f90 global/utility.F90
juDFT/info.F90 juDFT/stop.F90 juDFT/args.F90 juDFT/time.F90 juDFT/init.F90 juDFT/sysinfo.F90 juDFT/string.f90 io/w_inpXML.f90 kpoints/julia.f90 global/utility.F90
init/compile_descr.F90 kpoints/kpoints.f90 io/xmlOutput.F90 kpoints/brzone2.f90 cdn/slab_dim.f90 cdn/slabgeom.f90 dos/nstm3.f90 cdn/int_21.f90
cdn/int_21lo.f90 cdn_mt/rhomt21.f90 cdn_mt/rhonmt21.f90 force/force_a21.F90 force/force_a21_lo.f90 force/force_a21_U.f90 force/force_a12.f90
eigen/tlmplm_store.F90 kpoints/unfoldBandKPTS.f90)
......
......@@ -12,7 +12,7 @@ if (${CMAKE_Fortran_COMPILER_ID} MATCHES "Intel")
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -mkl -r8 -qopenmp -assume byterecl")
endif()
set(CMAKE_Fortran_FLAGS_RELEASE "${CMAKE_Fortran_FLAGS_RELEASE} -xHost -O2 -g")
set(CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG} -C -traceback -O0 -g -ftrapuv -check uninit -check pointers -CB ")
set(CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG} -C -traceback -O0 -g -ftrapuv -check uninit -check pointers -CB -DCPP_DEBUG")
elseif(${CMAKE_Fortran_COMPILER_ID} MATCHES "PGI")
message("PGI Fortran detected")
set(CMAKE_SHARED_LIBRARY_LINK_Fortran_FLAGS "") #fix problem in cmake
......@@ -24,12 +24,12 @@ elseif(${CMAKE_Fortran_COMPILER_ID} MATCHES "PGI")
#set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -mp -Mr8 -Mr8intrinsics -Mcuda:cuda9.0,cc70 -DUSE_STREAMS -DNUM_STREAMS=${N_STREAMS} -Minfo=accel -acc")
#set(CMAKE_Fortran_FLAGS_RELEASE "${CMAKE_Fortran_FLAGS_RELEASE} -fast -O3")
set(CMAKE_Fortran_FLAGS_RELEASE "-O1 ") # to prevent cmake from putting -fast which auses problems with PGI18.4
set(CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG} -C -traceback -O0 -g -Mchkstk -Mchkptr -Ktrap=fp")
set(CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG} -C -traceback -O0 -g -Mchkstk -Mchkptr -Ktrap=fp -DCPP_DEBUG")
elseif(${CMAKE_Fortran_COMPILER_ID} MATCHES "XL")
message("IBM/BG Fortran detected")
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -qsmp=omp -qnosave -qarch=qp -qtune=qp -qrealsize=8 -qfixed -qsuppress=1520-022 -qessl")
set(CMAKE_Fortran_FLAGS_RELEASE "${CMAKE_Fortran_FLAGS_RELEASE} -O4 -qsuppress=1500-036")
set(CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG} -O0 -g")
set(CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG} -O0 -g -DCPP_DEBUG")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -I/bgsys/local/libxml2/include/libxml2")
set(FLEUR_DEFINITIONS ${FLEUR_DEFINITIONS} "CPP_AIX")
set(FLEUR_MPI_DEFINITIONS ${FLEUR_MPI_DEFINITIONS} "CPP_AIX")
......@@ -40,5 +40,5 @@ elseif(${CMAKE_Fortran_COMPILER_ID} MATCHES "GNU")
endif()
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -ffree-line-length-none -fopenmp -fdefault-real-8 -Wno-missing-include-dirs")
set(CMAKE_Fortran_FLAGS_RELEASE "${CMAKE_Fortran_FLAGS_RELEASE} -O1")
set(CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG} -fdump-core -Wall -Wextra -Warray-temporaries -fbacktrace -fcheck=all -finit-real=nan -O0 -g")
set(CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG} -fdump-core -Wall -Wextra -Warray-temporaries -fbacktrace -fcheck=all -finit-real=nan -O0 -g -DCPP_DEBUG")
endif()
......@@ -66,6 +66,7 @@ CONTAINS
USE m_types_gpumat
USE m_matrix_copy
USE m_cusolver_diag
USE m_judft_usage
IMPLICIT NONE
#ifdef CPP_MPI
include 'mpif.h'
......@@ -108,6 +109,7 @@ CONTAINS
CALL timestart("Diagonalization")
!Select the solver
CALL add_usage_data("diag-solver", priv_select_solver(parallel))
SELECT CASE (priv_select_solver(parallel))
CASE (diag_elpa)
CALL elpa_diag(hmat,smat,ne,eig,ev)
......
......@@ -92,7 +92,7 @@ CONTAINS
jspin=jsp
CALL vacfun(&
vacuum,DIMENSION,stars,&
jsp,input,noco,ipot,&
jsp,input,noco,jspin1,jspin2,&
sym, cell,ivac,evac(1,1),lapw%bkpt,v%vacxy(:,:,ivac,ipot),v%vacz(:,:,:),kvac1,kvac2,nv2,&
tuuv,tddv,tudv,tduv,uz,duz,udz,dudz,ddnv,wronk)
!
......
......@@ -31,7 +31,7 @@ CONTAINS
REAL dvu(0:atoms%lmaxd*(atoms%lmaxd+3)/2,0:sphhar%nlhd )
REAL uvd(0:atoms%lmaxd*(atoms%lmaxd+3)/2,0:sphhar%nlhd )
REAL uvu(0:atoms%lmaxd*(atoms%lmaxd+3)/2,0:sphhar%nlhd )
REAL f(atoms%jmtd,2,0:atoms%lmaxd),g(atoms%jmtd,2,0:atoms%lmaxd),x(atoms%jmtd)
REAL f(atoms%jmtd,2,0:atoms%lmaxd,2),g(atoms%jmtd,2,0:atoms%lmaxd,2),x(atoms%jmtd)
REAL flo(atoms%jmtd,2,atoms%nlod)
INTEGER:: indt(0:SIZE(td%tuu,1)-1)
......@@ -40,14 +40,21 @@ CONTAINS
COMPLEX :: cil
REAL :: temp
INTEGER i,l,l2,lamda,lh,lm,lmin,lmin0,lmp,lmpl,lmplm,lmx,lmxx,lp,info,in
INTEGER lp1,lpl ,mem,mems,mp,mu,nh,na,m,nsym,s,i_u
INTEGER lp1,lpl ,mem,mems,mp,mu,nh,na,m,nsym,s,i_u,jspin1,jspin2
vr0=v%mt(:,:,n,jsp)
IF (jsp<3) vr0(:,0)=0.0
CALL genMTBasis(atoms,enpara,v,mpi,n,jspin,ud,f,g,flo)
DO i=MERGE(1,jspin,jspin>2),MERGE(2,jspin,jspin>2)
CALL genMTBasis(atoms,enpara,v,mpi,n,i,ud,f(:,:,:,i),g(:,:,:,i),flo)
ENDDO
IF (jspin>2) THEN
jspin1=1
jspin2=2
ELSE
jspin1=jspin;jspin2=jspin
END IF
na=SUM(atoms%neq(:n-1))+1
nsym = atoms%ntypsy(na)
nh = sphhar%nlh(nsym)
......@@ -73,22 +80,22 @@ CONTAINS
dvu(lpl,lh) = 0.0
ELSE
DO i = 1,atoms%jri(n)
x(i) = (f(i,1,lp)*f(i,1,l)+f(i,2,lp)*f(i,2,l))* vr0(i,lh)
x(i) = (f(i,1,lp,jspin1)*f(i,1,l,jspin2)+f(i,2,lp,jspin1)*f(i,2,l,jspin2))* vr0(i,lh)
END DO
CALL intgr3(x,atoms%rmsh(1,n),atoms%dx(n),atoms%jri(n),temp)
uvu(lpl,lh) = temp
DO i = 1,atoms%jri(n)
x(i) = (g(i,1,lp)*f(i,1,l)+g(i,2,lp)*f(i,2,l))* vr0(i,lh)
x(i) = (g(i,1,lp,jspin1)*f(i,1,l,jspin2)+g(i,2,lp,jspin1)*f(i,2,l,jspin2))* vr0(i,lh)
END DO
CALL intgr3(x,atoms%rmsh(1,n),atoms%dx(n),atoms%jri(n),temp)
dvu(lpl,lh) = temp
DO i = 1,atoms%jri(n)
x(i) = (f(i,1,lp)*g(i,1,l)+f(i,2,lp)*g(i,2,l))* vr0(i,lh)
x(i) = (f(i,1,lp,jspin1)*g(i,1,l,jspin2)+f(i,2,lp,jspin1)*g(i,2,l,jspin2))* vr0(i,lh)
END DO
CALL intgr3(x,atoms%rmsh(1,n),atoms%dx(n),atoms%jri(n),temp)
uvd(lpl,lh) = temp
DO i = 1,atoms%jri(n)
x(i) = (g(i,1,lp)*g(i,1,l)+g(i,2,lp)*g(i,2,l))* vr0(i,lh)
x(i) = (g(i,1,lp,jspin1)*g(i,1,l,jspin2)+g(i,2,lp,jspin1)*g(i,2,l,jspin2))* vr0(i,lh)
END DO
CALL intgr3(x,atoms%rmsh(1,n),atoms%dx(n),atoms%jri(n),temp)
dvd(lpl,lh) = temp
......
......@@ -112,31 +112,30 @@ CONTAINS
ENDDO
END DO
!Now add diagonal contribution to matrices
DO l = 0,atoms%lmax(n)
DO m = -l,l
lm = l* (l+1) + m
lmplm = (lm* (lm+3))/2
td%tuu(lmplm,n,jsp)=td%tuu(lmplm,n,jsp) + enpara%el0(l,n,jsp)
td%tdd(lmplm,n,jsp)=td%tdd(lmplm,n,jsp) + enpara%el0(l,n,jsp)*ud%ddn(l,n,jsp)
td%tud(lmplm,n,jsp)=td%tud(lmplm,n,jsp) + 0.5
td%tdu(lmplm,n,jsp)=td%tdu(lmplm,n,jsp) + 0.5
IF (jsp<3) THEN
DO l = 0,atoms%lmax(n)
DO m = -l,l
lm = l* (l+1) + m
lmplm = (lm* (lm+3))/2
td%tuu(lmplm,n,jsp)=td%tuu(lmplm,n,jsp) + enpara%el0(l,n,jsp)
td%tdd(lmplm,n,jsp)=td%tdd(lmplm,n,jsp) + enpara%el0(l,n,jsp)*ud%ddn(l,n,jsp)
td%tud(lmplm,n,jsp)=td%tud(lmplm,n,jsp) + 0.5
td%tdu(lmplm,n,jsp)=td%tdu(lmplm,n,jsp) + 0.5
ENDDO
ENDDO
ENDDO
!Create Cholesky decomposition of local hamiltonian
!---> Add diagonal terms to make matrix positive definite
DO lp = 0,atoms%lnonsph(n)
DO mp = -lp,lp
lmp = lp* (lp+1) + mp
td%h_loc(lmp,lmp,n,jsp)=td%e_shift(n,jsp)+td%h_loc(lmp,lmp,n,jsp)
td%h_loc(lmp+s,lmp+s,n,jsp)=td%e_shift(n,jsp)*ud%ddn(lp,n,jsp)+td%h_loc(lmp+s,lmp+s,n,jsp)
!Create Cholesky decomposition of local hamiltonian
!---> Add diagonal terms to make matrix positive definite
DO lp = 0,atoms%lnonsph(n)
DO mp = -lp,lp
lmp = lp* (lp+1) + mp
td%h_loc(lmp,lmp,n,jsp)=td%e_shift(n,jsp)+td%h_loc(lmp,lmp,n,jsp)
td%h_loc(lmp+s,lmp+s,n,jsp)=td%e_shift(n,jsp)*ud%ddn(lp,n,jsp)+td%h_loc(lmp+s,lmp+s,n,jsp)
END DO
END DO
END DO
IF (lmp+1.NE.s) CALL judft_error("BUG in tlmpln_cholesky")
!Perform cholesky decomposition
info=0
IF (jsp<3) THEN
IF (lmp+1.NE.s) CALL judft_error("BUG in tlmpln_cholesky")
!Perform cholesky decomposition
info=0
CALL zpotrf("L",2*s,td%h_loc(:,:,n,jsp),SIZE(td%h_loc,1),info)
!Upper part to zero
......
......@@ -2,7 +2,7 @@ MODULE m_vacfun
use m_juDFT
CONTAINS
SUBROUTINE vacfun(&
vacuum,dimension,stars, jsp,input,noco,ipot,&
vacuum,DIMENSION,stars, jsp,input,noco,jsp1,jsp2,&
sym, cell,ivac,evac,bkpt, vxy,vz,kvac1,kvac2,nv2,&
tuuv,tddv,tudv,tduv,uz,duz,udz,dudz,ddnv,wronk)
!*********************************************************************
......@@ -28,7 +28,7 @@ CONTAINS
TYPE(t_cell),INTENT(IN) :: cell
! ..
! .. Scalar Arguments ..
INTEGER, INTENT (IN) :: jsp ,ivac,ipot
INTEGER, INTENT (IN) :: jsp ,ivac,jsp1,jsp2
REAL, INTENT (OUT) :: wronk
! ..
! .. Array Arguments ..
......@@ -46,7 +46,7 @@ CONTAINS
! .. Local Scalars ..
REAL ev,scale,xv,yv,vzero
COMPLEX phase
INTEGER i,i1,i2,i3,ik,ind2,ind3,jk,np1,jspin,jsp1,jsp2
INTEGER i,i1,i2,i3,ik,ind2,ind3,jk,np1,jspin
LOGICAL tail
! ..
! .. Local Arrays ..
......@@ -87,21 +87,6 @@ CONTAINS
enddo
ENDDO
!---> set up the tuuv, etc. matrices
IF (noco%l_noco) THEN
IF (ipot.EQ.1) THEN
jsp1 = 1
jsp2 = 1
ELSEIF (ipot.EQ.2) THEN
jsp1 = 2
jsp2 = 2
ELSEIF (ipot.EQ.3) THEN
jsp1 = 2
jsp2 = 1
ENDIF
ELSE
jsp1 = jsp
jsp2 = jsp
ENDIF
DO ik = 1,nv2(jsp1)
DO jk = 1,nv2(jsp2)
......@@ -175,7 +160,7 @@ CONTAINS
ELSE
!---> diagonal (film muffin-tin) terms
IF ((ipot.EQ.1) .OR. (ipot.EQ.2)) THEN
IF (jsp1==jsp2) THEN
tuuv(ik,ik) = cmplx(evac(ivac,jsp1),0.0)
tddv(ik,ik) = cmplx(evac(ivac,jsp1)*ddnv(ik,jsp1),0.0)
tudv(ik,ik) = cmplx(0.5,0.0)
......
......@@ -37,7 +37,9 @@ SUBROUTINE postprocessInput(mpi,input,field,sym,stars,atoms,vacuum,obsolete,kpts
USE m_od_kptsgen
USE m_gen_bz
USE m_nocoInputCheck
USE m_kpoints
USE m_kpoints
USE m_types_forcetheo_extended
IMPLICIT NONE
TYPE(t_mpi) ,INTENT (IN) :: mpi
......
......@@ -2169,10 +2169,45 @@ input%preconditioning_param = evaluateFirstOnly(xmlGetAttributeValue('/fleurInpu
END SELECT
CALL set_xcpot_usage(xcpot)
END SUBROUTINE setXCParameters
SUBROUTINE getIntegerSequenceFromString(string, SEQUENCE, count)
USE m_juDFT
SUBROUTINE set_xcpot_usage(xcpot)
use m_judft_usage
USE m_types
USE m_types_xcpot_inbuild
USE m_types_xcpot_libxc
implicit none
class(t_xcpot), intent(in) :: xcpot
! give some information about XC functional to usage.json
! 1 -> LDA
! 2 -> GGA
! 3 -> MetaGGA
! 4 -> Hybrid functional
if(xcpot%is_lda()) then
call add_usage_data("XC-treatment", 1)
return
endif
if(xcpot%is_MetaGGA()) then
call add_usage_data("XC-treatment", 3)
return
endif
if(xcpot%is_GGA()) then
call add_usage_data("XC-treatment", 2)
return
endif
if(xcpot%is_hybrid()) then
call add_usage_data("XC-treatment", 4)
return
endif
END SUBROUTINE set_xcpot_usage
SUBROUTINE getIntegerSequenceFromString(string, sequence, count)
IMPLICIT NONE
......
......@@ -17,6 +17,7 @@ juDFT/info.F90
juDFT/init.F90
juDFT/juDFT.F90
juDFT/stop.F90
juDFT/string.f90
juDFT/time.F90
juDFT/args.F90
juDFT/sysinfo.F90
......
module m_juDFT_string
implicit none
character(len=3), parameter :: whitespaces = " " // achar(9) // achar(13) ! list of all whitespaces
contains
function strip(input) result(output)
implicit none
character(len=*), intent(in) :: input
character(:), allocatable :: output
integer :: front, back
front = 1
do while(index(whitespaces, input(front:front)) /= 0 )
front = front + 1
enddo
back = len(input)
do while(index(whitespaces, input(back:back)) /= 0)
back = back - 1
enddo
output = input(front:back)
end function strip
end module m_juDFT_string
......@@ -7,7 +7,7 @@ MODULE m_judft_usage
IMPLICIT NONE
PRIVATE
CHARACTER(LEN=99),PARAMETER:: URL_STRING="www.flapw.de/collect.pl"
INTEGER,PARAMETER :: MAX_NO_KEYS=20
INTEGER,PARAMETER :: MAX_NO_KEYS=40
CHARACTER(LEN=200) :: keys(MAX_NO_KEYS)
CHARACTER(LEN=200) :: values(MAX_NO_KEYS)
INTEGER :: no_keys=0
......@@ -21,7 +21,14 @@ MODULE m_judft_usage
CONTAINS
SUBROUTINE add_usage_data_s(key,VALUE)
IMPLICIT NONE
CHARACTER(len=*),INTENT(IN)::key,VALUE
CHARACTER(len=*),INTENT(IN) :: key,VALUE
INTEGER :: i
! don't add a key twice
do i = 1,no_keys
if(keys(i) == key) return
enddo
no_keys=no_keys+1
IF (no_keys>MAX_NO_KEYS) STOP "BUG, too many keys in usage_data"
keys(no_keys) =key
......@@ -32,8 +39,8 @@ CONTAINS
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
......@@ -59,9 +66,11 @@ CONTAINS
END SUBROUTINE add_usage_data_l
SUBROUTINE send_usage_data()
use m_juDFT_args
IMPLICIT NONE
INTEGER :: i,ierr,pid,dt(8)
INTEGER*8 :: r
INTEGER :: i,ierr,pid,dt(8)
CHARACTER(len=200) :: model, modelname, VmPeak, VmSize, VmData, VmStk, VmExe, VmSwap
INTEGER(8) :: r
#ifdef CPP_MPI
INCLUDE 'mpif.h'
......@@ -72,11 +81,25 @@ CONTAINS
!#ifdef CPP_ALLOW_USAGE_DATA
r = random_id()
!add cpuinfos
call get_cpuinfo(model, modelname)
call add_usage_data("cpu_model", model)
call add_usage_data("cpu_modelname", modelname)
!add meminfos
call get_meminfo(VmPeak, VmSize, VmData, VmStk, VmExe, VmSwap)
call add_usage_data("VmPeak", VmPeak)
call add_usage_data("VmSize", VmSize)
call add_usage_data("VmData", VmData)
call add_usage_data("VmStk", VmStk)
call add_usage_data("VmExe", VmExe)
call add_usage_data("VmSwap", VmSwap)
!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,Z0.16,a)") ' "random":"',r,'",'
WRITE(961,"(a,Z0.16,a)") ' "calculation-id":"',r,'",'
WRITE(961,*) ' "data": {'
DO i=1,no_keys
WRITE(961,*) ' "',TRIM(ADJUSTL(keys(i))),'":"',TRIM(ADJUSTL(values(i))),'",'
......@@ -85,17 +108,18 @@ CONTAINS
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
#ifdef CPP_DEBUG
WRITE (*,*) "usage.json not send, because this is a debugging run."
#else
!Send using curl
CALL system('curl -H "Content-Type: application/json" --data @usage.json '\\URL_STRING)
!CALL system('curl -H "Content-Type: application/json" --data @usage.json '\\URL_STRING)
WRITE (*,*) "CURL call not yet implemented"
PRINT *,"Usage data send using curl: usage.json"
ENDIF
#else
PRINT *,'curl not found in compilation. Please send usage.json manually'
#endif
ENDIF
!#else
! PRINT *,"No usage data collected"
!#endif
......@@ -120,4 +144,82 @@ CONTAINS
r = ieor(r, ishft(r,17))
enddo
END FUNCTION random_id
SUBROUTINE get_cpuinfo(model, modelname)
implicit none
character(len=200), intent(out) :: model, modelname
character(len=1000) :: line
integer :: openstatus, readstatus
logical :: found_model, found_modelname, done
model = "unknown"
modelname = "unknown"
done = .False.
found_model = .False.
found_modelname = .False.
readstatus = 0
open(unit=77, file="/proc/cpuinfo", iostat=openstatus)
if(openstatus == 0) then
do while(.not. done)
read(77,'(A)', iostat=readstatus) line
if(readstatus == 0) then
if(index(line, "model name") /= 0) then
modelname = trim(line(index(line, ":")+1:1000))
found_modelname = .True.
done = found_modelname .and. found_model
cycle
endif
if(index(line, "model") /= 0) then
model = trim(line(index(line,":")+1:1000))
found_model = .True.
done = found_modelname .and. found_model
cycle
endif
else
exit
endif
enddo
endif
if(openstatus == 0) close(77)
END SUBROUTINE get_cpuinfo
SUBROUTINE get_meminfo(VmPeak, VmSize, VmData, VmStk, VmExe, VmSwap)
use m_juDFT_string
implicit none
character(len=200), intent(out) :: VmPeak, VmSize, VmData, VmStk, VmExe, VmSwap
character(len=1000) :: line
integer :: openstat, readstat
VmPeak = ""
VmSize = ""
VmData = ""
VmStk = ""
VmExe = ""
VmSwap = ""
readstat = 0
open(unit=77, file="/proc/self/status", iostat=openstat)
do while(readstat == 0)
read(77,'(A)', iostat=readstat) line
if(index(line, "VmPeak") /= 0) VmPeak = strip(line(index(line, ":")+1:index(line,"kB", back=.True.)-1))
if(index(line, "VmSize") /= 0) VmSize = strip(line(index(line, ":")+1:index(line,"kB", back=.True.)-1))
if(index(line, "VmData") /= 0) VmData = strip(line(index(line, ":")+1:index(line,"kB", back=.True.)-1))
if(index(line, "VmStk") /= 0) VmStk = strip(line(index(line, ":")+1:index(line,"kB", back=.True.)-1))
if(index(line, "VmExe") /= 0) VmExe = strip(line(index(line, ":")+1:index(line,"kB", back=.True.)-1))
if(index(line, "VmSwap") /= 0) VmSwap = strip(line(index(line, ":")+1:index(line,"kB", back=.True.)-1))
enddo
if(openstat == 0) close(77)
END SUBROUTINE
END MODULE m_judft_usage
......@@ -184,6 +184,12 @@
l_kpts)
END IF
CALL mpi_bc_xcpot(xcpot,mpi)
#ifdef CPP_MPI
#ifndef CPP_OLDINTEL
CALL mpi_dist_forcetheorem(mpi,forcetheo)
#endif
#endif
CALL postprocessInput(mpi,input,field,sym,stars,atoms,vacuum,obsolete,kpts,&
oneD,hybrid,cell,banddos,sliceplot,xcpot,forcetheo,&
noco,dimension,enpara,sphhar,l_opti,noel,l_kpts)
......@@ -209,9 +215,7 @@
CALL initParallelProcesses(atoms,vacuum,input,stars,sliceplot,banddos,&
DIMENSION,cell,sym,xcpot,noco,oneD,hybrid,&
kpts,enpara,sphhar,mpi,obsolete)
#ifndef CPP_OLDINTEL
CALL mpi_dist_forcetheorem(mpi,forcetheo)
#endif
#endif
ELSE ! else branch of "IF (input%l_inpXML) THEN"
......@@ -520,6 +524,13 @@
CALL add_usage_data("PlaneWaves",DIMENSION%nvd)
CALL add_usage_data("LOs",atoms%nlotot)
CALL add_usage_data("Iterations",input%itmax)
CALL add_usage_data("nkpt", kpts%nkpt)
#ifdef CPP_GPU
CALL add_usage_data("gpu_per_node",1)
#else
CALL add_usage_data("gpu_per_node",0)
#endif
CALL results%init(dimension,input,atoms,kpts,noco)
......
......@@ -195,6 +195,7 @@ CONTAINS
nmap = j
nall = (intfac*stars%ng3 + mapmt + mapvac + 49*2*atoms%n_u )*input%jspins
IF (noco%l_noco) nall = nall + 2*stars%ng3 + mapvac2
IF (noco%l_mtnocopot) nall=nall+mapmt*2
IF (nall.NE.nmap) THEN
WRITE(6,*)'The total number of charge density coefficients is'
WRITE(6,*)'inconsitent:'
......
......@@ -25,16 +25,28 @@ CONTAINS
t=1
TYPE IS (t_forcetheo_mae)
t=2
TYPE IS (t_forcetheo_ssdisp)
t=3
TYPE IS (t_forcetheo_dmi)
t=4
TYPE IS (t_forcetheo_jij)
t=5
END SELECT
ENDIF
CALL MPI_BCAST(t,1,MPI_INTEGER,0,mpi%mpi_comm,ierr)
IF (mpi%irank.NE.0) THEN
IF (ALLOCATED(forcetheo)) DEALLOCATE(forcetheo)
SELECT CASE (t)
CASE (1)
CASE(1)
ALLOCATE(t_forcetheo::forcetheo)
CASE(2)
ALLOCATE(t_forcetheo_mae::forcetheo)
CASE(3)
ALLOCATE(t_forcetheo_ssdisp::forcetheo)
CASE(4)
ALLOCATE(t_forcetheo_dmi::forcetheo)
CASE(5)
ALLOCATE(t_forcetheo_jij::forcetheo)
END SELECT
END IF