I’m new to Mathematica and I am trying to work with it. My knowledge in parallel computing is very limited. I tried to figure out how to proceed using the mathematica help and have found somethings from online help pages. The program looks as shown below:
Clear[tabfidC,J,B] tabfidC=ParallelTable[{J,B,Quiet[fidnUZST[J,B,0.5,0.1]]},{J,-1,1,0.1},{B,0,+2,0.1}]; Clear[JJ,BB] Clear[listA8] listA8={{0,0,0}} SetSharedVariable[listA8] Parallelize[For[JJ=1,JJ<=Dimensions[tabfidC][[1]],JJ++, For[BB=1,BB<=Dimensions[tabfidC][[2]],BB++,listA8=AppendTo[listA8,{N[(JJ-11)*1/10],N[(BB-1)*1/10],1/(4*\[Pi])*NIntegrate[tabfidC[[JJ,BB,3]]*Sin[\[Theta]],{\[Phi],0,2*\[Pi]},{\[Theta],0,\[Pi]}]}]]]]//Quiet; Show[ListPlot3D[{Drop[listA8,1]},PlotRange->{-.05,1.1},AxesLabel->{Style[J,Medium,Bold,Blue],Style[B,Medium,Bold,Blue],Style[ \!\(\*OverscriptBox[\(F\), \(_\)]\),Medium,Bold,Blue]},LabelStyle->Directive[Blue,Bold],ImageSize->Scaled[.3]]]
A function “fidnUZST” has been defined before. I form a Table from it named “tabfidC”. Then a integral over \theta and \phi is performed on the the components of this Table and they constitute a List named “listA8”. Finally they get plotted.
What I would like to know is to parallelize the construction of listA8, and I use “SetSharedVariable[listA8]”. But this does not make a difference in calculation time!
I would be grateful if you had suggestions. Thanks a lot. Mahmood