[Omp] A basic question about OpenMP
Abhijit Joshi
joshi1974 at gmail.com
Mon Jun 25 18:04:13 PDT 2007
Hello everyone,
I am a newcomer to OpenMP, but have used MPI for many years. I recently
converted one of my MPI FORTRAN codes to OpenMP to see if I get better
performance on a shared memory multiple processor SGI Altix at the
University of Connecticut (system specs below). I have a very basic question
about the way OpenMP works. Maybe the reader can point me in the right
direction.
During OpenMP implementation, is *thread* = *processor* ? 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). Based on preliminary tests, the OpenMP version shows worsening
behavior (increasing run times) with increasing number of threads. I suspect
this is because all the threads are running on the same processor and thus
the performance actually deteriorates due to the additional overheads
involved in forking and re-joining of the multiple threads.
In MPI, we can specify the number of processors in the mpirun command. Is
there something similar for OpenMP ? Currently I use
CALL OMP_SET_NUM_THREADS(5)
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 ? I currently use the following commands on the SGI
Altix to compile and run the OpenMP version of my FORTRAN code.
compile ifort filename.f -openmp
run a.out
*System*: SGI Altix 3700 BX2 System
*Motherboard Processor(s)*: 64 x Intel Itanium 2 Processors (1.5GHz with 4MB
cache)
*Memory and Hard Disk Space*
*RAM*: 64 GB Memory
*Hard Disk*: 1 x 146 GB 10K RPM SCSI Hard Drive (System Disk)
*Other Disk(s)*: 4 x 300 GB 10K RPM Ultra320 SCSI Hard Drives
The MPI version of my code works perfectly well on the above system. I am
considering using OpenMP mainly to try and take advantage of the shared
memory architecture of the SGI Altix. Thanks in advance for your help.
- Abhijit
---------------------------------------------------------
Abhijit S. Joshi, Ph. D.
Postdoctoral Fellow
Solid Oxide Fuel Cell Research Group
Department of Mechanical Engineering
University of Connecticut
Storrs, CT 06269 USA
---------------------------------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://openmp.org/pipermail/omp/attachments/20070625/73d72308/attachment.html
More information about the Omp
mailing list