Commit 7e655f0b authored by Matthias Redies's avatar Matthias Redies

merge saveguards

parent 5f27a13c
...@@ -39,7 +39,7 @@ time.F90 ...@@ -39,7 +39,7 @@ time.F90
args.F90 args.F90
sysinfo.F90 sysinfo.F90
check_arguments.F90 check_arguments.F90
check_para.f90 check_para.F90
xmlOutput.F90 xmlOutput.F90
) )
if (JUDFT_USE_MPI) if (JUDFT_USE_MPI)
......
...@@ -3,7 +3,26 @@ MODULE m_judft_para ...@@ -3,7 +3,26 @@ MODULE m_judft_para
CONTAINS CONTAINS
subroutine juDFT_check_para() subroutine juDFT_check_para()
implicit none implicit none
call check_omp_para() logical :: omp_para_loc, omp_root_and
integer :: irank, ierr
#ifdef CPP_MPI
INCLUDE 'mpif.h'
call MPI_COMM_RANK(MPI_COMM_WORLD, irank, ierr)
omp_para_loc = check_omp_para()
call MPI_Reduce(omp_para_loc, omp_root_and, 1,&
MPI_LOGICAL, MPI_LAND, 0, MPI_COMM_WORLD)
if(irank == 0 .and. omp_root_and) then
write (*,*) "Parallelization OK"
endif
#else
omp_para_loc = check_omp_para()
if(omp_para_loc) write (*,*) "Parallelization OK"
#endif
end subroutine juDFT_check_para end subroutine juDFT_check_para
!subroutine check_mpi_para(mpi) !subroutine check_mpi_para(mpi)
...@@ -38,15 +57,15 @@ CONTAINS ...@@ -38,15 +57,15 @@ CONTAINS
!end subroutine check_mpi_para !end subroutine check_mpi_para
function check_omp_para() result(parallel_ok)
subroutine check_omp_para()
use omp_lib use omp_lib
use m_judft_string use m_judft_string
use m_judft_stop use m_judft_stop
implicit none implicit none
real(8) :: summe, t_omp, t_seq logical :: parallel_ok
integer(4) :: rank, size, ierr real(8) :: summe, t_omp, t_seq
integer :: i, omp_threads integer(4) :: rank, size, ierr
integer :: i, omp_threads
integer, parameter :: loop_end = 300000000 integer, parameter :: loop_end = 300000000
summe = 0.0 summe = 0.0
...@@ -72,7 +91,7 @@ CONTAINS ...@@ -72,7 +91,7 @@ CONTAINS
t_seq = OMP_GET_WTIME() - t_seq t_seq = OMP_GET_WTIME() - t_seq
if( abs(t_seq/t_omp -1.0) < 0.1)then if( abs(t_seq/t_omp -1.0) < 0.1)then
write (*,*) "Parallelization OK" parallel_ok = .True.
else else
write (*,*) "number of OMPs = ", omp_threads write (*,*) "number of OMPs = ", omp_threads
write (*,*) "t_omp = ", t_omp write (*,*) "t_omp = ", t_omp
...@@ -81,7 +100,8 @@ CONTAINS ...@@ -81,7 +100,8 @@ CONTAINS
call juDFT_warn("OMP parallelization underperform with a parallel efficiency of " // & call juDFT_warn("OMP parallelization underperform with a parallel efficiency of " // &
float2str(t_seq/t_omp), hint="check if your slurm files is set properly") float2str(t_seq/t_omp), hint="check if your slurm files is set properly")
parallel_ok = .False.
endif endif
end subroutine check_omp_para end function check_omp_para
END MODULE m_judft_para END MODULE m_judft_para
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