There exist multiple functions, take them for instance, 3 functions as follows:
f1=3*D[h1[x],x]*Exp[1*x];
f2=3*D[h2[x],x]*Exp[2*x];
f3=3*D[h3[x],x]*Exp[3*x];
(*h1,h2,h3 are large symbolic matrices with respect to x*)
Do[fPlot=Plot[{f1[[i]],f2[[i]],f3[[i]]},{x, 0, 5}]; Print[fPlot],{i, Length[f1]}]
f1,f2 and f3 are independent, every function fx is time-consuming needless to say run their three one by one, so how to run the 3 functions at the same time by taking advantage of my multi-core CPU windows. I know the build-in function Parallelize and its family function ParallelTable, ParallelDo and so on, but I don't know how to solve the the problem mentioned above.
Thank you in advance.
Parallel calculation has been achieved, but the result surprised me:
In[1]:= Plus@Table[3^x, {x, 10^5}]; // AbsoluteTiming
Plus@Table[5^x, {x, 10^5}]; // AbsoluteTiming
{k1, k2} =
Parallelize[{Plus@Table[3^x, {x, 10^5}],
Plus@Table[5^x, {x, 10^5}]}]; // AbsoluteTiming
{f1, f2} =
ParallelTable[
ReleaseHold[expr], {expr,
Thread[Hold[{Plus@Table[3^x, {x, 10^5}],
Plus@Table[5^x, {x, 10^5}]}]]}]; // AbsoluteTiming
Out[1]= {7.8803, Null}
Out[2]= {13.0114, Null}
Out[3]= {278.987, Null}
Out[4]= {278.304, Null}
7.8803 + 13.0114 << 278 (time parallel calculation consumed)
how does the result generate?