123 int flops1, flops2, flops3, flops4;
139 if (!
quiet) printf(
"Can't find PAPI_TOT_INS\n");
140 test_skip(__FILE__,__LINE__,
"Event missing",1);
144 if (!
quiet) printf(
"Can't find PAPI_TOT_CYC\n");
145 test_skip(__FILE__,__LINE__,
"Event missing",1);
164 pthread_attr_init( &attr );
165 #ifdef PTHREAD_CREATE_UNDETACHED 166 pthread_attr_setdetachstate( &attr, PTHREAD_CREATE_UNDETACHED );
168 #ifdef PTHREAD_SCOPE_SYSTEM 169 retval = pthread_attr_setscope( &attr, PTHREAD_SCOPE_SYSTEM );
175 rc = pthread_create( &e_th, &attr,
Thread, (
void * ) &flops1 );
181 rc = pthread_create( &f_th, &attr,
Thread, (
void * ) &flops2 );
188 rc = pthread_create( &g_th, &attr,
Thread, (
void * ) &flops3 );
195 rc = pthread_create( &h_th, &attr,
Thread, (
void * ) &flops4 );
201 pthread_attr_destroy( &attr );
204 pthread_join( h_th, NULL );
205 pthread_join( g_th, NULL );
206 pthread_join( f_th, NULL );
207 pthread_join( e_th, NULL );
213 printf(
"Master real usec : \t%lld\n",
elapsed_us );
214 printf(
"Master real cycles : \t%lld\n",
elapsed_cyc );
219 pthread_exit( NULL );
void test_pass(const char *filename)
unsigned long int pthread_t
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)
int PAPI_query_event(int EventCode)
long long PAPI_get_real_usec(void)
int tests_quiet(int argc, char **argv)
void test_fail(const char *file, int line, const char *call, int retval)
long long PAPI_get_real_cyc(void)