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.3 required=5.0 tests=AWL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by yquem.inria.fr (Postfix) with ESMTP id 1480EBBAF for ; Thu, 24 Sep 2009 03:36:05 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AogCAFZqukrUnwdklGdsb2JhbACCIJhfAQEBAQcNCAkTBLsmhBsF X-IronPort-AV: E=Sophos;i="4.44,441,1249250400"; d="scan'208";a="33401044" Received: from relay.pcl-ipout02.plus.net ([212.159.7.100]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/RC4-SHA; 24 Sep 2009 03:36:04 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvoHAGdpukrUnw4T/2dsb2JhbACCINQ+hBsF Received: from pih-relay06.plus.net ([212.159.14.19]) by relay.pcl-ipout02.plus.net with ESMTP; 24 Sep 2009 02:36:04 +0100 Received: from [87.114.87.187] (helo=leper.local) by pih-relay06.plus.net with esmtp (Exim) id 1MqdFc-0005vU-4x; Thu, 24 Sep 2009 02:36:04 +0100 From: Jon Harrop Organization: Flying Frog Consultancy Ltd. To: Philippe Wang , caml-list@yquem.inria.fr Subject: Re: [Caml-list] OC4MC : OCaml for Multicore architectures Date: Thu, 24 Sep 2009 02:47:17 +0100 User-Agent: KMail/1.9.9 References: <200909240105.18288.jon@ffconsultancy.com> <4d1b2df20909231701l2248f7f7w841b1d5ece9aa62e@mail.gmail.com> In-Reply-To: <4d1b2df20909231701l2248f7f7w841b1d5ece9aa62e@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200909240247.17560.jon@ffconsultancy.com> X-Plusnet-Relay: 38f3febf077d1714bcba54efd1cc8682 X-Spam: no; 0.00; ocaml:01 ocamlopt:01 ocamlopt:01 wget:01 wget:01 ocaml:01 utime:01 utime:01 deques:01 2009:98 2009:98 nursery:98 frog:98 wrote:01 caml-list:01 On Thursday 24 September 2009 01:01:58 you wrote: > Ok... well, I guess that > - whether it is something about your environment that is too different > from ours (in which case build.sh is bad), > - whether you have corrupted your installation (it could be by having > a bad PATH value that makes original ocamlopt be mixed up with oc4mc > ocamlopt) > > What I suggest is to use a default PATH (without modifying it for the > purpose of OC4MC), and do these steps in a clean directory that is not > included in PATH : > > 1) wget oc4mc-2009XXXX.tgz > 2) tar xzf oc4mc-2009XXXX.tgz > 3) cd oc4mc-2009XXXX > 4) wget ocaml 3.10.2 (tar.gz or tar.bz2) > 5) bash build.sh > 6) cd tests > 7) make matmul.th > 8) time ./matmul.th 1000 8 > > Sorry it's messy, we are thinking about something cleaner... (there's > a matter of lack of time somewhere) No problem. I'll be happy to get anything working! Following your advice, it seems to work perfectly now: $ ./matmul.th 500 1 Temp de calcul: utime 2.324145, stime 0.020001, rtime 2.325608 $ ./matmul.th 500 2 Temp de calcul: utime 1.780111, stime 0.000000, rtime 0.890797 $ ./matmul.th 500 3 Temp de calcul: utime 1.784111, stime 0.004000, rtime 0.608895 $ ./matmul.th 500 4 Temp de calcul: utime 1.764110, stime 0.004000, rtime 0.451214 $ ./matmul.th 500 5 Temp de calcul: utime 1.768111, stime 0.000000, rtime 0.393285 $ ./matmul.th 500 6 Temp de calcul: utime 1.924120, stime 0.004001, rtime 0.333215 $ ./matmul.th 500 7 Temp de calcul: utime 1.788112, stime 0.000000, rtime 0.302328 $ ./matmul.th 500 8 Temp de calcul: utime 1.992124, stime 0.000000, rtime 0.290383 Wow! 2.6x faster on 2 cores is good. ;-) That's a really fantastic piece of work. I'll do my best to study it and write literature about it. May I ask, can you give a rough overview of the design? For example, is there a separate nursery per thread so each thread can allocate a certain amount before incurring a global pause? Do you have any ideas for libraries built on top of this, such as a task parallel library using work-stealing deques? Thanks very much!!! -- Dr Jon Harrop, Flying Frog Consultancy Ltd. http://www.ffconsultancy.com/?e