CFD Online Discussion Forums

CFD Online Discussion Forums (
-   Main CFD Forum (
-   -   OpenMP,MPI and dual core (

Quarkz December 5, 2007 18:09

OpenMP,MPI and dual core

I've some confusion regarding OpenMP,MPI and dual/quad core processors. Hence, I hope experts out there can help me answer...Btw, I'm using fortran to write my own CFD code.

1. If I've a dual/quad core processor, does it mean that using OpenMP or MPI on my code can make it run faster? e.g. thru using multiple threads during looping.

2. Is OpenMP better (faster/easier) than MPI on multiple core processors, esp if it's only a dual or quad core on a single chip?

3. Will the time taken to solve a system of equations arising from poisson/momentum eqns be reduced if I'm using a dual/quad core? Is there such linear sparse solver available? I was told that the current solver which I use (PETSc) 'll not have much improvement since it uses the whole memory bandwidth. Hence it 'll not work well on shared memory processors.

Thank you very much

agg December 7, 2007 00:19

Re: OpenMP,MPI and dual core

I'll try to answer your questions based on my knowledge.

1) Yes, on a dual/quad core machine using OpenMP or MPI should make the code run faster (considering a reasonably well written code). The advantage of MPI on a shared machine is that no communication will be required via interconnect. If 4 cores/processors is the max you want to use for your application, OpenMP should be sufficient. For more than 4 processors, OpenMP is not known to scale well in many applications.

2) Can't say if OpenMP is better than MPI on 4 cores, but I think OpenMP is easier to implement than MPI. There are compiler options that invoke multiple threads during execution (just like OpenMP) and you can use this as a start if you have no prior experience in OpenMP.

3) Aztec is a parallel linear equation solver developed by Sandia National Lab. This is not as exhaustive as PETSc and might be an answer to your memory bandwidth problem.

Quarkz December 7, 2007 20:29

Re: OpenMP,MPI and dual core
Ok Thanks. I'll take a look at Aztec, although the site seems to be down now.

All times are GMT -4. The time now is 03:04.