Commit 89e0b5b6 authored by Daniel Wortmann's avatar Daniel Wortmann

Changed some info output

parent 7fe131dc
...@@ -2,28 +2,23 @@ ...@@ -2,28 +2,23 @@
#init/compile_descr.F90 to determine the programm version and #init/compile_descr.F90 to determine the programm version and
#some compilation environment description #some compilation environment description
set(compile_host $ENV{HOSTNAME}) cmake_host_system_information(RESULT compile_host QUERY HOSTNAME)
set(compile_user $ENV{USER}) set(compile_user $ENV{USER})
string(TIMESTAMP compile_time) string(TIMESTAMP compile_time)
set(git_hash unkown) set(git_hash unkown)
set(git_decribe unkown)
set(git_branch unkown)
if (EXISTS ${CMAKE_SOURCE_DIR}/.git) if (EXISTS ${CMAKE_SOURCE_DIR}/.git)
execute_process(COMMAND git describe --tags WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} OUTPUT_VARIABLE git_describe) execute_process(COMMAND git describe --tags WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} OUTPUT_VARIABLE git_describe)
if (${git_describe}) execute_process(COMMAND git rev-parse --abbrev-ref HEAD WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} OUTPUT_VARIABLE git_branch)
message("GIT DESCRIBE:${git_describe}")
else()
set(git_describe unkown)
endif()
execute_process(COMMAND git rev-parse HEAD WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} OUTPUT_VARIABLE git_hash) execute_process(COMMAND git rev-parse HEAD WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} OUTPUT_VARIABLE git_hash)
elseif (EXISTS ${CMAKE_SOURCE_DIR}/version) elseif (EXISTS ${CMAKE_SOURCE_DIR}/version)
file(READ ${CMAKE_SOURCE_DIR}/version git_describe) file(READ ${CMAKE_SOURCE_DIR}/version git_describe)
else()
set(git_describe unknown)
endif() endif()
#normalize the strings #normalize the strings
string(STRIP ${git_hash} git_hash) string(STRIP ${git_hash} git_hash)
string(STRIP ${git_describe} git_describe) string(STRIP ${git_describe} git_describe)
string(STRIP ${git_branch} git_branch)
file(GENERATE OUTPUT ${CMAKE_SOURCE_DIR}/init/compileinfo.h CONTENT "gitdesc=\"${git_describe}\"\ncompile_date=\"${compile_time}\"\ncompile_user=\"${compile_user}\"\ncompile_host=\"${compile_host}\"\ngitbranch=\"${git_branch}\"\ngithash=\"${git_hash}\"\n")
file(GENERATE OUTPUT ${CMAKE_SOURCE_DIR}/init/compileinfo.h CONTENT "gitdesc=\"${git_describe}\"\ncompile_date=\"${compile_time}\"\ncompile_user=\"${compile_user}\"\ncompile_host=\"${compile_host}\"\ngithash=\"${git_hash}\"\n")
...@@ -7,12 +7,35 @@ ...@@ -7,12 +7,35 @@
MODULE m_compile_descr MODULE m_compile_descr
IMPLICIT NONE IMPLICIT NONE
!Use the Preprocessor variables to determine compile environment
CONTAINS CONTAINS
SUBROUTINE get_compile_desc(gitdesc,githash,compile_date,compile_user,compile_host)
SUBROUTINE get_compile_desc_string(info)
USE m_constants
IMPLICIT NONE
CHARACTER(LEN=*),INTENT(OUT):: info
CHARACTER(len=50)::gitdesc,githash,compile_date,compile_user,compile_host,gitbranch
call get_compile_desc(gitdesc,githash,gitbranch,compile_date,compile_user,compile_host)
info=new_line("a")// &
"This is FLEUR version: "//trim(version_const)//new_line("a")// &
"FLEUR was compiled:"//new_line("a")// &
" at: "//TRIM(compile_date)//new_line("a")// &
" by: "//TRIM(compile_user)//new_line("a")// &
" on: "//TRIM(compile_host)//new_line("a")// &
"Its git version is:"//new_line("a")// &
" described by: "//TRIM(gitdesc)//new_line("a")// &
" from branch: "//trim(gitbranch)//new_line("a")// &
" with hash: "//TRIM(githash)
end SUBROUTINE get_compile_desc_string
SUBROUTINE get_compile_desc(gitdesc,githash,gitbranch,compile_date,compile_user,compile_host)
IMPLICIT NONE IMPLICIT NONE
CHARACTER(LEN=*),INTENT(OUT)::gitdesc,githash,compile_date,compile_user,compile_host CHARACTER(LEN=*),INTENT(OUT)::gitdesc,githash,compile_date,compile_user,compile_host,gitbranch
!This file is created by cmake at time of configuration
#include "compileinfo.h" #include "compileinfo.h"
END subroutine get_compile_desc END subroutine get_compile_desc
......
...@@ -245,7 +245,7 @@ CONTAINS ...@@ -245,7 +245,7 @@ CONTAINS
IMPLICIT NONE IMPLICIT NONE
CHARACTER(len=9), INTENT (IN) :: ivers CHARACTER(len=9), INTENT (IN) :: ivers
CHARACTER(len=9) :: cppflag(11) CHARACTER(len=9) :: cppflag(11)
CHARACTER(LEN=50):: gitdesc,githash,compile_date,compile_user,compile_host CHARACTER(LEN=500):: infostring
INTEGER :: i,j INTEGER :: i,j
WRITE (6,*) 'This output is generated by ',ivers WRITE (6,*) 'This output is generated by ',ivers
WRITE (6,*) ' * * ' WRITE (6,*) ' * * '
...@@ -258,10 +258,8 @@ CONTAINS ...@@ -258,10 +258,8 @@ CONTAINS
WRITE (6,*) ' * * ' WRITE (6,*) ' * * '
WRITE (6,*) WRITE (6,*)
CALL get_compile_desc(gitdesc,githash,compile_date,compile_user,compile_host) CALL get_compile_desc_string(infostring)
write (6,*) "FLEUR was compiled at ",trim(compile_date)," by ",trim(compile_user)," on ",trim(compile_host) write(6,'(a500)') infostring
write (6,*) "Its git version is ",trim(gitdesc)," with hash: ",trim(githash)
CALL getComputerArchitectures(cppflag,i) ! First determine the architecture CALL getComputerArchitectures(cppflag,i) ! First determine the architecture
IF (i.GT.1) THEN IF (i.GT.1) THEN
WRITE (6,*) 'You set compiler flags for more than one' WRITE (6,*) 'You set compiler flags for more than one'
......
...@@ -61,7 +61,7 @@ MODULE m_xmlOutput ...@@ -61,7 +61,7 @@ MODULE m_xmlOutput
CHARACTER(LEN=6) :: precisionString CHARACTER(LEN=6) :: precisionString
CHARACTER(LEN=9) :: flags(11) CHARACTER(LEN=9) :: flags(11)
CHARACTER(LEN=20) :: structureSpecifiers(11) CHARACTER(LEN=20) :: structureSpecifiers(11)
CHARACTER(LEN=50) :: gitdesc,githash,compile_date,compile_user,compile_host CHARACTER(LEN=50) :: gitdesc,githash,gitbranch,compile_date,compile_user,compile_host
maxNumElements = 10 maxNumElements = 10
ALLOCATE(elementList(maxNumElements)) ALLOCATE(elementList(maxNumElements))
...@@ -75,9 +75,9 @@ MODULE m_xmlOutput ...@@ -75,9 +75,9 @@ MODULE m_xmlOutput
WRITE (xmlOutputUnit,'(a)') '<?xml version="1.0" encoding="UTF-8" standalone="no"?>' WRITE (xmlOutputUnit,'(a)') '<?xml version="1.0" encoding="UTF-8" standalone="no"?>'
WRITE (xmlOutputUnit,'(a)') '<fleurOutput fleurOutputVersion="0.27">' WRITE (xmlOutputUnit,'(a)') '<fleurOutput fleurOutputVersion="0.27">'
CALL openXMLElement('programVersion',(/'version'/),(/version_const/)) CALL openXMLElement('programVersion',(/'version'/),(/version_const/))
CALL get_compile_desc(gitdesc,githash,compile_date,compile_user,compile_host) CALL get_compile_desc(gitdesc,githash,gitbranch,compile_date,compile_user,compile_host)
CALL writeXMLElement('compilationInfo',(/'date','user','host'/),(/compile_date,compile_user,compile_host/)) CALL writeXMLElement('compilationInfo',(/'date','user','host'/),(/compile_date,compile_user,compile_host/))
CALL writeXMLElement('gitInfo',(/'version ','lastCommitHash'/),(/gitdesc,githash/)) CALL writeXMLElement('gitInfo',(/'version ','branch ','lastCommitHash'/),(/gitdesc,gitbranch,githash/))
CALL getComputerArchitectures(flags, numFlags) CALL getComputerArchitectures(flags, numFlags)
IF (numFlags.EQ.0) THEN IF (numFlags.EQ.0) THEN
numFlags = 1 numFlags = 1
......
...@@ -42,11 +42,16 @@ ...@@ -42,11 +42,16 @@
CALL MPI_COMM_RANK (MPI_COMM_WORLD,irank,ierr) CALL MPI_COMM_RANK (MPI_COMM_WORLD,irank,ierr)
WRITE(*,*) "Signal ",signal," detected on PE:",irank WRITE(*,*) "Signal ",signal," detected on PE:",irank
CALL writetimes()
#else #else
WRITE(*,*) "Signal detected:",signal WRITE(*,*) "Signal detected:",signal
CALL writetimes()
#endif #endif
WRITE(*,*) "This is might be due to either:"
WRITE(*,*) " - A bug in FLEUR"
WRITE(*,*) " - Your job running out of memory"
WRITE(*,*) " - Your job got killed externally (e.g. no cpu-time left)"
WRITE(*,*) " - ...."
WRITE(*,*) "Please check and report if you believe you found a bug"
CALL writetimes()
STOP "Signal" STOP "Signal"
intel_signal_handler=0 intel_signal_handler=0
END FUNCTION intel_signal_handler END FUNCTION intel_signal_handler
......
...@@ -11,7 +11,7 @@ CONTAINS ...@@ -11,7 +11,7 @@ CONTAINS
USE m_constants USE m_constants
USE m_juDFT USE m_juDFT
IMPLICIT NONE IMPLICIT NONE
CHARACTER(LEN=50):: gitdesc,githash,compile_date,compile_user,compile_host CHARACTER(LEN=500):: infostring
PRINT *," Welcome to FLEUR (www.flapw.de) " PRINT *," Welcome to FLEUR (www.flapw.de) "
PRINT *," MaX-Release 1 (www.max-centre.eu)" PRINT *," MaX-Release 1 (www.max-centre.eu)"
...@@ -19,10 +19,8 @@ CONTAINS ...@@ -19,10 +19,8 @@ CONTAINS
IF (.NOT. (juDFT_was_argument("-h").OR.juDFT_was_argument("--help"))) RETURN IF (.NOT. (juDFT_was_argument("-h").OR.juDFT_was_argument("--help"))) RETURN
!now print version info and help on command line arguments: !now print version info and help on command line arguments:
CALL get_compile_desc(gitdesc,githash,compile_date,compile_user,compile_host) CALL get_compile_desc_string(infostring)
WRITE(*,*) "This is version: ",version_const WRITE(*,'(a500)') infostring
WRITE(*,*) "FLEUR was compiled at ",TRIM(compile_date)," by ",TRIM(compile_user)," on ",TRIM(compile_host)
WRITE(*,*) "Its git version is ",TRIM(gitdesc)," with hash: ",TRIM(githash)
WRITE(*,*) WRITE(*,*)
WRITE(*,*)"------------------------------------------------------" WRITE(*,*)"------------------------------------------------------"
WRITE(*,*)"Usage info:" WRITE(*,*)"Usage info:"
......
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