Skip to content

Commit

Permalink
Cleanup USE OMP_LIB directives
Browse files Browse the repository at this point in the history
  • Loading branch information
hfp committed Oct 16, 2024
1 parent 66eb88e commit 6769fbd
Show file tree
Hide file tree
Showing 32 changed files with 17 additions and 51 deletions.
2 changes: 1 addition & 1 deletion src/acc/cuda/dbcsr_cuda_profiling.F
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ MODULE dbcsr_cuda_profiling
int_8
#include "base/dbcsr_base_uses.f90"

!$ USE OMP_LIB, ONLY: omp_get_max_threads, omp_get_thread_num, omp_get_num_threads
!$ USE OMP_LIB, ONLY: omp_get_thread_num

IMPLICIT NONE

Expand Down
4 changes: 2 additions & 2 deletions src/base/dbcsr_machine.F
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ MODULE dbcsr_machine
m_abort, m_chdir, m_flush_internal => m_flush, m_getarg, m_getcwd, m_getlog, m_getpid, &
m_hostnm, m_iargc, m_memory, m_memory_details, m_memory_max, m_mov, m_procrun

!$ USE OMP_LIB, ONLY: omp_get_max_threads, omp_get_thread_num, omp_get_num_threads, OMP_GET_WTIME
!$ USE OMP_LIB, ONLY: omp_get_wtime

IMPLICIT NONE

Expand Down Expand Up @@ -100,7 +100,7 @@ FUNCTION m_walltime() RESULT(wt)
wt = (REAL(count, KIND=dp) + REAL(cycles, KIND=dp)*(1.0_dp + REAL(count_max, KIND=dp))) &
/REAL(count_rate, KIND=dp)
!$ ELSE
!$ wt = OMP_GET_WTIME()
!$ wt = omp_get_wtime()
!$ END IF
#endif
END FUNCTION m_walltime
Expand Down
2 changes: 1 addition & 1 deletion src/block/dbcsr_block_access.F
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ MODULE dbcsr_block_access
real_8
#include "base/dbcsr_base_uses.f90"

!$ USE OMP_LIB, ONLY: omp_get_max_threads, omp_get_thread_num, omp_get_num_threads
!$ USE OMP_LIB, ONLY: omp_get_thread_num, omp_get_num_threads

IMPLICIT NONE

Expand Down
1 change: 0 additions & 1 deletion src/block/dbcsr_block_operations.F
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ MODULE dbcsr_block_operations
sp
#include "base/dbcsr_base_uses.f90"

!$ USE OMP_LIB, ONLY: omp_get_max_threads, omp_get_thread_num, omp_get_num_threads
IMPLICIT NONE
#if defined(__LIBXSMM) && TO_VERSION(1, 10) < TO_VERSION(LIBXSMM_CONFIG_VERSION_MAJOR, LIBXSMM_CONFIG_VERSION_MINOR)
# define __LIBXSMM_BLOCKOPS
Expand Down
2 changes: 1 addition & 1 deletion src/block/dbcsr_iterator_operations.F
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ MODULE dbcsr_iterator_operations
real_8
#include "base/dbcsr_base_uses.f90"

!$ USE OMP_LIB, ONLY: omp_get_max_threads, omp_get_thread_num, omp_get_num_threads, omp_in_parallel
!$ USE OMP_LIB, ONLY: omp_get_thread_num, omp_get_num_threads, omp_in_parallel

IMPLICIT NONE

Expand Down
2 changes: 0 additions & 2 deletions src/core/dbcsr_lib.F
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@ MODULE dbcsr_lib

#include "base/dbcsr_base_uses.f90"

!$ USE OMP_LIB, ONLY: omp_get_thread_num, omp_get_num_threads

#if defined (__DBCSR_ACC)
USE ISO_C_BINDING, ONLY: C_INT
#endif
Expand Down
1 change: 0 additions & 1 deletion src/core/dbcsr_methods.F
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ MODULE dbcsr_methods
dbcsr_type_real_8, dbcsr_type_symmetric, dbcsr_work_type
#include "base/dbcsr_base_uses.f90"

