octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Handling "parfor" as "for"


From: John W. Eaton
Subject: Re: Handling "parfor" as "for"
Date: Thu, 29 Sep 2011 02:58:31 -0400

On 28-Sep-2011, Mark Everitt wrote:

| Thanks for those pointers. I'll take a look at the hacking file and clone the
| repository when I get a patch of free time.
| 
| I guessed that thread safety would not be likely. The plan is to spawn
| processes, inspired by parcellfun from octave-forge. This could mean using a
| fair amount of memory and general heaviness. As Matlab suffers 
| like this anyway I don't think that this should be considered much of a
| negative.
| 
| Let's see what happens...

I checked in the following change

  http://hg.savannah.gnu.org/hgweb/octave/rev/027a2186cd90

Now Octave can accept statements of the form

  parfor LHS = EXPR BODY end
  parfor ( LHS = EXPR, MAXPROC ) BODY end

These both compile to tree_simple_for_command objects with the new
field "parallel" set to true, and in the case of the second form, with
a new field maxproc pointing to a tree_expression object.

All that is left is to make tree_evaluator::visit_simple_for_command
in pt-eval.cc handle parallel loops.

jwe


reply via email to

[Prev in Thread] Current Thread [Next in Thread]