Commit 3d6aa535 authored by Gregor Michalicek's avatar Gregor Michalicek

First approach to reduce error output for certain types of normal program termination

parent 9815cfeb
...@@ -124,16 +124,23 @@ ...@@ -124,16 +124,23 @@
END SUBROUTINE juDFT_warn END SUBROUTINE juDFT_warn
SUBROUTINE juDFT_END(message, irank) SUBROUTINE juDFT_END(message, irank)
! If irank is present every mpi process has to call this routine.
! Otherwise only a single mpi process is allowed to call the routine.
USE m_xmlOutput USE m_xmlOutput
IMPLICIT NONE IMPLICIT NONE
#ifdef CPP_MPI #ifdef CPP_MPI
INCLUDE 'mpif.h' INCLUDE 'mpif.h'
INTEGER :: ierr INTEGER :: ierr
#endif #endif
CHARACTER*(*) :: message CHARACTER*(*), INTENT(IN) :: message
INTEGER, INTENT(IN) :: irank INTEGER, OPTIONAL, INTENT(IN) :: irank
IF (irank.EQ.0) CALL endXMLOutput() IF(PRESENT(irank)) THEN
IF (irank.EQ.0) CALL endXMLOutput()
ELSE
! It is assumed that this is the only mpi process calling this routine.
CALL endXMLOutput()
END IF
WRITE(0,*) "*****************************************" WRITE(0,*) "*****************************************"
WRITE(0,*) "Run finished successfully" WRITE(0,*) "Run finished successfully"
...@@ -143,25 +150,35 @@ ...@@ -143,25 +150,35 @@
CALL writetimes() CALL writetimes()
CALL priv_memory_info() CALL priv_memory_info()
#ifdef CPP_MPI #ifdef CPP_MPI
CALL MPI_BARRIER(MPI_COMM_WORLD,ierr) IF(PRESENT(irank)) THEN
CALL MPI_FINALIZE(ierr) CALL MPI_BARRIER(MPI_COMM_WORLD,ierr)
CALL MPI_FINALIZE(ierr)
END IF
#endif #endif
CALL juDFT_STOP(0)
STOP 'OK' STOP 'OK'
END SUBROUTINE juDFT_END END SUBROUTINE juDFT_END
!this is a private subroutine that stops the calculations !this is a private subroutine that stops the calculations
!different compilers might have to be added here !different compilers might have to be added here
SUBROUTINE juDFT_stop() SUBROUTINE juDFT_stop(errorCode)
#ifdef __INTEL_COMPILER #ifdef __INTEL_COMPILER
USE ifcore USE ifcore
#endif #endif
#ifdef CPP_MPI #ifdef CPP_MPI
INCLUDE 'mpif.h' INCLUDE 'mpif.h'
INTEGER :: ierr
#endif #endif
INTEGER, OPTIONAL, INTENT(IN) :: errorCode
INTEGER :: error
LOGICAL :: calltrace LOGICAL :: calltrace
#ifdef CPP_MPI
INTEGER :: ierr
#endif
error = 1
IF(PRESENT(errorCode)) THEN
error = errorCode
END IF
!try to print times !try to print times
!call writelocation() !call writelocation()
!CALL writetimes(.true.) !CALL writetimes(.true.)
...@@ -175,7 +192,14 @@ ...@@ -175,7 +192,14 @@
ENDIF ENDIF
#if defined(CPP_MPI) #if defined(CPP_MPI)
CALL MPI_ABORT(MPI_COMM_WORLD,1,ierr) IF(error.EQ.0) THEN
WRITE(0,*) ""
WRITE(0,*) "Terminating all MPI processes."
WRITE(0,*) "Note: This is a normal procedure."
WRITE(0,*) " Error messages in the following lines can be ignored."
WRITE(0,*) ""
END IF
CALL MPI_ABORT(MPI_COMM_WORLD,error,ierr)
#endif #endif
STOP 'juDFT-STOPPED' STOP 'juDFT-STOPPED'
END SUBROUTINE juDFT_stop END SUBROUTINE juDFT_stop
......
...@@ -41,7 +41,7 @@ MODULE m_fleur_info ...@@ -41,7 +41,7 @@ MODULE m_fleur_info
WRITE(*,*) '' WRITE(*,*) ''
CALL printDensityFileInfo() CALL printDensityFileInfo()
WRITE(*,*) '=================================================' WRITE(*,*) '================================================='
CALL juDFT_error("Fleur info output completed") CALL juDFT_end("Fleur info output completed")
END SUBROUTINE fleur_info END SUBROUTINE fleur_info
END MODULE m_fleur_info END MODULE m_fleur_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