diff --git a/SOURCES/papi-inficonst.patch b/SOURCES/papi-inficonst.patch new file mode 100644 index 0000000..57bba30 --- /dev/null +++ b/SOURCES/papi-inficonst.patch @@ -0,0 +1,13 @@ +diff -up papi-5.2.0/src/components/infiniband/linux-infiniband.c.decl papi-5.2.0/src/components/infiniband/linux-infiniband.c +--- papi-5.2.0/src/components/infiniband/linux-infiniband.c.decl 2015-08-10 16:04:04.528460972 -0400 ++++ papi-5.2.0/src/components/infiniband/linux-infiniband.c 2015-08-10 16:06:25.243444756 -0400 +@@ -27,6 +27,9 @@ + #include "papi_vector.h" + #include "papi_memory.h" + ++/* This is a hack remove consts in the declarations to avoid decl mismatch. */ ++#define const ++ + #include "linux-infiniband.h" + + void (*_dl_non_dynamic_init)(void) __attribute__((weak)); diff --git a/SOURCES/papi-krentel.patch b/SOURCES/papi-krentel.patch new file mode 100644 index 0000000..5c8ae11 --- /dev/null +++ b/SOURCES/papi-krentel.patch @@ -0,0 +1,71 @@ +commit 71e6e5e52d7205a6a792bf9b754550a8719db6b1 +Author: Asim YarKhan +Date: Wed Feb 25 12:17:40 2015 -0500 + + Sync thread exit in krental_threads.c + + Thanks to William Cohen for this patch and to Phil Mucci for approving it. + + William Cohnen and Michael Petlan noticed that this test can have + threads dangling after the main thread is done. This patch tracks the + created threads and ensures that they are joined before the code + exits. + + Note: There is still some problem remaining. For example, the following + test will sometimes (maybe 1 of 10 runs) generate an error message. + > ./ctests/krentel_pthreads 8 2000 10 + .... + [10] time = 8, count = 38110, iter = 20, rate = 1905500.0/Kiter + PAPI Error: thread->running_eventset == NULL in _papi_pe_dispatch_timer for fd 14!. + [0] time = 8, count = 38161, iter = 20, rate = 1908050.0/Kiter + krentel_pthreads.c PASSED + +diff --git a/src/ctests/krentel_pthreads.c b/src/ctests/krentel_pthreads.c +index 2417976..9fa3e25 100644 +--- a/src/ctests/krentel_pthreads.c ++++ b/src/ctests/krentel_pthreads.c +@@ -143,7 +143,7 @@ my_thread( void *v ) + int + main( int argc, char **argv ) + { +- pthread_t td; ++ pthread_t *td = NULL; + long n; + + tests_quiet( argc, argv ); /*Set TESTS_QUIET variable */ +@@ -155,6 +155,10 @@ main( int argc, char **argv ) + if ( argc < 4 || sscanf( argv[3], "%d", &num_threads ) < 1 ) + num_threads = 3; + ++ td = malloc((num_threads+1) * sizeof(pthread_t)); ++ if (!td) ++ test_fail( __FILE__, __LINE__, "td malloc failed", 1 ); ++ + printf( "program_time = %d, threshold = %d, num_threads = %d\n\n", + program_time, threshold, num_threads ); + +@@ -171,15 +175,22 @@ main( int argc, char **argv ) + gettimeofday( &start, NULL ); + + for ( n = 1; n <= num_threads; n++ ) { +- if ( pthread_create( &td, NULL, my_thread, ( void * ) n ) != 0 ) ++ if ( pthread_create( &(td[n]), NULL, my_thread, ( void * ) n ) != 0 ) + test_fail( __FILE__, __LINE__, "pthread create failed", 1 ); + } + + my_thread( ( void * ) 0 ); + ++ /* wait for all the threads */ ++ for ( n = 1; n <= num_threads; n++ ) { ++ if ( pthread_join( td[n], NULL)) ++ test_fail( __FILE__, __LINE__, "pthread join failed", 1 ); ++ } ++ ++ free(td); ++ + printf( "done\n" ); + + test_pass( __FILE__, NULL, 0 ); +- pthread_exit( NULL ); + return ( 0 ); + } diff --git a/SOURCES/papi-kvmrapl.patch b/SOURCES/papi-kvmrapl.patch new file mode 100644 index 0000000..daf3d30 --- /dev/null +++ b/SOURCES/papi-kvmrapl.patch @@ -0,0 +1,30 @@ +commit a5ecda79870b41f5b2ee21975f0f1c931114d258 +Author: sangamesh +Date: Thu Jun 11 17:48:36 2015 -0400 + + Thanks to William Cohen for the patch which does the following: + Checking the cpu family and module number is not sufficient to determine + whether RAPL can be used. If the papi is running inside a guest VM, + the MSR used by the PAPI RAPL component may not be available. There + should be a simple read test to verify the RAPL MSR registers are + available. This allows the component to more clearly report that RAPL + is unsupported rather than just exiting program when the RAPL + +diff --git a/src/components/rapl/linux-rapl.c b/src/components/rapl/linux-rapl.c +index f0d376e..8dff3fe 100644 +--- a/src/components/rapl/linux-rapl.c ++++ b/src/components/rapl/linux-rapl.c +@@ -447,6 +447,13 @@ _rapl_init_component( int cidx ) + return PAPI_ESYS; + } + ++ /* Verify needed MSR is readable. In a guest VM it may not be readable*/ ++ if (pread(fd, &result, sizeof result, MSR_RAPL_POWER_UNIT) != sizeof result ) { ++ strncpy(_rapl_vector.cmp_info.disabled_reason, ++ "Unable to access RAPL registers",PAPI_MAX_STR_LEN); ++ return PAPI_ESYS; ++ } ++ + /* Calculate the units used */ + result=read_msr(fd,MSR_RAPL_POWER_UNIT); + diff --git a/SPECS/papi.spec b/SPECS/papi.spec index 4db71e6..b01a73b 100644 --- a/SPECS/papi.spec +++ b/SPECS/papi.spec @@ -2,7 +2,7 @@ Summary: Performance Application Programming Interface Name: papi Version: 5.2.0 -Release: 10%{?dist} +Release: 14%{?dist} License: BSD Group: Development/System URL: http://icl.cs.utk.edu/papi/ @@ -13,7 +13,10 @@ Patch200: papi-aarch64.patch Patch201: papi-xgene.patch Patch300: papi-coverity.patch Patch400: papi-hsw_ep.patch +Patch401: papi-kvmrapl.patch Patch500: papi-sys_mem_info.patch +Patch700: papi-krentel.patch +Patch900: papi-inficonst.patch BuildRequires: autoconf BuildRequires: doxygen BuildRequires: ncurses-devel @@ -68,7 +71,10 @@ the PAPI user-space libraries and interfaces. %patch201 -p1 %patch300 -p1 %patch400 -p1 +%patch401 -p1 %patch500 -p1 +%patch700 -p1 +%patch900 -p1 %build %if %{without bundled_libpfm} @@ -150,6 +156,18 @@ rm -rf $RPM_BUILD_ROOT %{_libdir}/*.a %changelog +* Mon Aug 10 2015 William Cohen - 5.2.0-14 +- Fix build for newer infiband libs. rhbz1251645 + +* Mon Jun 29 2015 William Cohen - 5.2.0-13 +- Bump and rebuild. + +* Fri Jun 26 2015 William Cohen - 5.2.0-12 +- Improved check that rapl is supported. rhbz1228832 + +* Thu Jun 4 2015 William Cohen - 5.2.0-11 +- Correct krentel test. rhbz1191199 + * Thu Oct 16 2014 William Cohen - 5.2.0-10 - Bump and rebuid for chained build. rhbz1126091