CFD Online Discussion Forums

CFD Online Discussion Forums (
-   Main CFD Forum (
-   -   Multi-core processor (

jojo June 5, 2007 10:23

Multi-core processor
Hi everybody,

With the coming of multi-core processors sharing memory, is a protocole like MPI still interesting?

Has anybody an experience on clusters of multi-core machines?

Thanks a lot in advance.

Markus Lummer June 6, 2007 00:27

Re: Multi-core processor
Hello Jojo,

In order to take advantage from multi-core processors using languages like Fortran or C++, you have to write parallel programs using e.g. MPI. On clusters of multi-core machines you will request the number of processes with the mpirun command and the operating/MPI system distributes these processes among the available cores.

Regards, Markus

Jonas Holdeman June 7, 2007 07:34

Re: Multi-core processor
I would think that to take advantage of multicore processors you need to write multithreaded code. Then the operating system schedules the threads transparently across the cores. Do Windows and Linux allow explicit user control of each core? One would still need MPI to explicitly schedule the equivalent of threads across machines. Am I wrong about this?

Markus Lummer June 8, 2007 02:22

Re: Multi-core processor
It is sufficient to write MPI code. I have a workstation with two dual core opteron processors running Linux. In order to start a parallel program on the 4 available cores it is sufficient to use the MPI command

mpirun -np 4 executable

As far as I know, the threads are a kind of 'lightweight' processes buried deep in the operating system, that will be accessed through the MPI layer. I don't think that it is possible to write multithreaded code using some high level language.

rt June 8, 2007 04:00

Re: Multi-core processor
>>I don't think that it is possible to write multithreaded code using some high level language.


There are several alternatives: e.g. with pthread library or OpenMP and ...

rt June 8, 2007 04:10

Re: Multi-core processor

with multi-core processors, we need multithreading to use complete machine's power, so multithreading is essential

In MPI library each process is executed as a thread so it works fine on multicore machines but on such machines there are more simpler solution, e.g. multithreading with HPF compiler, or OpenMP programming, or pthread library and other methods.

A critical point: with MPI we usually divide global data to smaller sub-block so each process has good data locality (and so cache coherency), but with OpenMP and other multithreading lib. it is "traditional" (not essential, it is converted to a habit) to break loops and ... directly without increasing data locality and it is why we see that (in literature) MPI has better performance on shared memory machnes in contrast with OpenMP.

phsieh2005 June 8, 2007 07:55

Re: Multi-core processor
Hi, jojo,

I have a cluster consists of 6 workstations: 4 workstations have two dual-core CPUs and two workstations have one dual-core CPU, hence, a total of 20 CPU cores. All my projects involve free surface flow, hence, VOF-type solver.

The drawback with a cluster with multi-core CPUs is that, memory bus may become the bottle-neck.


jojo June 12, 2007 14:49

Re: Multi-core processor
Thanks to all of you for your answer.

Светлана December 3, 2013 00:02

No, you don't need multi-threading, as you can also use multiple processes (with MPI, Multi Process Communication).

All times are GMT -4. The time now is 00:43.