Hy. I need a little help. I installed codeblok on my ubuntu 8.04 and i tryed to compile a simple parallel program that uses 2 threads. It compiles but it shows an warning.
The code is:
#include <omp.h>
#include <stdio.h>
void main () {
int nthreads, tid;
#pragma omp parallel private(nthreads, tid)
{
tid = omp_get_thread_num();
printf("Hello World from thread = %d\n", tid);
if (tid == 0)
{
nthreads = omp_get_num_threads();
printf("Number of threads = %d\n", nthreads);
}
}
}
By default it shuld say hello from 2 threads.
The warning is:
warning: ignoring #pragma omp parallel
It always uses only one thread. I tried to set a difrent numbre of threads using omp_set_num_thread(10) but still the same warning.
I set the compiler to add -fopenmp when comileing but the warning persist and the result is the same.
I compiled and runned the source code in the command line and it all works perfectly.
Can anybody tell me how to setup codebloks so that it doesn't ingore #pragma omp paralle.
Thanks George!