!$ USE OMP_LIB, ONLY: omp_get_max_threads, omp_get_thread_num, omp_get_num_threads
IMPLICIT NONE

PRIVATE
Expand Down
2 changes: 0 additions & 2 deletions src/core/dbcsr_types.F
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ MODULE dbcsr_types
int_8
USE dbcsr_mpiwrap, ONLY: mp_comm_type, mp_comm_null

!$ USE OMP_LIB, ONLY: omp_get_max_threads, omp_get_thread_num, omp_get_num_threads

IMPLICIT NONE
PRIVATE

Expand Down
2 changes: 0 additions & 2 deletions src/data/dbcsr_data_methods_low.F
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ MODULE dbcsr_data_methods_low
real_8
#include "base/dbcsr_base_uses.f90"

!$ USE OMP_LIB, ONLY: omp_get_max_threads, omp_get_thread_num, omp_get_num_threads

IMPLICIT NONE

PRIVATE
Expand Down
2 changes: 0 additions & 2 deletions src/data/dbcsr_data_operations.F
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ MODULE dbcsr_data_operations
dbcsr_type_real_8
#include "base/dbcsr_base_uses.f90"

!$ USE OMP_LIB, ONLY: omp_get_max_threads, omp_get_thread_num, omp_get_num_threads

IMPLICIT NONE

PRIVATE
Expand Down
2 changes: 1 addition & 1 deletion src/data/dbcsr_data_types.F
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ MODULE dbcsr_data_types
USE dbcsr_kinds, ONLY: &
dp, int_4, int_4_size, int_8, int_8_size, real_4, real_4_size, real_8, real_8_size

!$ USE OMP_LIB, ONLY: omp_get_max_threads, omp_get_thread_num, omp_get_num_threads, omp_lock_kind
!$ USE OMP_LIB, ONLY: omp_lock_kind

#include "base/dbcsr_base_uses.f90"

Expand Down
3 changes: 1 addition & 2 deletions src/data/dbcsr_mem_methods.F
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ MODULE dbcsr_mem_methods
dbcsr_memtype_type
USE dbcsr_kinds, ONLY: dp

!$ USE OMP_LIB, ONLY: omp_get_max_threads, omp_get_thread_num, omp_get_num_threads, &
!$ omp_set_lock, omp_unset_lock, omp_init_lock, omp_lock_kind, omp_destroy_lock
!$ USE OMP_LIB, ONLY: omp_set_lock, omp_unset_lock, omp_init_lock, omp_destroy_lock

#include "base/dbcsr_base_uses.f90"

Expand Down
1 change: 0 additions & 1 deletion src/dbcsr_api.F
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@ MODULE dbcsr_api
real_4, &
real_8

!$ USE OMP_LIB, ONLY: omp_get_max_threads, omp_get_thread_num, omp_get_num_threads
#include "base/dbcsr_base_uses.f90"

IMPLICIT NONE
Expand Down
4 changes: 2 additions & 2 deletions src/dist/dbcsr_dist_methods.F
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ MODULE dbcsr_dist_methods
dbcsr_mp_obj
#include "base/dbcsr_base_uses.f90"

!$ USE OMP_LIB, ONLY: omp_get_max_threads, omp_get_thread_num, omp_get_num_threads, OMP_IN_PARALLEL
!$ USE OMP_LIB, ONLY: omp_get_max_threads, omp_get_num_threads, omp_in_parallel
IMPLICIT NONE

PRIVATE
Expand Down Expand Up @@ -467,7 +467,7 @@ SUBROUTINE dbcsr_distribution_make_threads(dist, row_sizes)
! ---------------------------------------------------------------------------

dist_p => dist
!$ IF (.NOT. OMP_IN_PARALLEL()) THEN
!$ IF (.NOT. omp_in_parallel()) THEN
! GCC 10.2 refused to build with DEFAULT(NONE) SHARED(dist_p, row_sizes) here:
!$OMP PARALLEL DEFAULT(SHARED)
!$ CALL make_threads(dist_p, row_sizes=row_sizes)
Expand Down
2 changes: 0 additions & 2 deletions src/dist/dbcsr_dist_operations.F
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ MODULE dbcsr_dist_operations
dbcsr_type
#include "base/dbcsr_base_uses.f90"

