Home > freetb4matlab > general > parcellfun.m

parcellfun

PURPOSE ^

% Evaluates a function for multiple argument sets using multiple processes.

SYNOPSIS ^

function varargout = parcellfun (nproc, fun, varargin)

DESCRIPTION ^

% -*- texinfo -*-
% @deftypefn{Function File} [@var{o1}, @var{o2}, @dots{}] = parcellfun (@var{nproc}, @var{fun}, @var{a1}, @var{a2}, @dots{})
% @deftypefnx{Function File} parcellfun (nproc, fun, @dots{}, 'UniformOutput', @var{val})
% @deftypefnx{Function File} parcellfun (nproc, fun, @dots{}, 'ErrorHandler', @var{errfunc})
% Evaluates a function for multiple argument sets using multiple processes.
% @var{nproc} should specify the number of processes. A maximum recommended value is
% equal to number of CPUs on your machine or one less. 
% @var{fun} is a function handle pointing to the requested evaluating function.
% @var{a1}, @var{a2} etc. should be cell arrays of equal size.
% @var{o1}, @var{o2} etc. will be set to corresponding output arguments.
%
% The UniformOutput and ErrorHandler options are supported with meaning identical
% to @dfn{cellfun}.
%
% NOTE: this function is implemented using 'fork' and a number of pipes for IPC.
% Suitable for systems with an efficient 'fork' implementation (such as GNU/Linux), 
% on other systems (Windows) it should be used with caution.
% Also, if you use a multithreaded BLAS, it may be wise to turn off multi-threading
% when using this function.
%
% CAUTION: This function should be regarded as experimental. Although all subprocesses
% should be cleared in theory, there is always a danger of a subprocess hanging up,
% especially if unhandled errors occur. Under GNU and compatible systems, the following
% shell command may be used to display orphaned Octave processes:
% ps --ppid 1 | grep octave
% 
% @end deftypefn

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:
Generated on Fri 22-May-2009 15:13:00 by m2html © 2003