[Omp] Detecting No. of processors during OpenMP execution

Waibhav Tembe tembe at bioanalysis.org
Tue Jan 18 10:44:46 PST 2005


Hello,

I am using OpenMP for my application on Linux system using Intel's ecc compiler with -openmp option on a node that has multiple processors sharing memory. Although there is a facility in OpenMP to set the number of processors (by selecting omp_ set_num_threads ), I was  wondering if there is any way (perhaps from the OS)  to check the actual number of processors that were used. For example, if I set num. of threads = 8 and for some reason, only 4 processors are used (each processors typically executes 2 threads), then I would like to be able to generate a report that captures this information. Its going to be used to test the effectiveness of some tools in using the parallel processing capabilities. Is there any way to find IDs of the processors that were used for a specific run of a program? 

I thought of issuing a "ps" command during execution. But I am hoping that there is some smarter way. Any pointers in this direction are welcome!
  
Thanks a lot.

w






More information about the Omp mailing list