In[]:=
Needs["SubKernels`LocalKernels`"];Needs["SubKernels`RemoteKernels`"];Block[{$mathkernel=$mathkernel<>" -threadpriority=2"},LaunchKernels[]]
first
.
first
.
second
.
Out[]=
{KernelObject[1,local],KernelObject[2,local],KernelObject[3,local],KernelObject[4,local],KernelObject[5,local],KernelObject[6,local],KernelObject[7,local],KernelObject[8,local],KernelObject[9,first],KernelObject[10,first],KernelObject[12,first],KernelObject[13,first],KernelObject[14,first],KernelObject[16,first],KernelObject[17,first],KernelObject[18,first],KernelObject[19,first],KernelObject[20,first],KernelObject[21,first],KernelObject[22,first],KernelObject[23,first],KernelObject[24,first],KernelObject[25,second],KernelObject[26,second],KernelObject[28,second],KernelObject[29,second],KernelObject[30,second],KernelObject[31,second],KernelObject[32,second],KernelObject[33,second],KernelObject[35,second],KernelObject[36,second],KernelObject[37,second],KernelObject[38,second],KernelObject[39,second],KernelObject[40,second],KernelObject[41,192.168.1.242],KernelObject[42,192.168.1.242],KernelObject[43,192.168.1.242],KernelObject[44,192.168.1.242],KernelObject[45,192.168.1.242],KernelObject[46,192.168.1.242],KernelObject[47,192.168.1.242],KernelObject[48,192.168.1.242]}
In[]:=
Print["Start time is ",ds=DateString[],"."];prec=300000;(**Numberofrequireddecimals.*.*)ClearSystemCache[];T0=SessionTime[];expM[pre_]:=Module[{a,d,s,k,bb,c,end,iprec,xvals,x,pc,cores=16(*=4*numberofphysicalcores*),tsize=2^7,chunksize,start=1,ll,ctab,pr=Floor[1.005pre]},chunksize=cores*tsize;n=Floor[1.32pr];end=Ceiling[n/chunksize];Print["Iterations required: ",n];Print["Will give ",end," time estimates, each more accurate than the previous."];Print["Will stop at ",end*chunksize," iterations to ensure precsion of around ",pr," decimal places."];d=ChebyshevT[n,3];{b,c,s}={SetPrecision[-1,1.1*n],-d,0};iprec=Ceiling[pr/6912];Do[xvals=Flatten[Parallelize[Table[Table[ll=start+j*tsize+l;x=N[E^(Log[ll]/(ll)),iprec];pc=iprec;While[pc<pr/1024,pc=Min[3pc,pr/1024];x=SetPrecision[x,pc];y=x^ll-ll;x=x(1-2y/((ll+1)y+2llll));];(**N[Exp[Log[ll]/ll],pr/1024]**)x=SetPrecision[x,pr/256];xll=x^ll;z=(ll-xll)/xll;t=2ll-1;t2=t^2;x=x*(1+SetPrecision[4.5,pr/256](ll-1)/t2+(ll+1)z/(2llt)-SetPrecision[13.5,pr/256]ll(ll-1)1/(3llt2+t^3z));(*N[Exp[Log[ll]/ll],pr/256]*)x=SetPrecision[x,pr/64];xll=x^ll;z=(ll-xll)/xll;t=2ll-1;t2=t^2;x=x*(1+SetPrecision[4.5,pr/64](ll-1)/t2+(ll+1)z/(2llt)-SetPrecision[13.5,pr/64]ll(ll-1)1/(3llt2+t^3z));(**N[Exp[Log[ll]/ll],pr/64]**)x=SetPrecision[x,pr/16];xll=x^ll;z=(ll-xll)/xll;t=2ll-1;t2=t^2;x=x*(1+SetPrecision[4.5,pr/16](ll-1)/t2+(ll+1)z/(2llt)-SetPrecision[13.5,pr/16]ll(ll-1)1/(3llt2+t^3z));(**N[Exp[Log[ll]/ll],pr/16]**)x=SetPrecision[x,pr/4];xll=x^ll;z=(ll-xll)/xll;t=2ll-1;t2=t^2;x=x*(1+SetPrecision[4.5,pr/4](ll-1)/t2+(ll+1)z/(2llt)-SetPrecision[13.5,pr/4]ll(ll-1)1/(3llt2+t^3z));(**N[Exp[Log[ll]/ll],pr/4]**)x=SetPrecision[x,pr];xll=x^ll;z=(ll-xll)/xll;t=2ll-1;t2=t^2;x=x*(1+SetPrecision[4.5,pr](ll-1)/t2+(ll+1)z/(2llt)-SetPrecision[13.5,pr]ll(ll-1)1/(3llt2+t^3z));(*N[Exp[Log[ll]/ll],pr]*)x,{l,0,tsize-1}],{j,0,cores-1}]]];ctab=ParallelTable[Table[c=b-c;ll=start+l-2;b*=2(ll+n)(ll-n)/((ll+1)(2ll+1));c,{l,chunksize}],Method"Automatic"];s+=ctab.(xvals-1);start+=chunksize;st=SessionTime[]-T0;kc=k*chunksize;ti=(st)/(kc+10^-4)*(n)/(3600)/(24);Print[kc," iterations done in ",N[st,4]," seconds."," Should take ",N[ti,4]," days or ",N[ti*24*3600,4],"s, finish ",DatePlus[ds,ti],"."],{k,0,end-1}];N[-s/d,pr]];t2=Timing[MRBtest2=expM[prec];];Print["Finished on ",DateString[],". Proccessor time was ",t2[[1]]," s."];Print["Actual time was ",st];(*Print[*)MRBtest2(*]*)(*Remove(**)orenterMRBtest2toprintoutput*);Print["Enter MRBtest2 to print ",Floor[Precision[MRBtest2]]," digits"];Print["If you saved m3M, the difference between this and 3,014,991 known digits is ",N[MRBtest2-m3M,10]]
Start time is Fri 26 Apr 2024 08:20:53.
Iterations required: 397978
Will give 195 time estimates, each more accurate than the previous.
Will stop at 399360 iterations to ensure precsion of around 301499 decimal places.
0 iterations done in 30.94 seconds. Should take 1.425× days or 1.231×s, finish Tue 28 Sep 5926 05:06:19.
6
10
11
10
2048 iterations done in 62.60 seconds. Should take 0.1408 days or 1.216×s, finish Fri 26 Apr 2024 11:43:37.
4
10
4096 iterations done in 94.77 seconds. Should take 0.1066 days or 9208.s, finish Fri 26 Apr 2024 10:54:20.
6144 iterations done in 127.2 seconds. Should take 0.09537 days or 8240.s, finish Fri 26 Apr 2024 10:38:13.
8192 iterations done in 159.5 seconds. Should take 0.08971 days or 7751.s, finish Fri 26 Apr 2024 10:30:03.
10240 iterations done in 192.2 seconds. Should take 0.08644 days or 7469.s, finish Fri 26 Apr 2024 10:25:21.
12288 iterations done in 225.1 seconds. Should take 0.08436 days or 7289.s, finish Fri 26 Apr 2024 10:22:21.
14336 iterations done in 257.7 seconds. Should take 0.08280 days or 7154.s, finish Fri 26 Apr 2024 10:20:06.
16384 iterations done in 290.2 seconds. Should take 0.08158 days or 7048.s, finish Fri 26 Apr 2024 10:18:21.
18432 iterations done in 322.8 seconds. Should take 0.08068 days or 6971.s, finish Fri 26 Apr 2024 10:17:03.
20480 iterations done in 355.4 seconds. Should take 0.07993 days or 6906.s, finish Fri 26 Apr 2024 10:15:58.
22528 iterations done in 388.2 seconds. Should take 0.07938 days or 6859.s, finish Fri 26 Apr 2024 10:15:11.
24576 iterations done in 420.8 seconds. Should take 0.07887 days or 6815.s, finish Fri 26 Apr 2024 10:14:27.
26624 iterations done in 453.6 seconds. Should take 0.07848 days or 6781.s, finish Fri 26 Apr 2024 10:13:53.
28672 iterations done in 486.3 seconds. Should take 0.07813 days or 6751.s, finish Fri 26 Apr 2024 10:13:23.
30720 iterations done in 519.0 seconds. Should take 0.07782 days or 6724.s, finish Fri 26 Apr 2024 10:12:57.
32768 iterations done in 551.4 seconds. Should take 0.07752 days or 6698.s, finish Fri 26 Apr 2024 10:12:30.
34816 iterations done in 584.3 seconds. Should take 0.07731 days or 6679.s, finish Fri 26 Apr 2024 10:12:12.
36864 iterations done in 617.6 seconds. Should take 0.07718 days or 6668.s, finish Fri 26 Apr 2024 10:12:01.
38912 iterations done in 650.6 seconds. Should take 0.07702 days or 6654.s, finish Fri 26 Apr 2024 10:11:47.
40960 iterations done in 683.4 seconds. Should take 0.07685 days or 6640.s, finish Fri 26 Apr 2024 10:11:32.
43008 iterations done in 716.7 seconds. Should take 0.07676 days or 6632.s, finish Fri 26 Apr 2024 10:11:25.
45056 iterations done in 749.8 seconds. Should take 0.07666 days or 6623.s, finish Fri 26 Apr 2024 10:11:16.
47104 iterations done in 783.1 seconds. Should take 0.07658 days or 6616.s, finish Fri 26 Apr 2024 10:11:09.
49152 iterations done in 816.0 seconds. Should take 0.07647 days or 6607.s, finish Fri 26 Apr 2024 10:11:00.
51200 iterations done in 849.3 seconds. Should take 0.07641 days or 6602.s, finish Fri 26 Apr 2024 10:10:54.
53248 iterations done in 882.7 seconds. Should take 0.07636 days or 6597.s, finish Fri 26 Apr 2024 10:10:50.