Skip to content

Commit

Permalink
more work on pioperformance
Browse files Browse the repository at this point in the history
  • Loading branch information
edhartnett committed Apr 9, 2019
1 parent 93d0298 commit b5c31df
Show file tree
Hide file tree
Showing 3 changed files with 409 additions and 1 deletion.
24 changes: 24 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,30 @@ if test "x$enable_timing" = xyes; then
[AC_MSG_ERROR([Can't find or link to the GPTL Fortran library.])])
AC_LANG_POP([Fortran])
fi

# Check for papi library.
AC_CHECK_LIB([papi], [PAPI_library_init])
AC_MSG_CHECKING([whether system can support PAPI])
have_papi=no
if test "x$ac_cv_lib_papi_PAPI_library_init" = xyes; then
# If we have PAPI library, check /proc/sys/kernel/perf_event_paranoid
# to see if we have permissions.
if test -f /proc/sys/kernel/perf_event_paranoid; then
if test `cat /proc/sys/kernel/perf_event_paranoid` != 1; then
AC_MSG_ERROR([PAPI library found, but /proc/sys/kernel/perf_event_paranoid != 1
try sudo sh -c 'echo 1 >/proc/sys/kernel/perf_event_paranoid'])
fi
fi
AC_DEFINE([HAVE_PAPI], [1], [PAPI library is present and usable])
have_papi=yes
fi
AC_MSG_RESULT($have_papi)

# We must have papi to build pioperformance with timing.
if test "x$have_papi" = xno; then
AC_MSG_ERROR([PAPI library not found, but is required if enable-timing is used.])
fi
AM_CONDITIONAL([HAVE_PAPI], [test "x$have_papi" = xyes])
fi

AC_CONFIG_FILES(src/flib/piodarray.F90:src/flib/piodarray.F90.in2)
Expand Down
2 changes: 1 addition & 1 deletion src/gptl/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ noinst_LTLIBRARIES = libperf_utils.la libperf_mod.la

# The convenience libraries depends on their source.
libperf_utils_la_SOURCES = perf_utils.F90
libperf_mod_la_SOURCES = perf_mod.F90
libperf_mod_la_SOURCES = perf_mod.F90 f_wrappers_2.c

# Each mod file depends on the .o file.
perf_utils.mod: perf_utils.$(OBJEXT)
Expand Down
Loading

0 comments on commit b5c31df

Please sign in to comment.