Go to the source code of this file.
|
| void * | Thread (void *data) |
| |
| int | main (int argc, char *argv[]) |
| |
◆ NITER
◆ main()
| int main |
( |
int |
argc, |
|
|
char * |
argv[] |
|
) |
| |
Definition at line 35 of file pthrtough2.c.
47 test_fail( __FILE__, __LINE__,
"PAPI_library_init",
ret );
51 long ( * )(
void ) ) ( pthread_self ) ) ) !=
53 test_fail( __FILE__, __LINE__,
"PAPI_thread_init",
ret );
55 pthread_attr_init( &attr );
56 #ifdef PTHREAD_CREATE_UNDETACHED 57 pthread_attr_setdetachstate( &attr, PTHREAD_CREATE_UNDETACHED );
59 #ifdef PTHREAD_SCOPE_SYSTEM 60 ret = pthread_attr_setscope( &attr, PTHREAD_SCOPE_SYSTEM );
62 test_skip( __FILE__, __LINE__,
"pthread_attr_setscope",
ret );
69 printf(
"Creating %d threads for %d iterations each of:\n",
71 printf(
"\tregister\n" );
72 printf(
"\tcreate_eventset\n" );
73 printf(
"\tdestroy_eventset\n" );
74 printf(
"\tunregister\n" );
80 for ( j = 0; j < nthr; j++ ) {
81 ret = pthread_create( &th[j], &attr, &
Thread, NULL );
83 printf(
"Failed to create thread: %d\n", j );
86 printf(
"Continuing test with %d threads.\n", j - 1 );
95 for ( j = 0; j < nthr; j++ ) {
96 pthread_join( th[j], NULL );
void test_pass(const char *filename)
unsigned long int pthread_t
void * Thread(void *data)
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 tests_quiet(int argc, char **argv)
void test_fail(const char *file, int line, const char *call, int retval)
◆ Thread()
| void* Thread |
( |
void * |
data | ) |
|
Definition at line 12 of file pthrtough2.c.
19 test_fail( __FILE__, __LINE__,
"PAPI_thread_init",
ret );
23 test_fail( __FILE__, __LINE__,
"PAPI_create_eventset",
ret );
26 test_fail( __FILE__, __LINE__,
"PAPI_destroy_eventset",
ret );
29 test_fail( __FILE__, __LINE__,
"PAPI_unregister_thread",
ret );
int PAPI_register_thread(void)
int PAPI_create_eventset(int *EventSet)
int PAPI_unregister_thread(void)
void test_fail(const char *file, int line, const char *call, int retval)
int PAPI_destroy_eventset(int *EventSet)