Commit d6d3c266 authored by Matthias Redies's avatar Matthias Redies

include memory information and exempt debugging runs

parent a289a2ac
......@@ -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 ")
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()
......@@ -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
......@@ -66,9 +66,10 @@ CONTAINS
END SUBROUTINE add_usage_data_l
SUBROUTINE send_usage_data()
use m_juDFT_args
IMPLICIT NONE
INTEGER :: i,ierr,pid,dt(8)
CHARACTER(len=200) :: model, modelname
CHARACTER(len=200) :: model, modelname, VmPeak, VmSize, VmData, VmStk, VmExe, VmSwap
INTEGER(8) :: r
#ifdef CPP_MPI
INCLUDE 'mpif.h'
......@@ -79,10 +80,21 @@ 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,*) '{'
......@@ -96,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
......@@ -177,25 +190,36 @@ CONTAINS
if(openstatus == 0) close(77)
END SUBROUTINE get_cpuinfo
!SUBROUTINE get_meminfo(VmPeak, VmSize, VmData, VmStk, VmExe, VmSwap)
!implicit none
!character(len=200), intent(out) :: VmPeak, VmSize, VmData, VmStk, VmExe, VmSwap
!character(len=1000) :: line
!integer :: stat
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 = ""
!open(unit=77, file="/proc/cpuinfo", iostat=stat)
!do while(stat == 0)
!enddo
!END SUBROUTINE
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
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