120 int maxthr = omp_get_max_threads( );
122 long long *flops = calloc( maxthr,
sizeof (
long long ) );
123 long long *flopi = calloc( maxthr,
sizeof (
long long ) );
130 if ( ( flops == NULL ) || ( flopi == NULL ) )
139 test_fail( __FILE__, __LINE__,
"PAPI_get_hardware_info", 2 );
143 long ( * )(
void ) ) ( omp_get_thread_num ) );
150 flopper =
Thread( 65536 ) / 65536;
151 printf(
"flopper=%d\n", flopper );
153 for (
int i = 0;
i < 100000;
i++ )
154 #pragma omp parallel
private(tid)
156 tid = omp_get_thread_num( );
157 flopi[tid] =
rand( ) * 3;
161 if ( flops[tid] < flopi[tid] ) {
162 printf(
"test iteration=%d\n",
i );
163 for (
int j = 0; j < omp_get_num_threads( ); j++ ) {
164 printf(
"Thread %#x Value %6lld %c %6lld", j, flops[j],
165 ( flops[j] < flopi[j] ) ?
'<' :
'=', flopi[j] );
166 for (
int k = 0; k < omp_get_num_threads( ); k++ )
167 if ( ( k != j ) && ( flops[k] == flops[j] ) )
168 printf(
" == Thread %#x!", k );
171 test_fail( __FILE__, __LINE__,
"value returned for thread",
void test_pass(const char *filename)
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)
const PAPI_hw_info_t * hw_info
int tests_quiet(int argc, char **argv)
void test_fail(const char *file, int line, const char *call, int retval)
const PAPI_hw_info_t * PAPI_get_hardware_info(void)