results from Array and ParallelArray differ
- To: mathgroup at smc.vnet.net
- Subject: [mg117011] results from Array and ParallelArray differ
- From: Peter Pein <petsie at dordos.net>
- Date: Mon, 7 Mar 2011 05:49:46 -0500 (EST)
Dear group,
I did a search using tags "ParallelArray" and "Join" and did not find
any posting in this group; apologies, if this has already been asked.
The documentation tells:
"ParallelArray will give the same results as Array, except for side
effects during the computation."
I use an anonymous function and no variables; DistributeDefinitions,
SetSharedVariable etc. can not be the cause for the trouble in the
following toy example:
In[1]:= arrsum = Array[1/Plus[##]&, {3, 3}, {1, 0}, Plus]
Out[1]= 37/10
:-)
In[2]:= parrsum = ParallelArray[1/Plus[##]&, {3, 3}, {1, 0}, Plus]
Out[2]= Join[35/12, 47/60]
:-(
In[3]:= parrsum /. Join->Plus
Out[3]= 37/10
Is this a bug, a feature or my thick-wittedness? What can be done?
Well, I could use Total[ParallelTable[...],2] but I don't want to.
Thanks in advance,
Peter
P.S.: I came across this problem while coding
http://dl.dropbox.com/u/3030567/Mathematica/springer.nb