caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Alain Frisch <alain.frisch@lexifi.com>
To: Christophe TROESTLER <Christophe.Troestler@umons.ac.be>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] Efficient OCaml multicore -- roadmap?
Date: Fri, 22 Apr 2011 10:34:03 +0200	[thread overview]
Message-ID: <4DB13D7B.50900@lexifi.com> (raw)
In-Reply-To: <20110421.210304.1267840107736400776.Christophe.Troestler+ocaml@umons.ac.be>

On 04/21/2011 09:03 PM, Christophe TROESTLER wrote:
> On Thu, 21 Apr 2011 11:09:22 +0200, Alain Frisch wrote:
>>
>> On 04/21/2011 09:48 AM, Fabrice Le Fessant wrote:
>>> You think the programmers in the world that are only interested in
>>> floating-point intensive computations, with fine-grain
>>> concurrency, are a huge majority. I think they are not so
>>> many. Can we do a better job of quantifying this ?
>>
>> [...] I guess we are in the nice niche of "embarassingly parallel"
>> tasks.  Again, not so much because of the structure of the numerical
>> problem itself, but because we need to run many independent
>> instances of the problem.
> 
> May you say why Functory is not good enough for this ?
> http://www.lri.fr/~filliatr/functory/About.html

I did not say Functory is not good enough for this. Actually, I did not
know about this project. Although my message was not explicit about it,
we have implemented our own solution, based on a multi-process approach,
and we are quite happy with it. That said, we follow with a lot of
interest all the projects and discussions about making it easier to
write distributed computations in OCaml.

After quickly reading the API and the technical report, I think the
library would indeed be a good match for the kind of computations we are
dealing with. Actually, it has a lot in common with the solution we have
implemented. Some difference between Functory and our solution:

