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=1.1 required=5.0 tests=AWL,SPF_NEUTRAL 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 C6FE0BC0A for ; Tue, 5 Jun 2007 21:13:02 +0200 (CEST) Received: from nz-out-0506.google.com (nz-out-0506.google.com [64.233.162.228]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l55JD1RY003714 for ; Tue, 5 Jun 2007 21:13:02 +0200 Received: by nz-out-0506.google.com with SMTP id s18so1316173nze for ; Tue, 05 Jun 2007 12:13:01 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=KHhMAWAkWhqLBwwOwju17Wed/DexOWb9DFVFYvI2meuU3UoS0FCUCpkNq2wphJURMKsOGfnDCUI1be/U53bj2WqCsb9J49HA2kh/hsRqHnRXLu+kx/d9/T9R1kBQ8jUGkdIIrUY2vjqTa9QemiApwRXrXY2MH2+6lB/kUdy5vMQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=HtjkGEjzCgkGZG2qh2uHou0S1f0x5C9THm+qtBORX1ip47HFDvvLO6JEHMkd891eN1X9mDQZnAgzpskmHzq+/bqCaFdqUD0dPeDr+uYDep3+h8IvIsxASo9YIxPqZQbCmuJGsjkckmRntkmtwpbBX7ltzMCFzRPZFcr86qcMcRA= Received: by 10.115.95.1 with SMTP id x1mr6252967wal.1181070781085; Tue, 05 Jun 2007 12:13:01 -0700 (PDT) Received: by 10.114.208.5 with HTTP; Tue, 5 Jun 2007 12:13:01 -0700 (PDT) Message-ID: <875c7e070706051213s37c3ff11q81ca267ee0f9a252@mail.gmail.com> Date: Tue, 5 Jun 2007 15:13:01 -0400 From: "Chris King" To: "Jon Harrop" Subject: Re: [Caml-list] We should all be forking Cc: "Caml List" In-Reply-To: <200706051913.13481.jon@ffconsultancy.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <200706051913.13481.jon@ffconsultancy.com> X-j-chkmail-Score: MSGID : 4665B5BD.000 on discorde : j-chkmail score : X : 0/20 1 0.000 -> 1 X-Miltered: at discorde with ID 4665B5BD.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; ocaml:01 camlp:01 high-level:01 node:01 marshalling:01 sockets:01 o'caml:01 camlp:01 wrote:01 caml-list:01 functions:01 essentially:02 constructs:02 vanilla:03 concurrent:03 On 6/5/07, Jon Harrop wrote: > Following on from our "why not fork" discussion, here is my most elegant > concurrent ray tracer written in vanilla OCaml. > > This program simply runs four processes (forking off three) in parallel to > improve performance when 2-4 CPUs are available (increase "d" if you have >4 > CPUs). I'm curious, have you considered trying camlp3l [1] to parallelize your raytracer? It uses high-level constructs ("skeletons") to describe parallelizable functions, e.g. for a raytracer you can essentially just say "farm out each row to a different computing node". It uses marshalling over TCP/IP sockets, so can be distributed if you like. The forking you just do beforehand in a shell script (though it gives an example where you do it in O'Caml too). [1] http://camlp3l.inria.fr/