From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id E2B217EE80 for ; Sun, 17 Mar 2013 13:06:14 +0100 (CET) Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of jon@ffconsultancy.com) identity=pra; client-ip=212.159.14.19; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="jon@ffconsultancy.com"; x-sender="jon@ffconsultancy.com"; x-conformance=sidf_compatible Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of jon@ffconsultancy.com) identity=mailfrom; client-ip=212.159.14.19; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="jon@ffconsultancy.com"; x-sender="jon@ffconsultancy.com"; x-conformance=sidf_compatible Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@avasout04.plus.net) identity=helo; client-ip=212.159.14.19; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="jon@ffconsultancy.com"; x-sender="postmaster@avasout04.plus.net"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Am4BAI2wRVHUnw4TkWdsb2JhbABDiDSrZ5EWgW0WDgEBAQEJCwsHFAQkgioBAQUIAhljAwIJGAICJgICGSMbAgQBHQULh32wL5FZgSOMPIE9gi2BEwOOKpxAgWo X-IPAS-Result: Am4BAI2wRVHUnw4TkWdsb2JhbABDiDSrZ5EWgW0WDgEBAQEJCwsHFAQkgioBAQUIAhljAwIJGAICJgICGSMbAgQBHQULh32wL5FZgSOMPIE9gi2BEwOOKpxAgWo X-IronPort-AV: E=Sophos;i="4.84,859,1355094000"; d="scan'208";a="7990599" Received: from avasout04.plus.net ([212.159.14.19]) by mail2-smtp-roc.national.inria.fr with ESMTP; 17 Mar 2013 13:06:14 +0100 Received: from XPS ([31.185.175.11]) by avasout04 with smtp id Cc611l0020F7ifT01c62yZ; Sun, 17 Mar 2013 12:06:13 +0000 X-CM-Score: 0.00 X-CNFS-Analysis: v=2.0 cv=XeZXOvF5 c=1 sm=1 a=lmAok5RoGzXh3dYE0ZBWWg==:17 a=9NSLKdjcVD4A:10 a=Xub9RBUEA-sA:10 a=Kvk-SOs2Z7YA:10 a=IkcTkHD0fZMA:10 a=r2vSxAw-AAAA:8 a=cdQsuJNHsHMA:10 a=ZzUxspUhgw5wm0c9c90A:9 a=QEXdDO2ut3YA:10 a=lmAok5RoGzXh3dYE0ZBWWg==:117 X-AUTH: jdh302:2500 Reply-To: From: "Jon Harrop" To: "'Pierre-Alexandre Voye'" , "'caml-list'" References: <00ba01ce200c$d23f1910$76bd4b30$@ffconsultancy.com> <010801ce201f$afd6ad80$0f840880$@ffconsultancy.com> In-Reply-To: Date: Sun, 17 Mar 2013 12:06:06 -0000 Organization: Flying Frog Consultancy Ltd. Message-ID: <037b01ce2307$d54e6130$7feb2390$@ffconsultancy.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Outlook 14.0 Thread-Index: AQGTusbNW31EwOb0tRgwTltM6UzJNgH30vQ2ArLJNnABxXIViZjoiS5g Content-Language: en-gb Subject: RE: [Caml-list] Case study in optimization: porting a compiler from OCaml to F# Pierre-Alexandre Voye wrote: > So you could maybe use Parmap.map ? > Parmap.parmap ~ncores:4 funct (Parmap.L elem_list) What happens if the inner function returns results via mutation? I assume y= ou must rearrange the code to return all results explicitly and they will t= hen be deep copied (which destroys scalability due to limited shared memory= bandwidth on multicores). Does it do load balancing? I assume not given that ncores is hardcoded. Does a parmap with ncores=3D4 inside a parmap with ncores=3D4 create 16 pro= cesses? Does it deep copy inputs and/or outputs? I assume so, at least for outputs,= because you cannot write results in-place without a shared mutable heap. Does parmap have a large constant overhead? I assume so if it is forking pr= ocesses. Another solution is to prefork and explicitly communicate all inputs using = message passing but this is equally problematic. You have to rearrange the = code. Deep copying inputs also destroys scalability. Cheers, Jon.