22#define MAX_LIBMSR_EVENTS 64
30 printf(
"Sleeping 2 second...\n" );
36#define MATRIX_SIZE 1024
51 a[
i][j]=( double )
i*(
double )j;
52 b[
i][j]=( double )
i/(
double )( j+5 );
70 if ( !
quiet ) printf(
"Matrix multiply sum: s=%lf\n",
s );
76int main (
int argc,
char **argv )
78 int retval,cid,libmsr_cid=-1,numcmp;
97 if ( argc > 1 && strstr( argv[1],
"-w" ) )
106 printf(
"Trying all LIBMSR events\n" );
110 for( cid=0; cid<numcmp; cid++ ) {
113 test_fail( __FILE__, __LINE__,
"PAPI_get_component_info failed\n", 0 );
115 if ( strstr( cmpinfo->
name,
"libmsr" ) ) {
117 if ( !
TESTS_QUIET ) printf(
"Found libmsr component at cid %d\n",libmsr_cid );
120 test_skip( __FILE__,__LINE__,
"libmsr component disabled", 0 );
128 test_skip( __FILE__,__LINE__,
"No libmsr component found\n",0 );
161 if ( !
TESTS_QUIET ) printf(
"Starting measurements...\n" );
168 for ( repeat=0; repeat<3; repeat++ ) {
181 printf(
"Stopping measurements, took %.3fs, gathering results...\n", elapsed_time );
static const char * event_names[2]
add PAPI preset or native hardware event to an event set
Empty and destroy an EventSet.
Create a new empty PAPI EventSet.
Empty and destroy an EventSet.
Enumerate PAPI preset or native events for a given component.
Convert a numeric hardware event code to a name.
get information about a specific software component
Get the event's name and description info.
Get real time counter value in nanoseconds.
initialize the PAPI library.
Get the number of components available on the system.
Read hardware counters from an event set.
Start counting hardware events in an event set.
Stop counting hardware events in an event set.
#define PAPI_DATATYPE_FP64
#define PAPI_DATATYPE_UINT64
static long long values[NUM_EVENTS]
static double a[MATRIX_SIZE][MATRIX_SIZE]
static double b[MATRIX_SIZE][MATRIX_SIZE]
static double c[MATRIX_SIZE][MATRIX_SIZE]
#define MAX_LIBMSR_EVENTS
Tests basic functionality of libmsr component.
Return codes and api definitions.
int tests_quiet(int argc, char **argv)
void PAPI_NORETURN test_fail(const char *file, int line, const char *call, int retval)
void PAPI_NORETURN test_pass(const char *filename)
void PAPI_NORETURN test_skip(const char *file, int line, const char *call, int retval)
int data_type[MAX_EVENTS]
char units[MAX_EVENTS][BUFSIZ]
static long long after_time
static long long before_time
char name[PAPI_MAX_STR_LEN]
char disabled_reason[PAPI_HUGE_STR_LEN]
char units[PAPI_MIN_STR_LEN]