Blame SOURCES/papi-bz1313088.patch

c7ea89
From 88f6669fa358bf4670d91e379f469e3cd3016543 Mon Sep 17 00:00:00 2001
c7ea89
From: William Cohen <wcohen@redhat.com>
c7ea89
Date: Tue, 21 Jun 2016 10:53:32 -0400
c7ea89
Subject: [PATCH 1/2] Have Fortran test support code report errors more clearly
c7ea89
c7ea89
When a Fortran test called the ftest_skip or ftest_fail the support
c7ea89
code would attempt to print out error strings.  However, this support
c7ea89
code would print out gibberish because the string was not properly
c7ea89
initialized.  There doesn't seem to be a easy way in Fortran to get
c7ea89
the error string, for the time being just print out the error number
c7ea89
and people will need to manually map it back to the string.
c7ea89
c7ea89
Signed-off-by: William Cohen <wcohen@redhat.com>
c7ea89
---
c7ea89
 src/ftests/ftests_util.F | 14 ++++++--------
c7ea89
 1 file changed, 6 insertions(+), 8 deletions(-)
c7ea89
c7ea89
diff --git a/src/ftests/ftests_util.F b/src/ftests/ftests_util.F
c7ea89
index 83433f9..8de2bd1 100644
c7ea89
--- a/src/ftests/ftests_util.F
c7ea89
+++ b/src/ftests/ftests_util.F
c7ea89
@@ -108,7 +108,6 @@ C     And also to make the test code read cleaner
c7ea89
       integer line
c7ea89
       character*(*) callstr
c7ea89
       integer retval,ilen
c7ea89
-      character*(PAPI_MAX_STR_LEN) papi_errstr
c7ea89
       integer last_char
c7ea89
       external last_char
c7ea89
 
c7ea89
@@ -134,10 +133,10 @@ C     And also to make the test code read cleaner
c7ea89
       else if(retval.eq.0)then
c7ea89
         write(*,*) 'SGI requires root permissions for this test'
c7ea89
       else
c7ea89
-        call PAPIF_perror( )
c7ea89
+C Just printing the error number because of difficulty getting error string.
c7ea89
         ilen=last_char(callstr)
c7ea89
-        write(*,'(T2,3a)') 'PAPI error in ', callstr(1:ilen), 
c7ea89
-     *       ': '// papi_errstr(1:last_char(papi_errstr))
c7ea89
+        write(*,'(T2,3a,I3)') 'PAPI error in ', callstr(1:ilen),
c7ea89
+     *       ': ', retval
c7ea89
       end if
c7ea89
       call pause()
c7ea89
       stop
c7ea89
@@ -153,7 +152,6 @@ C     And also to make the test code read cleaner
c7ea89
       integer quiet
c7ea89
       common quiet
c7ea89
 
c7ea89
-      character*(PAPI_MAX_STR_LEN) papi_errstr
c7ea89
       integer last_char
c7ea89
       external last_char
c7ea89
 
c7ea89
@@ -165,10 +163,10 @@ C     And also to make the test code read cleaner
c7ea89
         else if (retval.gt.0) then
c7ea89
           write(*,*) "Error calculating: ", callstr
c7ea89
         else
c7ea89
-          call PAPIF_perror( )
c7ea89
+C Just printing the error number because of difficulty getting error string.
c7ea89
           ilen=last_char(callstr)
c7ea89
-          write(*,'(T2,3a)') 'Error in ', callstr(1:ilen),
c7ea89
-     *         ': ' // papi_errstr(1:last_char(papi_errstr))
c7ea89
+          write(*,'(T2,3a,I3)') 'Error in ', callstr(1:ilen),
c7ea89
+     *         ': ', retval
c7ea89
         end if
c7ea89
       end if
c7ea89
       call pause()
c7ea89
-- 
c7ea89
1.8.3.1
c7ea89