Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revisionBoth sides next revision
doku:papi [2016/06/16 13:54] shdoku:papi [2016/06/16 14:01] sh
Line 91: Line 91:
 or similarly for Fortran users,    or similarly for Fortran users,   
  
-       include 'f77papi.h' +             include 'f77papi.h' 
-       integer check, evntst +             integer check, evntst 
-       integer*8 t0, t1, c0, c1, value+             integer*8 t0, t1, c0, c1, value
                
-       check = PAPI_NULL+             check = PAPI_NULL
        C        C
-            PAPI Initialization+           PAPI Initialization
        C        C
-       check = PAPI_VER_CURRENT +             check = PAPI_VER_CURRENT 
-       call PAPIF_library_init(check) +             call PAPIF_library_init(check) 
-       if (check.ne.PAPI_VER_CURRENT) then +             if (check.ne.PAPI_VER_CURRENT) then 
-          write(6,*) 'PAPI init error' +                write(6,*) 'PAPI init error' 
-          write(6,*) '00 check:', check, PAPI_VER_CURRENT +                write(6,*) '00 check:', check, PAPI_VER_CURRENT 
-          stop +                stop 
-       endif+             endif
        C        C
-            PAPI Event Set Creation+           PAPI Event Set Creation
        C        C
-       evntst = PAPI_NULL +             evntst = PAPI_NULL 
-       call PAPIF_create_eventset(evntst, check) +             call PAPIF_create_eventset(evntst, check) 
-       if (check.ne.PAPI_OK) then +             if (check.ne.PAPI_OK) then 
-          write(6,*) 'PAPI event set creation error' +                write(6,*) 'PAPI event set creation error' 
-          write(6,*) '01 check:', check, PAPI_OK +                write(6,*) '01 check:', check, PAPI_OK 
-          stop +                stop 
-       endif+             endif
        C        C
-            PAPI Specify a Particular Target Event to Analyze +           PAPI Specify a Particular Target Event to Analyze 
-              PAPI_TOT_CYC         Total cycles executed          +             PAPI_TOT_CYC         Total cycles executed          
-              PAPI_FP_OPS          Floating point operations executed +             PAPI_FP_OPS          Floating point operations executed 
-              PAPI_L1_DCM          Level 1 data cache misses           +             PAPI_L1_DCM          Level 1 data cache misses           
-              PAPI_L2_DCM          Level 2 data cache misses           +             PAPI_L2_DCM          Level 2 data cache misses           
-              for other events see /opt/sw/x86_64/glibc-2.12/ivybridge-ep/papi/5.4.3/gnu-4.4.7/include/papiStdEventDefs.h+             for other events see /opt/sw/x86_64/glibc-2.12/ivybridge-ep/papi/5.4.3/gnu-4.4.7/include/papiStdEventDefs.h
        C        C
-       call PAPIF_add_event(evntst, PAPI_FP_OPS, check) +             call PAPIF_add_event(evntst, PAPI_FP_OPS, check) 
-       if (check.ne.PAPI_OK) then +             if (check.ne.PAPI_OK) then 
-          write(6,*) 'PAPI event set adding error' +                write(6,*) 'PAPI event set adding error' 
-          write(6,*) '02 check:', check, PAPI_OK +                write(6,*) '02 check:', check, PAPI_OK 
-          stop +                stop 
-       endif+             endif
        C        C
-            PAPI Time Estimators Initialization                +           PAPI Time Estimators Initialization                
                              
-       call PAPIF_get_real_usec(t0) +             call PAPIF_get_real_usec(t0) 
-       call PAPIF_get_real_cyc(c0)+             call PAPIF_get_real_cyc(c0)
        C        C
-            PAPI Counting Start                                +           PAPI Counting Start                                
                              
-       call PAPIF_start(evntst, check) +             call PAPIF_start(evntst, check) 
-       if (check.ne.PAPI_OK) then +             if (check.ne.PAPI_OK) then 
-          write(6,*) 'PAPI start error !' +                write(6,*) 'PAPI start error !' 
-          write(6,*) '03 check:', check, PAPI_OK +                write(6,*) '03 check:', check, PAPI_OK 
-          stop +                stop 
-       endif+             endif
                
        C        C
-            *** Here follows the original code section to be analyzed ***+           *** Here follows the original code section to be analyzed ***
        C        C
                
                          
-            PAPI Counting Stop                                 +           PAPI Counting Stop                                 
                              
-       call PAPIF_stop(evntst, value, check) +             call PAPIF_stop(evntst, value, check) 
-       if (check.ne.PAPI_OK) then +             if (check.ne.PAPI_OK) then 
-          write(6,*) 'PAPI stop error !' +                write(6,*) 'PAPI stop error !' 
-          write(6,*) '04 check:', check, PAPI_OK +                write(6,*) '04 check:', check, PAPI_OK 
-          stop +                stop 
-       endif+             endif
                          
-            PAPI Time Estimators Stop                          +           PAPI Time Estimators Stop                          
                              
-       call PAPIF_get_real_usec(t1) +             call PAPIF_get_real_usec(t1) 
-       call PAPIF_get_real_cyc(c1)+             call PAPIF_get_real_cyc(c1)
                          
-            PAPI Results                                       +           PAPI Results                                       
                              
-       write(6,'(a17,8x,i20)') 'PAPI event count ', value +             write(6,'(a17,8x,i20)') 'PAPI event count ', value 
-       write(6,'(a25,i20)') 'PAPI time passed in usec ', t1 - t0 +             write(6,'(a25,i20)') 'PAPI time passed in usec ', t1 - t0 
-       write(6,'(a19,6x,i20)') 'PAPI cycles passed ', c1 - c0+             write(6,'(a19,6x,i20)') 'PAPI cycles passed ', c1 - c0
                          
-            PAPI Free Event Set                                +           PAPI Free Event Set                                
                              
-       call PAPIF_cleanup_eventset(evntst, check) +             call PAPIF_cleanup_eventset(evntst, check) 
-       if (check.ne.PAPI_OK) then +             if (check.ne.PAPI_OK) then 
-          write(6,*) 'PAPI event set cleanup error !' +                write(6,*) 'PAPI event set cleanup error !' 
-          write(6,*) '05 check:', check, PAPI_OK +                write(6,*) '05 check:', check, PAPI_OK 
-          stop +                stop 
-       endif +             endif 
-       call PAPIF_destroy_eventset(evntst, check) +             call PAPIF_destroy_eventset(evntst, check) 
-       if (check.ne.PAPI_OK) then +             if (check.ne.PAPI_OK) then 
-          write(6,*) 'PAPI event set destruction error !' +                write(6,*) 'PAPI event set destruction error !' 
-          write(6,*) '06 check:', check, PAPI_OK +                write(6,*) '06 check:', check, PAPI_OK 
-          stop +                stop 
-       endif+             endif
                          
-            PAPI Finalize                                      +           PAPI Finalize                                      
                              
-       call PAPIF_shutdown(check) +             call PAPIF_shutdown(check) 
-       if (check.ne.PAPI_OK) then +             if (check.ne.PAPI_OK) then 
-          write(6,*) 'PAPI finalize failed !' +                write(6,*) 'PAPI finalize failed !' 
-          write(6,*) '07 check:', check, PAPI_OK +                write(6,*) '07 check:', check, PAPI_OK 
-          stop +                stop 
-       endif+             endif
  
  
  • doku/papi.txt
  • Last modified: 2016/07/06 12:28
  • by ir