From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id E754CBC68 for ; Tue, 26 Sep 2006 03:41:36 +0200 (CEST) Received: from mailx.valdosta.edu (mailx.valdosta.edu [168.18.130.251]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id k8Q1fYFM032326 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Tue, 26 Sep 2006 03:41:36 +0200 Received: from blazemail.valdosta.edu (blazemail.valdosta.edu [168.18.130.208]) by mailx.valdosta.edu (8.13.6/8.13.6) with ESMTP id k8Q1fVXQ028500 for ; Mon, 25 Sep 2006 21:41:31 -0400 (EDT) (envelope-from jtbryant@valdosta.edu) Received: from luminis (luminis [168.18.130.219]) by blazemail.valdosta.edu (iPlanet Messaging Server 5.2 HotFix 2.04 (built Feb 8 2005)) with SMTP id <0J6600A9GFD73X@blazemail.valdosta.edu> for caml-list@yquem.inria.fr; Mon, 25 Sep 2006 21:41:31 -0400 (EDT) Date: Mon, 25 Sep 2006 21:41:31 -0400 (EDT) From: Jonathan T Bryant Subject: Re: [Caml-list] Regarding SMP computing To: caml-list@yquem.inria.fr Message-id: <6561332.1159234891447.JavaMail.jtbryant@valdosta.edu> MIME-version: 1.0 Content-type: text/plain; charset=UTF-8 Content-transfer-encoding: 7BIT X-PMX-Version: 5.2.0.264296, Antispam-Engine: 2.3.0.1, Antispam-Data: 2006.9.25.181942 X-Miltered: at discorde with ID 4518854E.002 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; peyton-jones:01 parallelism:01 lacks:01 trivial:01 doable:01 ocaml:01 sockets:01 unix:01 2006:98 wrote:01 wrote:01 garbage:01 caml-list:01 writes:01 cleanly:01 Yoann Padioleau wrote: >Richard Jones 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