same reporting style, more error checks
This commit is contained in:
parent
6f3771f6c4
commit
1ba27cf62d
|
@ -43,29 +43,30 @@ subroutine DAMASK_interface_init
|
||||||
|
|
||||||
implicit none
|
implicit none
|
||||||
integer, dimension(8) :: &
|
integer, dimension(8) :: &
|
||||||
dateAndTime ! type default integer
|
dateAndTime
|
||||||
integer :: lenOutDir,ierr
|
integer :: lenOutDir,ierr
|
||||||
character(len=256) :: wd
|
character(len=256) :: wd
|
||||||
|
|
||||||
call date_and_time(values = dateAndTime)
|
write(6,'(/,a)') ' <<<+- DAMASK_abaqus init -+>>>'
|
||||||
write(6,'(/,a)') ' <<<+- DAMASK_abaqus -+>>>'
|
|
||||||
write(6,'(/,a)') ' Roters et al., Computational Materials Science 158, 2018, 420-478'
|
|
||||||
write(6,'(a,/)') ' https://doi.org/10.1016/j.commatsci.2018.04.030'
|
|
||||||
|
|
||||||
write(6,'(a,/)') ' Version: '//DAMASKVERSION
|
write(6,'(/,a)') ' Roters et al., Computational Materials Science 158:420–478, 2018.'
|
||||||
|
write(6,'(a)') ' https://doi.org/10.1016/j.commatsci.2018.04.030'
|
||||||
|
|
||||||
|
write(6,'(/,a)') ' Version: '//DAMASKVERSION
|
||||||
|
|
||||||
! https://github.com/jeffhammond/HPCInfo/blob/master/docs/Preprocessor-Macros.md
|
! https://github.com/jeffhammond/HPCInfo/blob/master/docs/Preprocessor-Macros.md
|
||||||
#if __INTEL_COMPILER >= 1800
|
#if __INTEL_COMPILER >= 1800
|
||||||
write(6,*) 'Compiled with: ', compiler_version()
|
write(6,'(/,a)') 'Compiled with: '//compiler_version()
|
||||||
write(6,*) 'Compiler options: ', compiler_options()
|
write(6,'(a)') 'Compiler options: '//compiler_options()
|
||||||
#else
|
#else
|
||||||
write(6,'(a,i4.4,a,i8.8)') ' Compiled with Intel fortran version :', __INTEL_COMPILER,&
|
write(6,'(/,a,i4.4,a,i8.8)') ' Compiled with Intel fortran version :', __INTEL_COMPILER,&
|
||||||
', build date :', __INTEL_COMPILER_BUILD_DATE
|
', build date :', __INTEL_COMPILER_BUILD_DATE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
write(6,*) 'Compiled on ', __DATE__,' at ',__TIME__
|
write(6,'(/,a)') ' Compiled on: '//__DATE__//' at '//__TIME__
|
||||||
|
|
||||||
write(6,'(a,2(i2.2,a),i4.4)') ' Date: ',dateAndTime(3),'/',dateAndTime(2),'/', dateAndTime(1)
|
call date_and_time(values = dateAndTime)
|
||||||
|
write(6,'(/,a,2(i2.2,a),i4.4)') ' Date: ',dateAndTime(3),'/',dateAndTime(2),'/', dateAndTime(1)
|
||||||
write(6,'(a,2(i2.2,a),i2.2)') ' Time: ',dateAndTime(5),':', dateAndTime(6),':', dateAndTime(7)
|
write(6,'(a,2(i2.2,a),i2.2)') ' Time: ',dateAndTime(5),':', dateAndTime(6),':', dateAndTime(7)
|
||||||
|
|
||||||
call getoutdir(wd, lenOutDir)
|
call getoutdir(wd, lenOutDir)
|
||||||
|
@ -75,8 +76,6 @@ subroutine DAMASK_interface_init
|
||||||
call quit(1)
|
call quit(1)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
#include "compilation_info.f90"
|
|
||||||
|
|
||||||
end subroutine DAMASK_interface_init
|
end subroutine DAMASK_interface_init
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -45,6 +45,8 @@ subroutine DAMASK_interface_init()
|
||||||
use, intrinsic :: &
|
use, intrinsic :: &
|
||||||
iso_c_binding
|
iso_c_binding
|
||||||
use PETScSys
|
use PETScSys
|
||||||
|
use prec, only: &
|
||||||
|
pReal
|
||||||
use system_routines, only: &
|
use system_routines, only: &
|
||||||
signalusr1_C, &
|
signalusr1_C, &
|
||||||
signalusr2_C, &
|
signalusr2_C, &
|
||||||
|
@ -101,12 +103,14 @@ subroutine DAMASK_interface_init()
|
||||||
threadLevel, &
|
threadLevel, &
|
||||||
#endif
|
#endif
|
||||||
worldrank = 0, &
|
worldrank = 0, &
|
||||||
worldsize = 0
|
worldsize = 0, &
|
||||||
|
typeSize
|
||||||
integer, allocatable, dimension(:) :: &
|
integer, allocatable, dimension(:) :: &
|
||||||
chunkPos
|
chunkPos
|
||||||
integer, dimension(8) :: &
|
integer, dimension(8) :: &
|
||||||
dateAndTime
|
dateAndTime
|
||||||
PetscErrorCode :: ierr
|
integer :: mpi_err
|
||||||
|
PetscErrorCode :: petsc_err
|
||||||
external :: &
|
external :: &
|
||||||
quit
|
quit
|
||||||
|
|
||||||
|
@ -117,16 +121,21 @@ subroutine DAMASK_interface_init()
|
||||||
#ifdef _OPENMP
|
#ifdef _OPENMP
|
||||||
! If openMP is enabled, check if the MPI libary supports it and initialize accordingly.
|
! If openMP is enabled, check if the MPI libary supports it and initialize accordingly.
|
||||||
! Otherwise, the first call to PETSc will do the initialization.
|
! Otherwise, the first call to PETSc will do the initialization.
|
||||||
call MPI_Init_Thread(MPI_THREAD_FUNNELED,threadLevel,ierr);CHKERRQ(ierr)
|
call MPI_Init_Thread(MPI_THREAD_FUNNELED,threadLevel,mpi_err)
|
||||||
|
if (mpi_err /= 0) call quit(1)
|
||||||
if (threadLevel<MPI_THREAD_FUNNELED) then
|
if (threadLevel<MPI_THREAD_FUNNELED) then
|
||||||
write(6,'(a)') ' MPI library does not support OpenMP'
|
write(6,'(a)') ' MPI library does not support OpenMP'
|
||||||
call quit(1)
|
call quit(1)
|
||||||
endif
|
endif
|
||||||
#endif
|
#endif
|
||||||
call PETScInitialize(PETSC_NULL_CHARACTER,ierr) ! according to PETSc manual, that should be the first line in the code
|
call PETScInitialize(PETSC_NULL_CHARACTER,petsc_err) ! according to PETSc manual, that should be the first line in the code
|
||||||
CHKERRQ(ierr) ! this is a macro definition, it is case sensitive
|
CHKERRQ(petsc_err) ! this is a macro definition, it is case sensitive
|
||||||
call MPI_Comm_rank(PETSC_COMM_WORLD,worldrank,ierr);CHKERRQ(ierr)
|
|
||||||
call MPI_Comm_size(PETSC_COMM_WORLD,worldsize,ierr);CHKERRQ(ierr)
|
call MPI_Comm_rank(PETSC_COMM_WORLD,worldrank,mpi_err)
|
||||||
|
if (mpi_err /= 0) call quit(1)
|
||||||
|
call MPI_Comm_size(PETSC_COMM_WORLD,worldsize,mpi_err)
|
||||||
|
if (mpi_err /= 0) call quit(1)
|
||||||
|
|
||||||
mainProcess: if (worldrank == 0) then
|
mainProcess: if (worldrank == 0) then
|
||||||
if (output_unit /= 6) then
|
if (output_unit /= 6) then
|
||||||
write(output_unit,'(a)') ' STDOUT != 6'
|
write(output_unit,'(a)') ' STDOUT != 6'
|
||||||
|
@ -141,30 +150,45 @@ subroutine DAMASK_interface_init()
|
||||||
open(6,file='/dev/null',status='replace') ! close(6) alone will leave some temp files in cwd
|
open(6,file='/dev/null',status='replace') ! close(6) alone will leave some temp files in cwd
|
||||||
endif mainProcess
|
endif mainProcess
|
||||||
|
|
||||||
call date_and_time(values = dateAndTime)
|
|
||||||
write(6,'(/,a)') ' <<<+- DAMASK_interface init -+>>>'
|
write(6,'(/,a)') ' <<<+- DAMASK_interface init -+>>>'
|
||||||
write(6,'(/,a)') ' Roters et al., Computational Materials Science 158, 2018, 420-478'
|
|
||||||
write(6,'(a,/)') ' https://doi.org/10.1016/j.commatsci.2018.04.030'
|
|
||||||
|
|
||||||
write(6,'(a,/)') ' Version: '//DAMASKVERSION
|
write(6,'(/,a)') ' Roters et al., Computational Materials Science 158:420–478, 2018.'
|
||||||
|
write(6,'(a)') ' https://doi.org/10.1016/j.commatsci.2018.04.030'
|
||||||
|
|
||||||
|
write(6,'(/,a)') ' Version: '//DAMASKVERSION
|
||||||
|
|
||||||
! https://github.com/jeffhammond/HPCInfo/blob/master/docs/Preprocessor-Macros.md
|
! https://github.com/jeffhammond/HPCInfo/blob/master/docs/Preprocessor-Macros.md
|
||||||
#if defined(__GFORTRAN__) || __INTEL_COMPILER >= 1800
|
#if defined(__GFORTRAN__) || __INTEL_COMPILER >= 1800
|
||||||
write(6,*) 'Compiled with: ', compiler_version()
|
write(6,'(/,a)') 'Compiled with: '//compiler_version()
|
||||||
write(6,*) 'Compiler options: ', compiler_options()
|
write(6,'(a)') 'Compiler options: '//compiler_options()
|
||||||
#elif defined(__INTEL_COMPILER)
|
#elif defined(__INTEL_COMPILER)
|
||||||
write(6,'(a,i4.4,a,i8.8)') ' Compiled with Intel fortran version :', __INTEL_COMPILER,&
|
write(6,'(/,a,i4.4,a,i8.8)') ' Compiled with Intel fortran version :', __INTEL_COMPILER,&
|
||||||
', build date :', __INTEL_COMPILER_BUILD_DATE
|
', build date :', __INTEL_COMPILER_BUILD_DATE
|
||||||
#elif defined(__PGI)
|
#elif defined(__PGI)
|
||||||
write(6,'(a,i4.4,a,i8.8)') ' Compiled with PGI fortran version :', __PGIC__,&
|
write(6,'(a,i4.4,a,i8.8)') ' Compiled with PGI fortran version :', __PGIC__,&
|
||||||
'.', __PGIC_MINOR__
|
'.', __PGIC_MINOR__
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
write(6,*) 'Compiled on ', __DATE__,' at ',__TIME__
|
write(6,'(/,a)') ' Compiled on: '//__DATE__//' at '//__TIME__
|
||||||
|
|
||||||
write(6,'(a,2(i2.2,a),i4.4)') ' Date: ',dateAndTime(3),'/',dateAndTime(2),'/', dateAndTime(1)
|
call date_and_time(values = dateAndTime)
|
||||||
|
write(6,'(/,a,2(i2.2,a),i4.4)') ' Date: ',dateAndTime(3),'/',dateAndTime(2),'/', dateAndTime(1)
|
||||||
write(6,'(a,2(i2.2,a),i2.2)') ' Time: ',dateAndTime(5),':', dateAndTime(6),':', dateAndTime(7)
|
write(6,'(a,2(i2.2,a),i2.2)') ' Time: ',dateAndTime(5),':', dateAndTime(6),':', dateAndTime(7)
|
||||||
|
|
||||||
|
call MPI_Type_size(MPI_INTEGER,typeSize,mpi_err)
|
||||||
|
if (mpi_err /= 0) call quit(1)
|
||||||
|
if (typeSize*8 /= bit_size(0)) then
|
||||||
|
write(6,'(a)') ' Mismatch between MPI and DAMASK integer'
|
||||||
|
call quit(1)
|
||||||
|
endif
|
||||||
|
|
||||||
|
call MPI_Type_size(MPI_DOUBLE,typeSize,mpi_err)
|
||||||
|
if (mpi_err /= 0) call quit(1)
|
||||||
|
if (typeSize*8 /= storage_size(0.0_pReal)) then
|
||||||
|
write(6,'(a)') ' Mismatch between MPI and DAMASK real'
|
||||||
|
call quit(1)
|
||||||
|
endif
|
||||||
|
|
||||||
call get_command(commandLine)
|
call get_command(commandLine)
|
||||||
chunkPos = IIO_stringPos(commandLine)
|
chunkPos = IIO_stringPos(commandLine)
|
||||||
do i = 2, chunkPos(1)
|
do i = 2, chunkPos(1)
|
||||||
|
|
|
@ -54,32 +54,33 @@ subroutine DAMASK_interface_init
|
||||||
|
|
||||||
implicit none
|
implicit none
|
||||||
integer, dimension(8) :: &
|
integer, dimension(8) :: &
|
||||||
dateAndTime ! type default integer
|
dateAndTime
|
||||||
integer :: ierr
|
integer :: ierr
|
||||||
character(len=1024) :: wd
|
character(len=1024) :: wd
|
||||||
|
|
||||||
call date_and_time(values = dateAndTime)
|
write(6,'(/,a)') ' <<<+- DAMASK_marc init -+>>>'
|
||||||
write(6,'(/,a)') ' <<<+- DAMASK_abaqus -+>>>'
|
|
||||||
write(6,'(/,a)') ' Roters et al., Computational Materials Science 158, 2018, 420-478'
|
|
||||||
write(6,'(a,/)') ' https://doi.org/10.1016/j.commatsci.2018.04.030'
|
|
||||||
|
|
||||||
write(6,'(a,/)') ' Version: '//DAMASKVERSION
|
write(6,'(/,a)') ' Roters et al., Computational Materials Science 158:420–478, 2018.'
|
||||||
|
write(6,'(a)') ' https://doi.org/10.1016/j.commatsci.2018.04.030'
|
||||||
|
|
||||||
! https://github.com/jeffhammond/HPCInfo/blob/master/docs/Preprocessor-Macros.md
|
write(6,'(/,a)') ' Version: '//DAMASKVERSION
|
||||||
|
|
||||||
|
! https://github.com/jeffhammond/HPCInfo/blob/master/docs/Preprocessor-Macros.md
|
||||||
#if __INTEL_COMPILER >= 1800
|
#if __INTEL_COMPILER >= 1800
|
||||||
write(6,*) 'Compiled with: ', compiler_version()
|
write(6,'(/,a)') 'Compiled with: '//compiler_version()
|
||||||
write(6,*) 'Compiler options: ', compiler_options()
|
write(6,'(a)') 'Compiler options: '//compiler_options()
|
||||||
#else
|
#else
|
||||||
write(6,'(a,i4.4,a,i8.8)') ' Compiled with Intel fortran version :', __INTEL_COMPILER,&
|
write(6,'(/,a,i4.4,a,i8.8)') ' Compiled with Intel fortran version :', __INTEL_COMPILER,&
|
||||||
', build date :', __INTEL_COMPILER_BUILD_DATE
|
', build date :', __INTEL_COMPILER_BUILD_DATE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
write(6,*) 'Compiled on ', __DATE__,' at ',__TIME__
|
write(6,'(/,a)') ' Compiled on: '//__DATE__//' at '//__TIME__
|
||||||
|
|
||||||
write(6,'(a,2(i2.2,a),i4.4)') ' Date: ',dateAndTime(3),'/',dateAndTime(2),'/', dateAndTime(1)
|
call date_and_time(values = dateAndTime)
|
||||||
|
write(6,'(/,a,2(i2.2,a),i4.4)') ' Date: ',dateAndTime(3),'/',dateAndTime(2),'/', dateAndTime(1)
|
||||||
write(6,'(a,2(i2.2,a),i2.2)') ' Time: ',dateAndTime(5),':', dateAndTime(6),':', dateAndTime(7)
|
write(6,'(a,2(i2.2,a),i2.2)') ' Time: ',dateAndTime(5),':', dateAndTime(6),':', dateAndTime(7)
|
||||||
|
|
||||||
inquire(5, name=wd) ! determine inputputfile
|
inquire(5, name=wd)
|
||||||
wd = wd(1:scan(wd,'/',back=.true.))
|
wd = wd(1:scan(wd,'/',back=.true.))
|
||||||
ierr = CHDIR(wd)
|
ierr = CHDIR(wd)
|
||||||
if (ierr /= 0) then
|
if (ierr /= 0) then
|
||||||
|
|
Loading…
Reference in New Issue