121{
123 int flops1, flops2, flops3, flops4;
128
129
131
132
136 }
137
139 if (!
quiet) printf(
"Can't find PAPI_TOT_INS\n");
140 test_skip(__FILE__,__LINE__,
"Event missing",1);
141 }
142
144 if (!
quiet) printf(
"Can't find PAPI_TOT_CYC\n");
145 test_skip(__FILE__,__LINE__,
"Event missing",1);
146 }
147
149 ( pthread_self ) );
150
154 }
155 else {
157 }
158 }
159
161
163
164 pthread_attr_init( &attr );
165#ifdef PTHREAD_CREATE_UNDETACHED
166 pthread_attr_setdetachstate( &attr, PTHREAD_CREATE_UNDETACHED );
167#endif
168#ifdef PTHREAD_SCOPE_SYSTEM
169 retval = pthread_attr_setscope( &attr, PTHREAD_SCOPE_SYSTEM );
172#endif
173
174 flops1 = 1000000;
175 rc = pthread_create( &e_th, &attr,
Thread, (
void * ) &flops1 );
179 }
180 flops2 = 2000000;
181 rc = pthread_create( &f_th, &attr,
Thread, (
void * ) &flops2 );
185 }
186
187 flops3 = 4000000;
188 rc = pthread_create( &g_th, &attr,
Thread, (
void * ) &flops3 );
192 }
193
194 flops4 = 8000000;
195 rc = pthread_create( &h_th, &attr,
Thread, (
void * ) &flops4 );
199 }
200
201 pthread_attr_destroy( &attr );
202 flops1 = 500000;
204 pthread_join( h_th, NULL );
205 pthread_join( g_th, NULL );
206 pthread_join( f_th, NULL );
207 pthread_join( e_th, NULL );
208
211
213 printf(
"Master real usec : \t%lld\n",
elapsed_us );
214 printf(
"Master real cycles : \t%lld\n",
elapsed_cyc );
215 }
216
218
219 pthread_exit( NULL );
220
221 return 0;
222}
get real time counter value in clock cycles Returns the total real time passed since some arbitrary s...
get real time counter value in microseconds
initialize the PAPI library.
Query if PAPI event exists.
Initialize thread support in the PAPI library.
unsigned long int pthread_t
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)