!$ USE OMP_LIB, ONLY: omp_get_max_threads, omp_get_thread_num, omp_get_num_threads

IMPLICIT NONE

PRIVATE
Expand Down
1 change: 0 additions & 1 deletion src/dist/dbcsr_dist_util.F
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ MODULE dbcsr_dist_util
dbcsr_type_complex_8, dbcsr_type_real_4, dbcsr_type_real_8
#include "base/dbcsr_base_uses.f90"

!$ USE OMP_LIB, ONLY: omp_get_max_threads, omp_get_thread_num, omp_get_num_threads
IMPLICIT NONE
PRIVATE

Expand Down
2 changes: 0 additions & 2 deletions src/mm/dbcsr_acc_operations.F
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ MODULE dbcsr_acc_operations
USE dbcsr_kinds, ONLY: real_8, dp
USE dbcsr_types, ONLY: dbcsr_type_real_8

!$ USE OMP_LIB, ONLY: omp_get_thread_num, omp_get_num_threads

#include "base/dbcsr_base_uses.f90"

IMPLICIT NONE
Expand Down
5 changes: 3 additions & 2 deletions src/mm/dbcsr_mm_3d.F
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,9 @@ MODULE dbcsr_mm_3d
dbcsr_work_destroy
#include "base/dbcsr_base_uses.f90"

!$ USE OMP_LIB, ONLY: omp_get_max_threads, omp_get_thread_num, omp_get_num_threads, &
!$ omp_set_lock, omp_unset_lock, omp_init_lock, omp_lock_kind, omp_destroy_lock
!$ USE OMP_LIB, ONLY: omp_get_thread_num, omp_get_num_threads, &
!$ omp_set_lock, omp_unset_lock, omp_init_lock, &
!$ omp_lock_kind, omp_destroy_lock

IMPLICIT NONE

Expand Down
2 changes: 1 addition & 1 deletion src/mm/dbcsr_mm_cannon.F
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ MODULE dbcsr_mm_cannon
#include "base/dbcsr_base_uses.f90"
!$ USE OMP_LIB, ONLY: omp_get_max_threads, omp_get_thread_num, omp_get_num_threads
!$ USE OMP_LIB, ONLY: omp_get_thread_num, omp_get_num_threads
IMPLICIT NONE
Expand Down
2 changes: 1 addition & 1 deletion src/mm/dbcsr_mm_csr.F
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ MODULE dbcsr_mm_csr
dbcsr_work_type
#include "base/dbcsr_base_uses.f90"

!$ USE OMP_LIB, ONLY: omp_get_max_threads, omp_get_thread_num, omp_get_num_threads
!$ USE OMP_LIB, ONLY: omp_get_thread_num, omp_get_num_threads

IMPLICIT NONE

Expand Down
2 changes: 0 additions & 2 deletions src/mm/dbcsr_mm_dist_operations.F
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ MODULE dbcsr_mm_dist_operations
dbcsr_slot_nblkcols_local, dbcsr_slot_nblkrows_local, dbcsr_type
#include "base/dbcsr_base_uses.f90"

!$ USE OMP_LIB, ONLY: omp_get_max_threads, omp_get_thread_num, omp_get_num_threads

IMPLICIT NONE

PRIVATE
Expand Down
2 changes: 0 additions & 2 deletions src/mm/dbcsr_mm_hostdrv.F
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ MODULE dbcsr_mm_hostdrv
sp
#include "base/dbcsr_base_uses.f90"

!$ USE OMP_LIB, ONLY: omp_get_max_threads, omp_get_thread_num, omp_get_num_threads

IMPLICIT NONE

PRIVATE
Expand Down
2 changes: 1 addition & 1 deletion src/mm/dbcsr_mm_multrec.F
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ MODULE dbcsr_mm_multrec
sp
#include "base/dbcsr_base_uses.f90"

!$ USE OMP_LIB, ONLY: omp_get_max_threads, omp_get_thread_num, omp_get_num_threads
!$ USE OMP_LIB, ONLY: omp_get_thread_num, omp_get_num_threads

