[Omp] A basic question about OpenMP
aduran at ac.upc.edu
aduran at ac.upc.edu
Tue Jun 26 09:20:02 PDT 2007
Abhijit,
Quoting Abhijit Joshi <joshi1974 at gmail.com>:
> During OpenMP implementation, is *thread* = *processor* ?
Not necessarily. That's an implementation detail that is not specified in the
standard. It may be a 1 to 1 equivalence or it may not. You should check the
documentation of the OpenMP implementation you use.
>For example, when
> I run the OpenMP version of my code using 5 threads, I find that only one
> processor is being used, but usage of that processor is 500% (using the top
> command).
The newest versions of top collapse by default the percentages of all cpus into
a single one, so that 500% in fact most probably means 5 cpus working at a 100%
(although it could also a higher number of cpus at a lower % :). You can press
number '1' from top to show all cpu percentages.
> within my code to set the number of "threads" to 5. Apparently, this the not
> the same as the number of processors. Is there another command to set the
> number of processors ?
No. You can only specify the number of OpenMP threads.
Regards,
Alex
More information about the Omp
mailing list