GNU Octave pfeval function and ov-pointer.cc class
   Parametric distributed function evaluation

Description

The pfeval function is a parametric function evaluation that can run in parallel. It depends on the ov-pointer.cc class and associated utility functions, and on the external NAP networked associative pipe system. Pfeval is similar to the dfeval function in the Matlab distributed computing toolbox. The pfeval function syntax is similar to feval.

For information on obtaining and installing NAP, see http://rocketcalc.com/nap.html.

Key Features

  • Easy to use
  • Pfeval adds sophisticated parallel/distributed computing functionality to GNU Octave with one simple command. Parallel/distributed computing functionality can be used interactively and within m-file programs.
  • Dynamic
  • Computing resources can be added and removed over the course of computations.
  • Compatible
  • Pfeval is distributed as a set of simple add-on functions and classes to standard GNU Octave 3.0 (no patches required of Octave).
  • Open source
  • The package is distributed under the GNU GPLv3 license.

Download

Remember to obtain and install NAP first (see above link). Download the pfeval source code here: pfeval.tar.gz.

Simple Example

The example illustrates basic use of pfeval. We create two square matrices with random entrices of order 3 and 2, respectively. An Octave drone process does the work and saves its results to a central shared memory location (/dev/shm by default). The controlling Octave process retrieves the results by way of a pointer variable. The results are filled in on the pointer variable as they become available.
Example: Generating matrices (user commands shown in bold).
# Start up nap (if it is not already running)
nap

# Start up an Octave drone using drone.m from the pfeval package:
octave drone.m

# Start a controlling Octave terminal:
octave

octave:1> X=pfeval("rand",3,2)
X =

{
  [1,1] = [empty]
  [2,1] = [empty]
}
# Note: the random matrices have not been computed yet; X shows empty placeholders.

octave:2> X
X =

{
  [1,1] = [File-backed object -- 115 bytes]
  [2,1] = [File-backed object -- 75 bytes]
}
# Note: The drone has finished computing the results.

octave:3> nth(X,1)()
ans =

   0.35238   0.53068   0.87316
   0.80723   0.43843   0.16447
   0.29166   0.97579   0.95014

octave:4> nth(X,2)()
ans =

   0.98396   0.74670
   0.41260   0.54271


# Terminate the drone and exit Octave:

octave:5> pfeval("exit",1);
octave:6> exit