Version française
Home     About     Download     Resources     Contact us    
Browse thread
Re: [Caml-list] Regarding SMP computing
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Jonathan T Bryant <jtbryant@v...>
Subject: Re: [Caml-list] Regarding SMP computing



Yoann Padioleau wrote:


>Richard Jones <rich@annexia.org> writes:
>
>> On Mon, Sep 25, 2006 at 08:13:50AM -0400, Jacques Carette wrote:
>>> Over on Haskell-cafe, Simon Peyton-Jones says:
>>> "GHC 6.6 (release candidate available) supports parallel execution on 
>>> SMP machines.
>>> 
>>> Garbage collection is not parallelised yet, something we plan to fix
>>> this autumn."
>>> 
>>> A bit of competition is a good thing, isn't it?
>>
>> Can someone explain how/if this is better than using MPI for
>> parallelism?  The reason I ask is that we are starting to use MPI for
>> real on SMP machines to process our larger datasets.
>
>I guess that with a working shared-memory SMP support, you
>don't pay the communication cost you have with MPI. 
>

Again, if you are using MPI, look at the Event module.  It's a set of 
message passing concurrency primitives and operations.  Reasoning about 
message passing concurrency (for correctness and such) is typically 
much simpler than shared memory concurrency, and it fits very cleanly 
into the functional paradigm.  The only thing the Event module lacks 
(as compared to MPI) are a) collective channels/operations, b) 
inter-(heavyweight)-process comunnication, c) asynchronous 
communications.

Two of these (a and c) are almost trivial to write extensions while (b) 
is harder (but very doable).  Note that (b) is only needed because the 
OCaml GC won't allow you to use multiple processors, so to take emulate 
this on an SMP system, a small library has to be written to communicate 
over sockets (UNIX or INET) and a few heavyweight processes can be 
forked.

Fortunately, it is possible to wrap the Event module with these 
extensions so that it is backwards compatible, which is very 
convenient. :).

--Jonathan Bryant