From: Dan O'Brien on
Hello everyone,

I am running Windows XP 32bit with Mathematica 7.0.1 on a dual core
machine (2X 3.0GHz Pentium D) with 2 gigs of RAM. I have 4 data sets of
spectroscopic data (intensity vs. frequency data with 1340 data points
each) that I am fitting simultaneously with shared parameters as well as
parameters unique to an individual data set. I can set it up to float
or keep locked any arbitrary number of the parameters, but I usually set
it so not more than 10 (sometimes up to 20) params float at a time.
Computations can take minutes to hours, thus I have been looking into
Mathematica's ability to parallelize computations. I have some
functions set up to define the arguements supplied to
NonlinearModelFit. Here is the basic order of operations:

In[13]:= LaunchKernels[]

Out[13]= {KernelObject[1, "local"], KernelObject[2, "local"]}

In[14]:= DistributeDefinitions["Global`"];

In[15]:= Parallelize[NonlinearModelFit[d, m, p, {index, \[Omega]}]]

Parallelize::nopar1: NonlinearModelFit[d,m,p,{index,\[Omega]}] cannot be
parallelized; proceeding with sequential evaluation. >>

Here "d" "m", and "p" are formatted corrected for the necessary
arguements for NonlinearModelFit (sequential evaluation proceeds without
any errors). From the documentation I believe I have set everything
necessary to parallelize, and NonlinearModelFit should greatly benefit
from parallelization in terms of computational time. Is it just that
this function hasn't been set internally by Mathematica to be able to
thread its computations?

-DanO

From: Bill Rowe on
On 5/5/10 at 6:05 AM, obrie425(a)umn.edu (Dan O'Brien) wrote:

<details snipped>

>Here "d" "m", and "p" are formatted corrected for the necessary
>arguements for NonlinearModelFit (sequential evaluation proceeds
>without any errors). From the documentation I believe I have set
>everything necessary to parallelize, and NonlinearModelFit should
>greatly benefit from parallelization in terms of computational time.
>Is it just that this function hasn't been set internally by
>Mathematica to be able to thread its computations?

My guess is the issue has to do with how parallel processing is
implemented. Problems that can easily be split up into smaller
chunks where you do the same thing to each chunk then assemble
the results from each chunk for the final answer are fairly
simple to run as a parallel process. But the characteristic of
being easily split up doesn't seem to me to be a characteristic
non-linear regression problem.

=46or the general non-linear regression problem, you won't be able
to find an optimum value for one of the parameters in isolation
from the other unknown parameters. Consequently, there is no
obvious way to parallelize this class of problem.

But if you are doing the same non-linear fit to several data
sets, it should be possible to take advantage of parallel
processing using perhaps ParallelTable.