IMPLICIT NONE

Expand Down
2 changes: 1 addition & 1 deletion src/mm/dbcsr_mm_sched.F
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ MODULE dbcsr_mm_sched
dbcsr_work_type
#include "base/dbcsr_base_uses.f90"

!$ USE OMP_LIB, ONLY: omp_get_max_threads, omp_get_thread_num, omp_get_num_threads
!$ USE OMP_LIB, ONLY: omp_get_thread_num, omp_get_num_threads

IMPLICIT NONE

Expand Down
2 changes: 0 additions & 2 deletions src/mm/dbcsr_multiply_api.F
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ MODULE dbcsr_multiply_api
dbcsr_type_real_4, &
dbcsr_type_real_8

!$ USE OMP_LIB, ONLY: omp_get_max_threads, omp_get_thread_num, omp_get_num_threads

#include "base/dbcsr_base_uses.f90"

IMPLICIT NONE
Expand Down
2 changes: 0 additions & 2 deletions src/mpi/dbcsr_mp_methods.F
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ MODULE dbcsr_mp_methods
mp_comm_null, mp_comm_type
USE dbcsr_types, ONLY: dbcsr_mp_obj

!$ USE OMP_LIB, ONLY: omp_get_max_threads, omp_get_thread_num, omp_get_num_threads

#include "base/dbcsr_base_uses.f90"

IMPLICIT NONE
Expand Down
2 changes: 0 additions & 2 deletions src/ops/dbcsr_io.F
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@ MODULE dbcsr_io
USE dbcsr_work_operations, ONLY: dbcsr_create
#include "base/dbcsr_base_uses.f90"

!$ USE OMP_LIB, ONLY: omp_get_max_threads, omp_get_thread_num, omp_get_num_threads

IMPLICIT NONE

PRIVATE
Expand Down
2 changes: 0 additions & 2 deletions src/ops/dbcsr_test_methods.F
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@ MODULE dbcsr_test_methods
dbcsr_work_create
#include "base/dbcsr_base_uses.f90"

!$ USE OMP_LIB, ONLY: omp_get_max_threads, omp_get_thread_num, omp_get_num_threads

IMPLICIT NONE

PRIVATE
Expand Down
2 changes: 0 additions & 2 deletions src/ops/dbcsr_tests.F
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@ MODULE dbcsr_tests
USE dbcsr_work_operations, ONLY: dbcsr_create
#include "base/dbcsr_base_uses.f90"

!$ USE OMP_LIB, ONLY: omp_get_max_threads, omp_get_thread_num, omp_get_num_threads

IMPLICIT NONE

PRIVATE
Expand Down
2 changes: 0 additions & 2 deletions src/ops/dbcsr_transformations.F
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,6 @@ MODULE dbcsr_transformations
dbcsr_work_create
#include "base/dbcsr_base_uses.f90"

!$ USE OMP_LIB, ONLY: omp_get_max_threads, omp_get_thread_num, omp_get_num_threads

IMPLICIT NONE
PRIVATE

Expand Down
2 changes: 0 additions & 2 deletions src/utils/dbcsr_toollib.F
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ MODULE dbcsr_toollib
real_8
#include "base/dbcsr_base_uses.f90"

!$ USE OMP_LIB, ONLY: omp_get_max_threads, omp_get_thread_num, omp_get_num_threads

IMPLICIT NONE

PRIVATE
Expand Down
2 changes: 1 addition & 1 deletion src/work/dbcsr_work_operations.F
Original file line number Diff line number Diff line change
Expand Up @@ -916,7 +916,7 @@ SUBROUTINE dbcsr_finalize(matrix, reshuffle)
! built/modified in a parallel environment
nwms = SIZE(matrix%wms)
spawn = .FALSE.
!$ IF (.NOT. OMP_IN_PARALLEL()) THEN
!$ IF (.NOT. omp_in_parallel()) THEN
!$ IF (nwms .GT. 1) spawn = .TRUE.
!$ END IF
IF (spawn) THEN
Expand Down

0 comments on commit 6769fbd

Please sign in to comment.