From 9be76d3ed6d0b580bf069459e4bab2faccc537f2 Mon Sep 17 00:00:00 2001 From: "Paul F. Baumeister" <p.baumeister@fz-juelich.de> Date: Fri, 10 Sep 2021 10:23:29 +0200 Subject: [PATCH] update code activated by -D DEBUG macro in TYPE=debug Makefile option --- source/KKRnano/source/Makefile | 14 ++++++++------ source/KKRnano/source/RefCluster_mod.F90 | 2 +- .../source/madelung/MadelungCalculator_mod.F90 | 2 +- .../KKRnano/source/parallel/KKRnano_Comm_mod.F90 | 1 + 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/source/KKRnano/source/Makefile b/source/KKRnano/source/Makefile index cfb93cf13..759599018 100644 --- a/source/KKRnano/source/Makefile +++ b/source/KKRnano/source/Makefile @@ -26,6 +26,10 @@ FC90FLAGS = FCFLAGS = PPFLAGS = PPFLAGS += -D USE_VOROWEIGHTS +ifeq ($(TYPE),debug) + PPFLAGS += -D DEBUG +endif +# PPFLAGS += -D NDEBUG # PPFLAGS += -D BENCHMARK_tfQMR # PPFLAGS += -D EXPORT_tfQMR_PROBLEM @@ -33,7 +37,6 @@ PPFLAGS += -D USE_VOROWEIGHTS # PPFLAGS += -D TRANSPOSE_TO_ROW_MAJOR ### TRANSPOSE_TO_ROW_MAJOR seems to work, however, there was a bug in col_norms about the non-linearity of DZNRM2, so we have to see which references went wrong #PPFLAGS += -D SUPERCELL_ELECTROSTATICS=8 -# -D NDEBUG LDFLAGS = # ========= IFF Workstations ============ @@ -42,9 +45,9 @@ ifeq ($(PLATFORM),ifort) FC = mpiifort -warn all FC90 = mpiifort -warn all # -module <path> specifies where to put .mod files - ifeq ($(SMP),openmp) - FCFLAGS += -qopenmp - endif + ifeq ($(SMP),openmp) + FCFLAGS += -qopenmp + endif FCFLAGS += -module $(BUILDDIR) FCFLAGS += -I $(BUILDDIR) # PPFLAGS += -D TASKLOCAL_FILES @@ -62,7 +65,7 @@ ifeq ($(PLATFORM),ifort) FCFLAGS += -O0 -g -check bounds -traceback -debug all -check all PPFLAGS += -D USE_MTRADII -D USE_OLD_MESH -D NOLOGGING else ifeq ($(TYPE),voronoi_mesh) - FCFLAGS += -O2 + FCFLAGS += -O2 PPFLAGS += -D NOLOGGING -D USE_OLD_MESH else ifeq ($(TYPE),voronoi_mesh_debug) FCFLAGS += -O0 -g -check bounds -traceback -debug all -check all -fpe1 @@ -73,7 +76,6 @@ ifeq ($(PLATFORM),ifort) else ifeq ($(TYPE),voronoi_mesh_print_mtradii) FCFLAGS += -O0 -g PPFLAGS += -D NOLOGGING -D USE_OLD_MESH -D PRINT_MTRADII - else FCFLAGS += -O2 PPFLAGS += -D NOLOGGING diff --git a/source/KKRnano/source/RefCluster_mod.F90 b/source/KKRnano/source/RefCluster_mod.F90 index 1199b1157..67ee595f1 100644 --- a/source/KKRnano/source/RefCluster_mod.F90 +++ b/source/KKRnano/source/RefCluster_mod.F90 @@ -166,7 +166,7 @@ module RefCluster_mod #ifdef DEBUG write(*,'(a,2(i0,a),9999(" ",i0))') 'for atom #',source_atom_index,' indn0(1:',self%numn0,') =',self%indn0(:) - write(*,'(a,3F16.12)') 'rcls(:,1) = ',rcls(1:3,1) + write(*,'(a,3F16.12)') 'rcls(:,1) = ',self%rcls(1:3,1) #endif ! todo: display some statistics #ifdef DEBUG diff --git a/source/KKRnano/source/madelung/MadelungCalculator_mod.F90 b/source/KKRnano/source/madelung/MadelungCalculator_mod.F90 index 7eeafff7e..da8839117 100644 --- a/source/KKRnano/source/madelung/MadelungCalculator_mod.F90 +++ b/source/KKRnano/source/madelung/MadelungCalculator_mod.F90 @@ -886,7 +886,7 @@ module MadelungCalculator_mod det = determinant3x3_r(a) if(det == 0.) then #ifdef DEBUG - if(o>0) write(o,'(9A)') sym,' invert3x3: determinant = 0.' + write(*,'(9A)') ' invert3x3: determinant = 0.' #endif inverse = 0. return diff --git a/source/KKRnano/source/parallel/KKRnano_Comm_mod.F90 b/source/KKRnano/source/parallel/KKRnano_Comm_mod.F90 index fbe5f4e67..76d54bfa3 100644 --- a/source/KKRnano/source/parallel/KKRnano_Comm_mod.F90 +++ b/source/KKRnano/source/parallel/KKRnano_Comm_mod.F90 @@ -79,6 +79,7 @@ module KKRnano_Comm_mod !> Set the number of OpenMP threads to nthrds. subroutine setKKRnanoNumThreads(nthrds) integer, intent(in) :: nthrds +!$ external :: OMP_SET_NUM_THREADS if (nthrds > 0) then !$ call OMP_SET_NUM_THREADS(NTHRDS) endif ! nthrds > 0 -- GitLab