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 mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id 19E797EE99 for ; Wed, 8 Jan 2014 12:36:49 +0100 (CET) Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of info@gerd-stolpmann.de) identity=pra; client-ip=212.227.126.186; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="info@gerd-stolpmann.de"; x-sender="info@gerd-stolpmann.de"; x-conformance=sidf_compatible Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of info@gerd-stolpmann.de) identity=mailfrom; client-ip=212.227.126.186; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="info@gerd-stolpmann.de"; x-sender="info@gerd-stolpmann.de"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of postmaster@moutng.kundenserver.de designates 212.227.126.186 as permitted sender) identity=helo; client-ip=212.227.126.186; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="info@gerd-stolpmann.de"; x-sender="postmaster@moutng.kundenserver.de"; x-conformance=sidf_compatible; x-record-type="v=spf1" X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AuYCALY3zVLU4366lWdsb2JhbABZg0O6RoEUFg4BAQEBBw0JCRIqgiUBAQEDAVUYDAULCxguVwYTCRKHYQwJxFwXiTqFJSYHgi+CCASPBocogxmFEAWOfg X-IPAS-Result: AuYCALY3zVLU4366lWdsb2JhbABZg0O6RoEUFg4BAQEBBw0JCRIqgiUBAQEDAVUYDAULCxguVwYTCRKHYQwJxFwXiTqFJSYHgi+CCASPBocogxmFEAWOfg X-IronPort-AV: E=Sophos;i="4.95,624,1384297200"; d="asc'?scan'208";a="43966173" Received: from moutng.kundenserver.de ([212.227.126.186]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/RC4-SHA; 08 Jan 2014 12:36:49 +0100 Received: from office1.lan.sumadev.de (dslb-088-069-138-108.pools.arcor-ip.net [88.69.138.108]) by mrelayeu.kundenserver.de (node=mrbap0) with ESMTP (Nemesis) id 0MWhTP-1VuY2W37AB-00XZYY; Wed, 08 Jan 2014 12:36:47 +0100 Received: from [192.168.0.119] (ip-109-90-191-98.unitymediagroup.de [109.90.191.98]) by office1.lan.sumadev.de (Postfix) with ESMTPSA id 0A317C00D3; Wed, 8 Jan 2014 12:36:46 +0100 (CET) Message-ID: <1389181001.2999.46.camel@e130> From: Gerd Stolpmann To: Yotam Barnoy Cc: Ocaml Mailing List Date: Wed, 08 Jan 2014 12:36:41 +0100 In-Reply-To: References: <1389126940.2692.4.camel@zotac> Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-3XaZr2AGcxEWqxcn+QY+" X-Mailer: Evolution 3.2.3-0ubuntu6 Mime-Version: 1.0 X-Provags-ID: V02:K0:kSf/iz9/L7ZsmWfAw82dazKZ5y/Qxw0UE5NwNTXvvnI k/Jsp12QLxhVNCphoiORJ//zv1OoT1lXX5PbIuxfNvkPO1Ohro 05mnTrx75QeIMMeEHwRe0vogRAQbU84s5Tg6M7/V7SJpx47eyK JETl7A1RfpQswb4AlS1DJl000mpuP7SNoGeVB+v2oqktX4JV5c EyQ0zAMwAIvnd397g3NNl3yqsxJY1jvUH71eUVXOxh7NhuPa8O nTvC9WrAGt4fTkJl0Q9zPcbGxvGvcnrLnd+rH4kIThGbLYa+UC h5IVJePSW/fyr8s93cLCY54GSd/Qb0us5sX8hAcEmdQjCbv1SJ 0ieypvTao6lNwoFjvR2IVeqHsuGFFYaC7RgRioC3b Subject: Re: [Caml-list] Concurrent/parallel programming --=-3XaZr2AGcxEWqxcn+QY+ Content-Type: text/plain; charset="ISO-8859-15" Content-Transfer-Encoding: quoted-printable Am Dienstag, den 07.01.2014, 21:35 -0500 schrieb Yotam Barnoy: > Thanks for the links and info, everyone. >=20 > 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 comprehensive and efficient solution to parallel programming > that exists for ocaml, so why not make it as easily available as > possible? Netmulticore is part of Ocamlnet, and I guess you can get it by simply installing ocamlnet with opam. I'm not the maintainer, so I don't know whether it is included or not. > 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 heap? This seems like a pretty big deal! (Sorry > if I'm arriving late for whatever discussion took place about this > before). There is a workaround in place - so far the OS supports it: thanks to Xavier the symbols caml_modify and caml_initialize are declared as weak in 4.01, allowing them to be redefined in executables. Netmulticore redefines these symbols with their pre-4.01 functions. This isn't optimal yet, because the old write barriers are a bit slower, and because this introduces a very low-level dependency on the current version of Ocaml. Nevertheless, it works for now. (Ideas for a better solution are highly welcome.) Gerd >=20 > -Yotam >=20 >=20 >=20 > On Tue, Jan 7, 2014 at 3:35 PM, Gerd Stolpmann > wrote: > There is Netmulticore, a part of Ocamlnet: >=20=20=20=20=20=20=20=20=20 > http://projects.camlcity.org/projects/dl/ocamlnet-3.7.3/doc/html-= main/Intro.html#ch_comp >=20=20=20=20=20=20=20=20=20 > 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. >=20=20=20=20=20=20=20=20=20 > Gerd >=20=20=20=20=20=20=20=20=20 > 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 > > >=20=20=20=20=20=20=20=20=20 >=20=20=20=20=20=20=20=20=20 > -- > ------------------------------------------------------------ > 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 > ------------------------------------------------------------ >=20 >=20 --=20 ------------------------------------------------------------ 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 ------------------------------------------------------------ --=-3XaZr2AGcxEWqxcn+QY+ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iQEcBAABAgAGBQJSzThJAAoJEAaM4b9ZLB5TBoYH/j1Q0lgXYTGNIOeRP2gFYX6o Bn5qUlOmS9YZLDIGF4obNxtTXjCXlBdOWfMY6EmBqpCeNNH4gJUsumPPAnmx58Yd QvmJcLt0+ch4RvwpnZksiQZyvS+fBuTd45NpzlKx8yNaENvM9EZ9NNTsKW9AEFcG x4+KY4vh7pe+S4Qxq1vwyUU5imlGn/93VUZrcIx9bX/wZF1DSlI66t/0YxdapNSQ elvsGqAO4d+0dN/wpJydMdP+Vx8W83XJazPBDh1xJQAXf6M1QyKpnZdXkmGVJv5D GfAl0g+YcwXJCV/pboSNp6vX5d8E5ffT9xJMcs+Ggu+g2Ph6x/z0oH0HXIcHzOI= =6toa -----END PGP SIGNATURE----- --=-3XaZr2AGcxEWqxcn+QY+--