LCOV - code coverage report
Current view: top level - io - xmlOutput.F90 (source / functions) Hit Total Coverage
Test: combined.info Lines: 46 47 97.9 %
Date: 2019-09-08 04:53:50 Functions: 1 1 100.0 %

          Line data    Source code
       1             : !--------------------------------------------------------------------------------
       2             : ! Copyright (c) 2016 Peter Grünberg Institut, Forschungszentrum Jülich, Germany
       3             : ! This file is part of FLEUR and available as free software under the conditions
       4             : ! of the MIT license as expressed in the LICENSE file in more detail.
       5             : !--------------------------------------------------------------------------------
       6             : 
       7             : MODULE m_xmlOutput
       8             :   USE m_judft_xmlOutput !most functionality is actually there
       9             : !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
      10             : !!!
      11             : !!!   XML output service routines
      12             : !!!
      13             : !!!   This module provides several subroutines that simplify the
      14             : !!!   generation of the out.xml file.
      15             : !!!                                         GM'16
      16             : !!!
      17             : !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
      18             : 
      19             :    IMPLICIT NONE
      20             :  
      21             :    CONTAINS
      22             : 
      23          38 :    SUBROUTINE startfleur_XMLOutput()
      24             :      USE m_judft_xmloutput
      25             :       USE m_juDFT_args
      26             :       USE m_juDFT_usage
      27             :       USE m_constants
      28             :       USE m_utility
      29             :       USE m_compile_descr
      30             : !$    use omp_lib
      31             :       
      32             :       IMPLICIT NONE
      33             : 
      34             : #ifdef CPP_MPI
      35             :       include "mpif.h"
      36             :       INTEGER           :: err, isize
      37             : #endif
      38             :       INTEGER           :: numFlags
      39             :       INTEGER           :: nOMPThreads
      40             :       CHARACTER(LEN=8)  :: date
      41             :       CHARACTER(LEN=10) :: time
      42             :       CHARACTER(LEN=10) :: zone
      43             :       CHARACTER(LEN=10) :: dateString
      44             :       CHARACTER(LEN=10) :: timeString
      45             :       CHARACTER(LEN=6)  :: precisionString
      46             :       CHARACTER(LEN=9)  :: flags(11)
      47             :       CHARACTER(LEN=20) :: structureSpecifiers(11)
      48          76 :       CHARACTER(:), ALLOCATABLE :: gitdesc,githash,gitbranch,compile_date,compile_user,compile_host
      49          76 :       CHARACTER(:), ALLOCATABLE :: compile_flags,link_flags
      50             :       CHARACTER(LEN=1000) :: gitdescTemp,githashTemp,gitbranchTemp,compile_dateTemp,compile_userTemp,compile_hostTemp
      51             :       CHARACTER(LEN=1000) :: compile_flagsTemp,link_flagsTemp
      52             :       CHARACTER(LEN=20) :: attributes(7)
      53             :       
      54          38 :       CALL startxmloutput("out.xml","fleurOutput")
      55          38 :       CALL openXMLElement('programVersion',(/'version'/),(/version_const/))
      56          38 :       CALL get_compile_desc(gitdesc,githash,gitbranch,compile_date,compile_user,compile_host,compile_flags,link_flags)
      57          38 :       gitdescTemp = gitdesc
      58          38 :       githashTemp = githash
      59          38 :       CALL add_usage_data("githash", githash)
      60          38 :       gitbranchTemp = gitbranch
      61          38 :       compile_dateTemp = compile_date
      62          38 :       compile_userTemp = compile_user
      63          38 :       compile_hostTemp = compile_host
      64          38 :       compile_flagsTemp = compile_flags
      65          38 :       link_flagsTemp = link_flags
      66          38 :       CALL writeXMLElement('compilationInfo',(/'date','user','host','flag','link'/),(/compile_dateTemp,compile_userTemp,compile_hostTemp,compile_flagsTemp,link_flagsTemp/))
      67          38 :       CALL writeXMLElement('gitInfo',(/'version       ','branch        ','lastCommitHash'/),(/gitdescTemp,gitbranchTemp,githashTemp/))
      68          38 :       CALL getComputerArchitectures(flags, numFlags)
      69          38 :       IF (numFlags.EQ.0) THEN
      70          38 :          numFlags = 1
      71          38 :          flags(numFlags) = 'GEN'
      72             :       END IF
      73          38 :       CALL writeXMLElementNoAttributes('targetComputerArchitectures',flags(1:numFlags))
      74          38 :       IF (numFlags.GT.1) THEN 
      75           0 :          STOP "ERROR: Define only one system architecture! (called by xmlOutput)"
      76             :       END IF
      77          38 :       CALL getPrecision(precisionString)
      78          38 :       CALL writeXMLElement('precision',(/'type'/),(/precisionString/))
      79          38 :       CALL getTargetStructureProperties(structureSpecifiers, numFlags)
      80          38 :       CALL writeXMLElementNoAttributes('targetStructureClass',structureSpecifiers(1:numFlags))
      81          38 :       CALL getAdditionalCompilationFlags(flags, numFlags)
      82          38 :       IF (numFlags.GE.1) THEN
      83          38 :          CALL writeXMLElementNoAttributes('additionalCompilerFlags',flags(1:numFlags))
      84             :       END IF
      85          38 :       CALL closeXMLElement('programVersion')
      86             : 
      87          38 :       CALL openXMLElementNoAttributes('parallelSetup')
      88          38 :       nOMPThreads = -1
      89          38 :       !$ nOMPThreads=omp_get_max_threads()
      90          38 :       IF(nOMPThreads.NE.-1) THEN
      91          38 :          WRITE(attributes(1),'(i0)') nOMPThreads
      92             :          CALL writeXMLElementFormPoly('openMP',(/'ompThreads'/),&
      93          38 :                                       attributes(:1),reshape((/10,8/),(/1,2/)))
      94             :       END IF
      95             : 
      96             : #ifdef CPP_MPI
      97          38 :       CALL MPI_COMM_SIZE(MPI_COMM_WORLD,isize,err)
      98          38 :       WRITE(attributes(1),'(i0)') isize
      99             :       CALL writeXMLElementFormPoly('mpi',(/'mpiProcesses'/),&
     100          38 :                                    attributes(:1),reshape((/13,8/),(/1,2/)))
     101             : #endif
     102          38 :       CALL closeXMLElement('parallelSetup')
     103             :       
     104          38 :       CALL DATE_AND_TIME(date,time,zone)
     105          38 :       WRITE(dateString,'(a4,a1,a2,a1,a2)') date(1:4),'/',date(5:6),'/',date(7:8)
     106          38 :       WRITE(timeString,'(a2,a1,a2,a1,a2)') time(1:2),':',time(3:4),':',time(5:6)
     107          38 :       CALL writeXMLElement('startDateAndTime',(/'date','time','zone'/),(/dateString,timeString,zone/))
     108          38 :     END SUBROUTINE startfleur_XMLOutput
     109             : 
     110             : END MODULE m_xmlOutput

Generated by: LCOV version 1.13