diff --git a/config/ifort_rome.cfg b/config/ifort_rome.cfg index 3b70f98b..5ed01227 100644 --- a/config/ifort_rome.cfg +++ b/config/ifort_rome.cfg @@ -31,8 +31,8 @@ OPENMP : 1 ; Append OpenMP flags # -ftz : Flushes denormal results to zero # [OPT] -FC : -traceback -FCFLAGS : -O2 -ip -g -march=core-avx2 -align array64byte -fma -ftz -fomit-frame-pointer +FC : -traceback -shared-intel +FCFLAGS : -O2 -ip -g -march=core-avx2 -align array64byte -fma -ftz -fomit-frame-pointer # Profiling flags ################# diff --git a/src/utils/intel.f90 b/src/utils/intel.f90 index 4c18af8d..2b61cb38 100644 --- a/src/utils/intel.f90 +++ b/src/utils/intel.f90 @@ -17,15 +17,15 @@ module intel interface subroutine ippsSortAscend_64s_I(pSrc, len) bind(C, name='ippsSortAscend_64s_I') use iso_c_binding - integer*8, intent(in), value :: len - integer, intent(inout) :: pSrc(len) + integer, intent(in), value :: len + integer*8, intent(inout) :: pSrc(len) end end interface interface subroutine ippsSortAscend_64f_I(pSrc, len) bind(C, name='ippsSortAscend_64f_I') use iso_c_binding - double precision, intent(in), value :: len - real, intent(inout) :: pSrc(len) + integer, intent(in), value :: len + double precision, intent(inout) :: pSrc(len) end end interface diff --git a/src/utils/sort.irp.f b/src/utils/sort.irp.f index f3879d4a..21eb8b67 100644 --- a/src/utils/sort.irp.f +++ b/src/utils/sort.irp.f @@ -310,12 +310,73 @@ BEGIN_TEMPLATE SUBST [ X, type, ityp, n, ippsz ] ; real ; 32f ; 4 ; 13 ;; - d ; double precision ; 64f ; 8 ; 19;; i ; integer ; 32s ; 4 ; 11 ;; - i8 ; integer*8 ; 64s ; 8 ; 17;; i2 ; integer*2 ; 16s ; 2 ; 7 ;; END_TEMPLATE +BEGIN_TEMPLATE + + subroutine $Xsort(x,iorder,isize) + implicit none + BEGIN_DOC + ! Sort array x(isize). + ! iorder in input should be (1,2,3,...,isize), and in output + ! contains the new order of the elements. + END_DOC + integer,intent(in) :: isize + $type,intent(inout) :: x(isize) + integer,intent(inout) :: iorder(isize) + integer :: n + if (isize < 2) then + return + endif +! call sorted_$Xnumber(x,isize,n) +! if (isize == n) then +! return +! endif + if ( isize < 32) then + call insertion_$Xsort(x,iorder,isize) + else +! call heap_$Xsort(x,iorder,isize) + call quick_$Xsort(x,iorder,isize) + endif + end subroutine $Xsort + +SUBST [ X, type ] + d ; double precision ;; +END_TEMPLATE + +BEGIN_TEMPLATE + + subroutine $Xsort(x,iorder,isize) + implicit none + BEGIN_DOC + ! Sort array x(isize). + ! iorder in input should be (1,2,3,...,isize), and in output + ! contains the new order of the elements. + END_DOC + integer,intent(in) :: isize + $type,intent(inout) :: x(isize) + integer,intent(inout) :: iorder(isize) + integer :: n + if (isize < 2) then + return + endif + call sorted_$Xnumber(x,isize,n) + if (isize == n) then + return + endif + if ( isize < 32) then + call insertion_$Xsort(x,iorder,isize) + else + call $Xradix_sort(x,iorder,isize,-1) + endif + end subroutine $Xsort + +SUBST [ X, type ] + i8 ; integer*8 ;; +END_TEMPLATE + !---------------------- END INTEL IRP_ELSE !---------------------- NON-INTEL