- Functory's Cores module relies on system calls which are not available
under Windows. Our solution is based on a different technique: external
worker processed are spawned by the main program
by executing argv[0] with a special command-line argument (to
distinguish from a regular invocation). Our "Computations" library
intercepts this argument and runs a loop that waits for new tasks
(similar to Functory's Network solutions).

- Functory's external worker processes execute a single task and die.
In our solution, we maintain a pool of available worker processes; when
a worker process has finished computing a task, it notifies the
scheduler explicitly. This avoids some non-negligible start-up costs
(especially under Windows) and allows workers to keep some in-memory
caches and database connections. Again, this looks similar to Functory's
Network approach.

- Our API allows workers to notify the caller with intermediate results
and progress feedback (typically, to display some progress bar and
status to the user).  For instance, a single Monte Carlo pricing task
reports progress percentage in the GUI, together with the current price
estimate and observed variance.  Similarly, a "portfolio" pricing task
reports the percentage (number of contracts already priced). The API
also allows the caller to kill a running task (typically when the user
clicks on "Stop" in the GUI). We do this by asking the OS to kill the
worker process. The caller can still use intermediate results to do
something useful.

- We also have some solution for distributing computations across the
network (not in use in production yet), but we go through our
application's database instead of direct TCP networking. Any connected
client makes its cores available to take some tasks from the task pool;
and it can itself submit new tasks. (This also give a cache to share the
result of computations between different clients.)


Cheers,

Alain

  parent reply	other threads:[~2011-04-22  8:34 UTC|newest]

Thread overview: 74+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <2054357367.219171.1300974318806.JavaMail.root@zmbs4.inria.fr>
2011-03-24 23:13 ` Fabrice Le Fessant
2011-03-25  0:23   ` [Caml-list] " Sylvain Le Gall
2011-03-25  9:55   ` [Caml-list] " Alain Frisch
2011-03-25 11:44     ` Gerd Stolpmann
     [not found]   ` <1396338209.232813.1301046980856.JavaMail.root@zmbs4.inria.fr>
2011-03-25 10:23     ` Fabrice Le Fessant
2011-03-25 12:07       ` Gerd Stolpmann
2011-04-16 12:12         ` Jon Harrop
2011-03-25 10:51   ` Hugo Ferreira
2011-03-25 12:25     ` Gerd Stolpmann
2011-03-25 12:58       ` Hugo Ferreira
     [not found]       ` <341494683.237537.1301057887481.JavaMail.root@zmbs4.inria.fr>
2011-03-25 13:10         ` Fabrice Le Fessant
2011-03-25 13:41           ` Dario Teixeira
2011-03-30 18:12             ` Jon Harrop
2011-03-25 15:44           ` Hugo Ferreira
2011-03-25 18:24             ` Martin Jambon
2011-03-25 19:19               ` Hugo Ferreira
2011-03-25 20:26                 ` Gerd Stolpmann
2011-03-26  9:11                   ` Hugo Ferreira
2011-03-26 10:31                   ` Richard W.M. Jones
2011-03-30 16:56                     ` Jon Harrop
2011-03-30 19:24                       ` Richard W.M. Jones
2011-04-20 21:44                   ` Jon Harrop
2011-04-19  9:57                 ` Eray Ozkural
2011-04-19 10:05                   ` Hugo Ferreira
2011-04-19 20:26                   ` Gerd Stolpmann
2011-04-20  7:59                     ` Hugo Ferreira
2011-04-20 12:30                       ` Markus Mottl
2011-04-20 12:53                         ` Hugo Ferreira
2011-04-20 13:22                           ` Markus Mottl
2011-04-20 14:00                       ` Edgar Friendly
2011-04-19 22:49                 ` Jon Harrop
2011-03-30 17:02               ` Jon Harrop
2011-04-20 19:23               ` Jon Harrop
2011-04-20 20:05                 ` Alexy Khrabrov
2011-04-20 23:00                   ` Jon Harrop
     [not found]                   ` <76544177.594058.1303341821437.JavaMail.root@zmbs4.inria.fr>
2011-04-21  7:48                     ` Fabrice Le Fessant
2011-04-21  8:35                       ` Hugo Ferreira
2011-04-23 17:32                         ` Jon Harrop
2011-04-21  9:09                       ` Alain Frisch
     [not found]                         ` <20110421.210304.1267840107736400776.Christophe.Troestler+ocaml@umons.ac.be>
2011-04-21 19:53                           ` Hezekiah M. Carty
2011-04-22  8:34                           ` Alain Frisch [this message]
     [not found]                         ` <799994864.610698.1303412613509.JavaMail.root@zmbs4.inria.fr>
2011-04-22  8:06                           ` Fabrice Le Fessant
2011-04-22  9:11                             ` Gerd Stolpmann
2011-04-23 10:17                               ` Eray Ozkural
2011-04-23 13:47                                 ` Alexy Khrabrov
2011-04-23 17:39                                   ` Eray Ozkural
2011-04-23 20:18                                     ` Alexy Khrabrov
2011-04-23 21:18                                       ` Jon Harrop
2011-04-24  0:33                                       ` Eray Ozkural
2011-04-28 14:42                                         ` orbitz
2011-04-23 19:02                                 ` Jon Harrop
2011-04-22  9:44                             ` Vincent Aravantinos
2011-04-21 10:09                       ` Philippe Strauss
2011-04-23 17:44                         ` Jon Harrop
2011-04-23 17:05                       ` Jon Harrop
2011-04-20 20:30                 ` Gerd Stolpmann
2011-04-20 23:33                   ` Jon Harrop
2011-03-25 20:27             ` Philippe Strauss
2011-04-19 22:47           ` Jon Harrop
     [not found]           ` <869445701.579183.1303253283515.JavaMail.root@zmbs4.inria.fr>
2011-04-20  9:25             ` Fabrice Le Fessant
2011-03-25 18:45   ` Andrei Formiga
2011-03-30 17:00     ` Jon Harrop
2011-04-13  3:36   ` Lucas Dixon
2011-04-13 13:01     ` Gerd Stolpmann
2011-04-13 13:09       ` Lucas Dixon
2011-04-13 23:04       ` Goswin von Brederlow
2011-04-16 13:54     ` Jon Harrop
2011-03-24 13:44 Alexy Khrabrov
2011-03-24 14:57 ` Gerd Stolpmann
2011-03-24 15:03   ` Joel Reymont
2011-03-24 15:28     ` Guillaume Yziquel
2011-03-24 15:48       ` Gerd Stolpmann
2011-03-24 15:38     ` Gerd Stolpmann
2011-03-25 19:49   ` Richard W.M. Jones

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4DB13D7B.50900@lexifi.com \
    --to=alain.frisch@lexifi.com \
    --cc=Christophe.Troestler@umons.ac.be \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).