92{
94 int flops1, flops2, flops3, flops4, flops5;
98
99
101
102 if (!
quiet) printf(
"Testing threads\n");
103
107 }
108
110 ( pthread_self ) );
114 "PAPI_thread_init",
retval );
115 }
116 else {
118 "PAPI_thread_init",
retval );
119 }
120 }
121
122 pthread_attr_init( &attr );
123
124#ifdef PTHREAD_CREATE_UNDETACHED
125 pthread_attr_setdetachstate( &attr, PTHREAD_CREATE_UNDETACHED );
126#endif
127
128#ifdef PTHREAD_SCOPE_SYSTEM
129 retval = pthread_attr_setscope( &attr, PTHREAD_SCOPE_SYSTEM );
132 }
133#endif
134
135 flops1 = 1000000;
136 rc = pthread_create( &e_th, &attr,
Thread, (
void * ) &flops1 );
140 }
141
142 flops2 = 2000000;
143 rc = pthread_create( &f_th, &attr,
Thread, (
void * ) &flops2 );
147 }
148
149 flops3 = 4000000;
150 rc = pthread_create( &g_th, &attr,
Thread, (
void * ) &flops3 );
154 }
155
156 flops4 = 8000000;
157 rc = pthread_create( &h_th, &attr,
Thread, (
void * ) &flops4 );
161 }
162
163 pthread_attr_destroy( &attr );
164
165 flops5 = 500000;
167
168 pthread_join( h_th, NULL );
169 pthread_join( g_th, NULL );
170 pthread_join( f_th, NULL );
171 pthread_join( e_th, NULL );
172
174
175 pthread_exit( NULL );
176
177 return 1;
178}
initialize the PAPI library.
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)