openmp, linux c not making multiple threads

I have the following code:

#pragma omp parallel
printf("Sample Output");

This is how I’m compiling it:

gcc -o x -fopenmp test.c

and this is the result:

Sample output

But shouldn’t the output be something like this?

Sample output
Sample output
Sample Output
Sample Output

? One line of output for each thread?

Note: I have a quad core system. I’m running linux on a virtual machine (debian).

Thanks in advance

Source: linux

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.