19 #define TOTAL_EVENTS 10 52 test_fail( __FILE__, __LINE__,
"PAPI_get_hardware_info", 2 );
64 "PAPI_set_domain",
retval );
70 test_skip(__FILE__, __LINE__,
"Multiplex not supported", 1);
84 for (
i = 0; in_events[
i] != 0;
i++ ) {
89 out_events[real_len++] = in_events[
i];
91 if ( real_len == *len )
96 printf(
"%s does not exist\n", out );
100 if (!
TESTS_QUIET) printf(
"No counters available\n");
101 test_skip(__FILE__, __LINE__,
"No counters available", 0 );
113 pthread_attr_init( &attr );
114 #ifdef PTHREAD_CREATE_UNDETACHED 115 pthread_attr_setdetachstate( &attr, PTHREAD_CREATE_UNDETACHED );
117 #ifdef PTHREAD_SCOPE_SYSTEM 118 retval = pthread_attr_setscope( &attr, PTHREAD_SCOPE_SYSTEM );
124 rc = pthread_create( &
id[
i], &attr, fn, NULL );
129 pthread_join(
id[
i], NULL );
131 pthread_attr_destroy( &attr );
161 printf(
"Added %s\n", out );
175 printf(
"case1 thread %4x:", (
unsigned ) pthread_self( ) );
177 printf(
"case1 thread %4x:", (
unsigned ) pthread_self( ) );
215 test_fail(__FILE__, __LINE__,
"PAPI_assign_eventset_component",
retval );
220 test_skip(__FILE__, __LINE__,
"Multiplex not supported", 1);
226 printf(
"++case2 thread %4x:", (
unsigned ) pthread_self( ) );
237 printf(
"Added %s\n", out );
251 printf(
"case2 thread %4x:", (
unsigned ) pthread_self( ) );
253 printf(
"case2 thread %4x:", (
unsigned ) pthread_self( ) );
298 printf(
"Added %s\n", out );
303 test_skip(__FILE__, __LINE__,
"Multiplex not supported", 1);
320 printf(
"case3 thread %4x:", (
unsigned ) pthread_self( ) );
322 printf(
"case3 thread %4x:", (
unsigned ) pthread_self( ) );
365 test_skip(__FILE__, __LINE__,
"Multiplex not supported", 1);
388 printf(
"case4 thread %4x:", (
unsigned ) pthread_self( ) );
390 printf(
"case4 thread %4x:", (
unsigned ) pthread_self( ) );
476 printf(
"%s: Using %d threads\n\n", argv[0],
NUM_THREADS );
481 printf (
"case1: Does PAPI_multiplex_init() " 482 "not break regular operation?\n" );
491 printf(
"case2: Does setmpx/add work?\n" );
499 printf(
"case3: Does add/setmpx work?\n" );
507 printf(
"case4: Does add/setmpx/add work?\n" );
int PAPI_stop(int EventSet, long long *values)
void test_pass(const char *filename)
int PAPI_add_event(int EventSet, int EventCode)
unsigned long int pthread_t
static int PAPI_events[TOTAL_EVENTS]
static int solaris_preset_PAPI_events[TOTAL_EVENTS]
static int PAPI_events_len
static void * case3_pthreads(void *arg)
void test_print_event_header(const char *call, int evset)
static int do_pthreads(void *(*fn)(void *))
int PAPI_register_thread(void)
static void * case1_pthreads(void *arg)
static int preset_PAPI_events[TOTAL_EVENTS]
Return codes and api definitions.
void test_skip(const char *file, int line, const char *call, int retval)
int PAPI_thread_init(unsigned long int(*id_fn)(void))
int PAPI_library_init(int version)
static int power6_preset_PAPI_events[TOTAL_EVENTS]
static void init_papi_pthreads(int *out_events, int *len)
char model_string[PAPI_MAX_STR_LEN]
int main(int argc, char **argv)
int PAPI_cleanup_eventset(int EventSet)
int PAPI_assign_eventset_component(int EventSet, int cidx)
int PAPI_create_eventset(int *EventSet)
int PAPI_event_code_to_name(int EventCode, char *out)
int PAPI_query_event(int EventCode)
int PAPI_multiplex_init(void)
int PAPI_unregister_thread(void)
int tests_quiet(int argc, char **argv)
void test_fail(const char *file, int line, const char *call, int retval)
int PAPI_set_multiplex(int EventSet)
int PAPI_destroy_eventset(int *EventSet)
int PAPI_set_domain(int domain)
static void * case4_pthreads(void *arg)
int PAPI_start(int EventSet)
static void * case2_pthreads(void *arg)
const PAPI_hw_info_t * PAPI_get_hardware_info(void)
static long long values[NUM_EVENTS]
static const PAPI_hw_info_t * hw_info