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 EEF777EE99 for ; Wed, 8 Jan 2014 09:38:32 +0100 (CET) Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of gabriel.scherer@gmail.com) identity=pra; client-ip=209.85.214.53; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="gabriel.scherer@gmail.com"; x-sender="gabriel.scherer@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of gabriel.scherer@gmail.com designates 209.85.214.53 as permitted sender) identity=mailfrom; client-ip=209.85.214.53; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="gabriel.scherer@gmail.com"; x-sender="gabriel.scherer@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-bk0-f53.google.com) identity=helo; client-ip=209.85.214.53; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="gabriel.scherer@gmail.com"; x-sender="postmaster@mail-bk0-f53.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AswBAKkNzVLRVdY1m2dsb2JhbAA/GoNDVas/jjKBCQgWDgEBAQEBBgsLCRQogiUBAQEDAUABFAcRDAEDAQsGBQsNLiEBAREBBQEcBhMJEodUAQMJCA02nR6MXIMJkTAKGScNZIQREQEFDIxmgWANJgeENwSWKwOBaYEwiyqDThgphFo7 X-IPAS-Result: AswBAKkNzVLRVdY1m2dsb2JhbAA/GoNDVas/jjKBCQgWDgEBAQEBBgsLCRQogiUBAQEDAUABFAcRDAEDAQsGBQsNLiEBAREBBQEcBhMJEodUAQMJCA02nR6MXIMJkTAKGScNZIQREQEFDIxmgWANJgeENwSWKwOBaYEwiyqDThgphFo7 X-IronPort-AV: E=Sophos;i="4.95,623,1384297200"; d="scan'208";a="52208323" Received: from mail-bk0-f53.google.com ([209.85.214.53]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/RC4-SHA; 08 Jan 2014 09:38:32 +0100 Received: by mail-bk0-f53.google.com with SMTP id na10so572871bkb.40 for ; Wed, 08 Jan 2014 00:38:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; bh=qHsSTLRnx4Tteahe8IQyp3ij2vhxCUewfQuqHLs97hw=; b=P8uVRJky8oWHovjN6GQj37Ky7j93bzpmu3BbyChc197z2hrOOxAfujGnQPyUPuQE/s mQmIcap7NR/jUXwgP9ngslh3H9hCrcdP1D9/rpvu2UrF/IzUqtyHYwUHbeS3eCvxDqCt hJahfys2y40nU7kNiU5rKs+XHQG17KWsmyzPnSQEGigC7uvvN2IzL/y0kNy4/Mto3zlH ihmgtFnkUkX462NqsoZBzGDHnhCpRGF1UP+kaS0tZyBUeLSnVR3jIIVkhhCkMnA2nkhd cBIBNvcXcWSzis4tuZLlVXf9pzKoc0BDrYfFz7Ahpr9qdtuNmMlUf/Fh8yn/iWLBskNh gbrQ== X-Received: by 10.205.108.133 with SMTP id ec5mr146734bkc.154.1389170311507; Wed, 08 Jan 2014 00:38:31 -0800 (PST) MIME-Version: 1.0 Received: by 10.205.45.5 with HTTP; Wed, 8 Jan 2014 00:37:51 -0800 (PST) In-Reply-To: References: <1389126940.2692.4.camel@zotac> From: Gabriel Scherer Date: Wed, 8 Jan 2014 09:37:51 +0100 Message-ID: To: Yotam Barnoy Cc: Gerd Stolpmann , Ocaml Mailing List Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [Caml-list] Concurrent/parallel programming > Also, regarding the ocaml_modify() and ocaml_initialize() regression in 4= .01 -- yikes! > Is there any way to get support back for writing outside of the ocaml hea= p? > This seems like a pretty big deal! (Sorry if I'm arriving late for whatev= er discussion > took place about this before). The change was made to improve performances (and indeed gave a nice boost to modify-heavy code). Labelling it a yikes-worthy regression is a bit unfair. You should have look at - the discussion that prompted the change http://caml.inria.fr/mantis/view.php?id=3D6019 - the discussion on the ocamlnet problem http://caml.inria.fr/mantis/view.php?id=3D6084 Modifying values outside the heap is still allowed using C primitives, but is not allowed anymore for OCaml heap-update constructs (x.f <- foo, x.(f) <- foo, etc.). On Wed, Jan 8, 2014 at 3:35 AM, Yotam Barnoy wrote: > > Thanks for the links and info, everyone. > > Gerd, would it be possible to put netmulticore up on opam? I realize this= is a sensitive topic for you, but from what I can tell, this is the most c= omprehensive and efficient solution to parallel programming that exists for= ocaml, so why not make it as easily available as possible? > > Also, regarding the ocaml_modify() and ocaml_initialize() regression in 4= .01 -- yikes! Is there any way to get support back for writing outside of t= he ocaml heap? This seems like a pretty big deal! (Sorry if I'm arriving la= te for whatever discussion took place about this before). > > -Yotam > > > On Tue, Jan 7, 2014 at 3:35 PM, Gerd Stolpmann w= rote: >> >> There is Netmulticore, a part of Ocamlnet: >> >> http://projects.camlcity.org/projects/dl/ocamlnet-3.7.3/doc/html-main/In= tro.html#ch_comp >> >> It utilizes shared memory, and accesses it from several processes. There >> is no C code involved, but it is fairly unsafe nevertheless, because you >> need to stick to certain programming rules, or the program crashes. >> However, if you manage to encapsulate all the unsafe things, it is a >> good option. I'm using Netmulticore in the Plasma Map/Reduce >> implementation. >> >> Gerd >> >> Am Dienstag, den 07.01.2014, 14:54 -0500 schrieb Yotam Barnoy: >> > Hi List >> > >> > >> > So far, I've been programming in ocaml using only sequential programs. >> > In my last project, which was an implementation of a large machine >> > learning algorithm, I tried to speed up computation using a little bit >> > of parallelism with ParMap, and it was a complete failure. It's >> > possible that more time would have yielded better results, but I just >> > didn't have the time to invest in it given how bad the initial results >> > were. >> > >> > >> > My question is, what are the options right now as far as parallelism >> > is concerned? I'm not talking about cooperative multitasking, but >> > about really taking advantage of multiple cores. I'm well aware of the >> > runtime lock and I'm ok with message passing between processes or a >> > shared area in memory, but I'd rather have something more high level >> > than starting up several processes, creating a named pipe or a socket, >> > and trying to pass messages through that. Also, I assume that using a >> > shared area in memory involves some C code? Am I wrong about that? >> > >> > >> > I was expecting Core's Async to fill this role, but realworldocaml is >> > fuzzy on this topic, apparently preferring to dwell on cooperative >> > multitasking (which is fine but not what I'm looking for), and I >> > couldn't find any other documentation that was clearer. >> > >> > >> > Thanks >> > >> > Yotam >> > >> >> -- >> ------------------------------------------------------------ >> Gerd Stolpmann, Darmstadt, Germany gerd@gerd-stolpmann.de >> My OCaml site: http://www.camlcity.org >> Contact details: http://www.camlcity.org/contact.html >> Company homepage: http://www.gerd-stolpmann.de >> ------------------------------------------------------------ > >