Commit 2dbc999c authored by Gregor Michalicek's avatar Gregor Michalicek

Write out compilation flags to out.xml

parent a4f1aaf3
......@@ -49,7 +49,7 @@ init/tetcon.f init/kvecon.f
set(inpgen_F90 io/xsf_io.f90
global/types.F90 global/enpara.f90 global/chkmt.f90 inpgen/inpgen.f90 inpgen/set_inp.f90 io/rw_inp.f90 juDFT/juDFT.F90
juDFT/stop.F90 juDFT/time.F90 juDFT/init.F90 io/w_inpXML.f90 init/julia.f90 io/xmlOutput.F90)
juDFT/stop.F90 juDFT/time.F90 juDFT/init.F90 io/w_inpXML.f90 init/julia.f90 global/utility.F90 io/xmlOutput.F90)
set(fleur_SRC ${fleur_F90} ${fleur_F77})
......
!--------------------------------------------------------------------------------
! 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_lodpot
CONTAINS
SUBROUTINE lodpot(mpi,atoms,sphhar,obsolete,vacuum,&
......
......@@ -27,4 +27,5 @@ global/phasy1.f90
global/qfix.f90
global/radflo.F90
global/types.F90
global/utility.F90
)
!--------------------------------------------------------------------------------
! 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_types
!*************************************************************
! This module contains definitions for all kind of types
......
!--------------------------------------------------------------------------------
! 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_utility
IMPLICIT NONE
CONTAINS
SUBROUTINE getComputerArchitectures(architectures, numArchitectures)
IMPLICIT NONE
INTEGER , INTENT(OUT) :: numArchitectures
CHARACTER(LEN=*), INTENT(OUT) :: architectures(11)
numArchitectures = 0
architectures = ''
#ifdef CPP_APC
numArchitectures = numArchitectures + 1
architectures(numArchitectures) = 'APC'
#endif
#ifdef CPP_DEC
numArchitectures = numArchitectures + 1
architectures(numArchitectures) = 'DEC'
#endif
#ifdef CPP_AIX
numArchitectures = numArchitectures + 1
architectures(numArchitectures) = 'AIX'
#endif
#ifdef CPP_T90
numArchitectures = numArchitectures + 1
#ifdef CPP_MPI
architectures(numArchitectures) = 'T3E'
#else
architectures(numArchitectures) = 'T90'
#endif
#endif
END SUBROUTINE getComputerArchitectures
SUBROUTINE getPrecision(precisionString)
IMPLICIT NONE
CHARACTER(LEN=*), INTENT(OUT) :: precisionString
#ifdef CPP_DOUBLE
precisionString = 'DOUBLE'
#else
precisionString = 'SINGLE'
#ifndef CPP_T90
CALL juDFT_error(" define CPP_DOUBLE on non-Cray architectures!",calledby ="dimens")
#endif
#endif
END SUBROUTINE getPrecision
SUBROUTINE getTargetStructureProperties(specifiers, numSpecifiers)
IMPLICIT NONE
INTEGER , INTENT(OUT) :: numSpecifiers
CHARACTER(LEN=*), INTENT(OUT) :: specifiers(11)
numSpecifiers = 0
specifiers = ''
numSpecifiers = numSpecifiers + 1
#ifdef CPP_INVERSION
specifiers(numSpecifiers) = "InversionSymmetry"
#else
specifiers(numSpecifiers) = "noInversionSymmetry"
#endif
numSpecifiers = numSpecifiers + 1
#ifdef CPP_SOC
specifiers(numSpecifiers) = "SpinOrbitCoupling"
#else
specifiers(numSpecifiers) = "noSpinOrbitCoupling"
#endif
END SUBROUTINE getTargetStructureProperties
SUBROUTINE getAdditionalCompilationFlags(flags, numFlags)
IMPLICIT NONE
INTEGER , INTENT(OUT) :: numFlags
CHARACTER(LEN=*), INTENT(OUT) :: flags(11)
numFlags = 0
flags = ''
#ifdef CPP_MPI
numFlags = numFlags + 1
flags(numFlags) = 'CPP_MPI'
#endif
#ifdef CPP_APW
numFlags = numFlags + 1
flags(numFlags) = 'CPP_APW'
#endif
#ifdef CPP_CORE
numFlags = numFlags + 1
flags(numFlags) = 'CPP_CORE'
#endif
#ifdef CPP_HTML
numFlags = numFlags + 1
flags(numFlags) = 'CPP_HTML'
#endif
#ifdef CPP_HDF
numFlags = numFlags + 1
flags(numFlags) = 'CPP_HDF'
#endif
#ifdef CPP_F90
numFlags = numFlags + 1
flags(numFlags) = 'CPP_F90'
#endif
#ifdef CPP_WANN
numFlags = numFlags + 1
flags(numFlags) = 'CPP_WANN'
#endif
#ifdef CPP_600
numFlags = numFlags + 1
flags(numFlags) = 'CPP_600'
#endif
#ifdef CPP_GF
numFlags = numFlags + 1
flags(numFlags) = 'CPP_GF'
#endif
#ifdef CPP_NOSPMVEC
numFlags = numFlags + 1
flags(numFlags) = '+NOSPMVEC'
#endif
#ifdef CPP_IRAPPROX
numFlags = numFlags + 1
flags(numFlags) = '+IRAPPROX'
#endif
END SUBROUTINE getAdditionalCompilationFlags
END MODULE m_utility
!--------------------------------------------------------------------------------
! 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_dimens
use m_juDFT
USE m_juDFT
USE m_utility
private
public :: dimens
CONTAINS
......@@ -236,7 +243,7 @@
SUBROUTINE priv_hello(ivers)
IMPLICIT NONE
CHARACTER(len=9), INTENT (IN) :: ivers
CHARACTER(len=9) :: cppflag(9)
CHARACTER(len=9) :: cppflag(11)
INTEGER :: i,j
WRITE (6,*) 'This output is generated by ',ivers,' * * '
#if ( defined(CPP_AIX) )
......@@ -248,27 +255,7 @@
WRITE (6,*) ' * * '
WRITE (6,*)
i = 0 ! First determine the architecture
#ifdef CPP_APC
i = i + 1
cppflag(i) = 'APC'
#endif
#ifdef CPP_DEC
i = i + 1
cppflag(i) = 'DEC'
#endif
#ifdef CPP_AIX
i = i + 1
cppflag(i) = 'AIX'
#endif
#ifdef CPP_T90
i = i + 1
#ifdef CPP_MPI
cppflag(i) = 'T3E'
#else
cppflag(i) = 'T90'
#endif
#endif
CALL getComputerArchitectures(cppflag,i) ! First determine the architecture
IF (i.GT.1) THEN
WRITE (6,*) 'You set compiler flags for more than one'
WRITE (6,*) 'architecture: ', (cppflag(j),j=1,i)
......@@ -283,15 +270,7 @@
!
! check for double precision etc.
!
#ifdef CPP_DOUBLE
cppflag(2) = 'DOUBLE'
#else
cppflag(2) = 'SINGLE'
#ifndef CPP_T90
CALL juDFT_error(" define CPP_DOUBLE on non-Cray architectures!"&
& ,calledby ="dimens")
#endif
#endif
CALL getPrecision(cppflag(2))
WRITE (6,'(16a,4a,5a,7a,11a)') 'You compiled for ',&
& trim(cppflag(1)),' with ',trim(cppflag(2)),' precision,'
#ifdef CPP_INVERSION
......@@ -306,51 +285,8 @@
#endif
WRITE (6,'(12a,7a,15a,7a,5a)') 'for systems ',&
& trim(cppflag(1)),' INVERSION and ',trim(cppflag(2)),' SOC.'
i = 0
#ifdef CPP_MPI
i = i + 1
cppflag(i) = 'CPP_MPI'
#endif
#ifdef CPP_APW
i = i + 1
cppflag(i) = 'CPP_APW'
#endif
#ifdef CPP_CORE
i = i + 1
cppflag(i) = 'CPP_CORE'
#endif
#ifdef CPP_HTML
i = i + 1
cppflag(i) = 'CPP_HTML'
#endif
#ifdef CPP_HDF
i = i + 1
cppflag(i) = 'CPP_HDF'
#endif
#ifdef CPP_F90
i = i + 1
cppflag(i) = 'CPP_F90'
#endif
#ifdef CPP_WANN
i = i + 1
cppflag(i) = 'CPP_WANN'
#endif
#ifdef CPP_600
i = i + 1
cppflag(i) = 'CPP_600'
#endif
#ifdef CPP_GF
i = i + 1
cppflag(i) = 'CPP_GF'
#endif
#ifdef CPP_NOSPMVEC
i = i + 1
cppflag(i) = '+NOSPMVEC'
#endif
#ifdef CPP_IRAPPROX
i = i + 1
cppflag(i) = '+IRAPPROX'
#endif
CALL getAdditionalCompilationFlags(cppflag,i)
IF (i.GT.0) THEN
WRITE (6,*) 'Additional flags are: ', (cppflag(j),j=1,i)
ENDIF
......
!--------------------------------------------------------------------------------
! 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_xmlOutput
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
......@@ -37,18 +43,23 @@ MODULE m_xmlOutput
SUBROUTINE startXMLOutput()
USE m_constants
USE m_utility
IMPLICIT NONE
#ifdef CPP_MPI
include "mpif.h"
INTEGER::err,isize
INTEGER :: err, isize
#endif
INTEGER :: numFlags
CHARACTER(LEN=8) :: date
CHARACTER(LEN=10) :: time
CHARACTER(LEN=10) :: zone
CHARACTER(LEN=10) :: zone
CHARACTER(LEN=10) :: dateString
CHARACTER(LEN=10) :: timeString
CHARACTER(LEN=10) :: timeString
CHARACTER(LEN=6) :: precisionString
CHARACTER(LEN=9) :: flags(11)
CHARACTER(LEN=20) :: structureSpecifiers(11)
maxNumElements = 10
ALLOCATE(elementList(maxNumElements))
......@@ -61,7 +72,25 @@ MODULE m_xmlOutput
OPEN (xmlOutputUnit,file='out.xml',form='formatted',status='unknown')
WRITE (xmlOutputUnit,'(a)') '<?xml version="1.0" encoding="UTF-8" standalone="no"?>'
WRITE (xmlOutputUnit,'(a)') '<fleurOutput fleurOutputVersion="0.27">'
CALL writeXMLElement('programVersion',(/'version'/),(/version_const/))
CALL openXMLElement('programVersion',(/'version'/),(/version_const/))
CALL getComputerArchitectures(flags, numFlags)
IF (numFlags.EQ.0) THEN
numFlags = 1
flags(numFlags) = 'GEN'
END IF
CALL writeXMLElementNoAttributes('targetComputerArchitectures',flags(1:numFlags))
IF (numFlags.GT.1) THEN
STOP "ERROR: Define only one system architecture! (called by xmlOutput)"
END IF
CALL getPrecision(precisionString)
CALL writeXMLElement('precision',(/'type'/),(/precisionString/))
CALL getTargetStructureProperties(structureSpecifiers, numFlags)
CALL writeXMLElementNoAttributes('targetStructureClass',structureSpecifiers(1:numFlags))
CALL getAdditionalCompilationFlags(flags, numFlags)
IF (numFlags.GE.1) THEN
CALL writeXMLElementNoAttributes('additionalCompilerFlags',flags(1:numFlags))
END IF
CALL closeXMLElement('programVersion')
#ifdef CPP_MPI
CALL MPI_COMM_SIZE(MPI_COMM_WORLD,isize,err)
CALL writeXMLElementPoly('parallelizationParameters',(/'mpiPEs'/),(/isize/))
......@@ -239,7 +268,7 @@ MODULE m_xmlOutput
ALLOCATE(contentLineList(contentLineListSize))
CALL fillContentLineList(contentList,contentLineList,contentLineLength)
IF(SIZE(contentLineList).LE.1) THEN
outputString = TRIM(ADJUSTL(outputString))//'>'//contentLineList(1)//'</'//&
outputString = TRIM(ADJUSTL(outputString))//'>'//TRIM(ADJUSTL(contentLineList(1)))//'</'//&
TRIM(ADJUSTL(elementName))//'>'
ELSE
outputString = TRIM(ADJUSTL(outputString))//'>'
......@@ -292,6 +321,55 @@ MODULE m_xmlOutput
END SUBROUTINE writeXMLElement
SUBROUTINE writeXMLElementNoAttributes(elementName,contentList)
IMPLICIT NONE
CHARACTER(LEN=*), INTENT(IN) :: elementName
CHARACTER(LEN=*), INTENT(IN) :: contentList(:)
CHARACTER(LEN=200), ALLOCATABLE :: contentLineList(:)
INTEGER :: i, j, contentLineLength, contentLineListSize
CHARACTER(LEN=70) :: format
CHARACTER(LEN=200) :: outputString
INTEGER :: contentListSize, overallListSize, numContentLineChars
outputString = '<'//TRIM(ADJUSTL(elementName))
WRITE(format,'(a,i0,a)') "(a",3*(currentElementIndex+1),",a)"
contentLineLength = 5 ! At most 5 data elements per line
contentLineListSize = SIZE(contentList) / contentLineLength
IF(contentLineListSize*contentLineLength.NE.SIZE(contentList)) THEN
contentLineListSize = contentLineListSize + 1
END IF
ALLOCATE(contentLineList(contentLineListSize))
CALL fillContentLineList(contentList,contentLineList,contentLineLength)
IF(contentLineListSize.LE.1) THEN
outputString = TRIM(ADJUSTL(outputString))//'>'//TRIM(ADJUSTL(contentLineList(1)))//'</'//&
TRIM(ADJUSTL(elementName))//'>'
ELSE
outputString = TRIM(ADJUSTL(outputString))//'>'
END IF
WRITE(xmlOutputUnit,format) ' ', TRIM(ADJUSTL(outputString))
IF(contentLineListSize.GT.1) THEN
DO i = 1, SIZE(contentLineList)
IF (i.EQ.SIZE(contentLineList)) THEN
numContentLineChars = 20*MOD(SIZE(contentList),contentLineLength)
IF(numContentLineChars.EQ.0) numContentLineChars = 20 * contentLineLength
WRITE(format,'(a,i0,a,i0,a)') "(a",3*(currentElementIndex+2),",a",numContentLineChars,")"
ELSE
WRITE(format,'(a,i0,a)') "(a",3*(currentElementIndex+2),",a100)"
END IF
WRITE(xmlOutputUnit,format) ' ', TRIM(ADJUSTL(contentLineList(i)))
END DO
WRITE(format,'(a,i0,a)') "(a",3*(currentElementIndex+1),",a)"
outputString = '</'//TRIM(ADJUSTL(elementName))//'>'
WRITE(xmlOutputUnit,format) ' ', TRIM(ADJUSTL(outputString))
END IF
END SUBROUTINE writeXMLElementNoAttributes
SUBROUTINE fillContentLineList(contentList,contentLineList,contentLineLength)
IMPLICIT NONE
......
!--------------------------------------------------------------------------------
! 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_init
USE m_judft_time
IMPLICIT NONE
......
......@@ -25,7 +25,6 @@
! Daniel Wortmann (2010)
!-----------------------------------------------
USE m_judft_time
USE m_xmlOutput
IMPLICIT NONE
PRIVATE
PUBLIC juDFT_error,juDFT_warn,juDFT_end
......@@ -119,6 +118,7 @@
END SUBROUTINE juDFT_warn
SUBROUTINE juDFT_END(message, irank)
USE m_xmlOutput
IMPLICIT NONE
#ifdef CPP_MPI
INCLUDE 'mpif.h'
......
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