# HG changeset patch # User Volker Grabsch # Date 1274305839 -7200 # Node ID e55bb62b2970775bf572d85c9148d53620617112 # Parent 77ef614fd370a68162f96bc1407291856d388d6e improved test programs of packages libgomp and pthreads diff -r 77ef614fd370 -r e55bb62b2970 src/libgomp-test.c --- a/src/libgomp-test.c Wed May 19 22:35:49 2010 +0200 +++ b/src/libgomp-test.c Wed May 19 23:50:39 2010 +0200 @@ -9,9 +9,11 @@ (void)argc; (void)argv; + omp_set_num_threads(4); + #pragma omp parallel - printf("Hello from thread %d, nthreads %d\n", - omp_get_thread_num(), omp_get_num_threads()); + fprintf(stderr, "Hello from thread %d, nthreads %d\n", + omp_get_thread_num(), omp_get_num_threads()); return 0; } diff -r 77ef614fd370 -r e55bb62b2970 src/pthreads-test.c --- a/src/pthreads-test.c Wed May 19 22:35:49 2010 +0200 +++ b/src/pthreads-test.c Wed May 19 23:50:39 2010 +0200 @@ -4,12 +4,12 @@ #include #include -#define N 10 +#define N 4 void *thread_fn(void *p) { const int *arg = p; - fprintf(stderr, "Hello from thread %d\n", *arg); + fprintf(stderr, "Hello from thread %d, nthreads %d\n", *arg, N); return NULL; }