Commit 58b0a8fb authored by Pavel Kus's avatar Pavel Kus

introducing --with-likwid parameter to the configure script

Can be used to compile with likwid and to enable the likwid regions for
individual compute steps
parent 5131ea13
......@@ -290,6 +290,51 @@ if test x"${enable_timings}" = x"yes"; then
fi
AC_LANG_POP([C])
dnl Likwid
AC_LANG_PUSH([Fortran])
AC_ARG_WITH([likwid],
[AS_HELP_STRING([--with-likwid=[[yes|no(default)|PATH]]],
[Use Likwid to measure performance in some parts of the library])],
[with_likwid="$withval"],
[with_likwid="no"])
if test x"$with_likwid" != x"no" ; then
if test -d $with_likwid/lib ; then
LDFLAGS="-L$with_likwid/lib $LDFLAGS"
fi
if test -d $with_likwid/lib64 ; then
LDFLAGS="-L$with_likwid/lib64 $LDFLAGS"
fi
if test -d $with_likwid/include ; then
FCFLAGS="-I$with_likwid/include $FCFLAGS"
fi
AC_SEARCH_LIBS([likwid_markerInit], [likwid], [liblikwid_found="yes"], [liblikwid_found="no"])
if test x"$liblikwid_found" = x"no" ; then
AC_MSG_ERROR([Could not find a usable likwid library, please adjust LDFLAGS])
fi
AC_MSG_CHECKING([whether we can use the likwid module in a Fortran program])
AC_COMPILE_IFELSE([
program foo
use likwid
implicit none
call likwid_markerInit()
call likwid_markerThreadInit()
call likwid_markerStartRegion("foobar")
call likwid_markerStopRegion("foobar")
call likwid_markerClose()
end
],
[AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([no])
AC_MSG_ERROR([Could not compile a Fortran program using the likwid module, adjust FCFLAGS])])
AC_DEFINE([HAVE_LIKWID], [1], [Use likwid])
fi
AC_LANG_POP([Fortran])
save_FCFLAGS=$FCFLAGS
save_LDFLAGS=$LDFLAGS
......
......@@ -85,7 +85,9 @@ module elpa1_impl
use, intrinsic :: iso_c_binding
use elpa_utilities
use elpa1_auxiliary_impl
#ifdef HAVE_LIKWID
use likwid
#endif
implicit none
......
......@@ -314,7 +314,9 @@ function elpa_solve_evp_&
if (do_tridiag) then
call obj%timer%start("forward")
#ifdef HAVE_LIKWID
call likwid_markerStartRegion("tridi")
#endif
call tridiag_&
&MATH_DATATYPE&
......@@ -322,13 +324,17 @@ function elpa_solve_evp_&
&PRECISION&
& (obj, na, a, lda, nblk, matrixCols, mpi_comm_rows, mpi_comm_cols, ev, e, tau, do_useGPU_tridiag, wantDebug, nrThreads)
#ifdef HAVE_LIKWID
call likwid_markerStopRegion("tridi")
#endif
call obj%timer%stop("forward")
endif !do_tridiag
if (do_solve) then
call obj%timer%start("solve")
#ifdef HAVE_LIKWID
call likwid_markerStartRegion("solve")
#endif
call solve_tridi_&
&PRECISION&
......@@ -341,7 +347,9 @@ function elpa_solve_evp_&
#endif
nblk, matrixCols, mpi_comm_rows, mpi_comm_cols, do_useGPU_solve_tridi, wantDebug, success, nrThreads)
#ifdef HAVE_LIKWID
call likwid_markerStopRegion("solve")
#endif
call obj%timer%stop("solve")
if (.not.(success)) return
endif !do_solve
......@@ -377,7 +385,9 @@ function elpa_solve_evp_&
#endif
call obj%timer%start("back")
#ifdef HAVE_LIKWID
call likwid_markerStartRegion("trans_ev")
#endif
call trans_ev_&
&MATH_DATATYPE&
......@@ -385,7 +395,9 @@ function elpa_solve_evp_&
&PRECISION&
& (obj, na, nev, a, lda, tau, q, ldq, nblk, matrixCols, mpi_comm_rows, mpi_comm_cols, do_useGPU_trans_ev)
#ifdef HAVE_LIKWID
call likwid_markerStopRegion("trans_ev")
#endif
call obj%timer%stop("back")
endif ! do_trans_ev
......
......@@ -56,7 +56,9 @@
!> \brief Fortran module which provides the routines to use the 2-stage ELPA solver. Implementation only. Should not be used directly
module elpa2_impl
use elpa_utilities, only : error_unit
#ifdef HAVE_LIKWID
use likwid
#endif
implicit none
......
......@@ -538,7 +538,9 @@
if (do_bandred) then
call obj%timer%start("bandred")
#ifdef HAVE_LIKWID
call likwid_markerStartRegion("bandred")
#endif
! Reduction full -> band
call bandred_&
&MATH_DATATYPE&
......@@ -551,7 +553,9 @@
useQRActual, &
#endif
nrThreads)
#ifdef HAVE_LIKWID
call likwid_markerStopRegion("bandred")
#endif
call obj%timer%stop("bandred")
if (.not.(success)) return
endif
......@@ -569,7 +573,9 @@
endif
call obj%timer%start("tridiag")
#ifdef HAVE_LIKWID
call likwid_markerStartRegion("tridiag")
#endif
call tridiag_band_&
&MATH_DATATYPE&
&_&
......@@ -583,7 +589,9 @@
call mpi_bcast(e, na, MPI_REAL_PRECISION, 0, mpi_comm_all, mpierr)
call obj%timer%stop("mpi_communication")
#endif /* WITH_MPI */
#ifdef HAVE_LIKWID
call likwid_markerStopRegion("tridiag")
#endif
call obj%timer%stop("tridiag")
endif ! do_tridiag
......@@ -604,7 +612,9 @@
! Solve tridiagonal system
if (do_solve_tridi) then
call obj%timer%start("solve")
#ifdef HAVE_LIKWID
call likwid_markerStartRegion("solve")
#endif
call solve_tridi_&
&PRECISION &
(obj, na, nev, ev, e, &
......@@ -615,7 +625,9 @@
q_real, ubound(q_real,dim=1), &
#endif
nblk, matrixCols, mpi_comm_rows, mpi_comm_cols, do_useGPU_solve_tridi, wantDebug, success, nrThreads)
#ifdef HAVE_LIKWID
call likwid_markerStopRegion("solve")
#endif
call obj%timer%stop("solve")
if (.not.(success)) return
endif ! do_solve_tridi
......@@ -673,7 +685,9 @@
! Backtransform stage 1
call obj%timer%start("trans_ev_to_band")
#ifdef HAVE_LIKWID
call likwid_markerStartRegion("trans_ev_to_band")
#endif
call trans_ev_tridi_to_band_&
&MATH_DATATYPE&
&_&
......@@ -682,7 +696,9 @@
q_dev, &
ldq, matrixCols, hh_trans, mpi_comm_rows, mpi_comm_cols, wantDebug, do_useGPU_trans_ev_tridi_to_band, &
nrThreads, success=success, kernel=kernel)
#ifdef HAVE_LIKWID
call likwid_markerStopRegion("trans_ev_to_band")
#endif
call obj%timer%stop("trans_ev_to_band")
if (.not.(success)) return
......@@ -726,7 +742,9 @@
if (do_trans_to_full) then
call obj%timer%start("trans_ev_to_full")
#ifdef HAVE_LIKWID
call likwid_markerStartRegion("trans_ev_to_full")
#endif
if ( (do_useGPU_trans_ev_band_to_full) .and. .not.(do_useGPU_trans_ev_tridi_to_band) ) then
! copy to device if we want to continue on GPU
successCUDA = cuda_malloc(q_dev, ldq*matrixCols*size_of_datatype)
......@@ -762,7 +780,9 @@
&PRECISION " // ": error when deallocating tmat"//errorMessage
stop 1
endif
#ifdef HAVE_LIKWID
call likwid_markerStopRegion("trans_ev_to_full")
#endif
call obj%timer%stop("trans_ev_to_full")
endif ! do_trans_to_full
......
......@@ -56,7 +56,9 @@ module elpa_impl
use elpa_mpi
use elpa_generated_fortran_interfaces
use elpa_utilities, only : error_unit
#ifdef HAVE_LIKWID
use likwid
#endif
use elpa_abstract_impl
#ifdef ENABLE_AUTOTUNING
......@@ -423,10 +425,12 @@ module elpa_impl
#endif
#ifdef HAVE_LIKWID
!initialize likwid
call likwid_markerInit()
call likwid_markerThreadInit()
call likwid_markerStartRegion("TOTAL")
#endif
#ifdef HAVE_DETAILED_TIMINGS
call self%get("timings",timings, error)
......@@ -930,8 +934,10 @@ module elpa_impl
error = ELPA_OK
endif
#ifdef HAVE_LIKWID
call likwid_markerStopRegion("TOTAL")
call likwid_markerClose()
#endif
#ifdef WITH_MPI
if (self%communicators_owned == 1) then
......
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