In[]:=
jobmwithcheck10kcores=RemoteBatchSubmit["WolframBatch",Module[{ds,pr,T0,RootPade6,expM,MRB,t2,b,c,s,n,st,kc,ti},LaunchKernels[];Print["Start time is ",ds=Now,"."];pr=10000;ClearSystemCache[];T0=SessionTime[];Clear[RootPade6];RootPade6[n_Integer,prec_Integer]:=Module[{x,pc,z,t,N0=n,A1,A2,A3,B1,B2},x=N[N0^(1/N0),10];pc=Precision[x];While[pc<prec,pc=Min[6pc,prec];x=SetPrecision[x,pc];A1=SetPrecision[3(2N0+1)/(5N0),pc];A2=SetPrecision[3(N0+1)(2N0+1)/(20N0^2),pc];A3=SetPrecision[(N0+1)(2N0+1)/(60N0^3),pc];B1=SetPrecision[2(3N0-1)/(5N0),pc];B2=SetPrecision[(2N0-1)(3N0-1)/(20N0^2),pc];t=x^N0;z=SetPrecision[(N0-t)/t,pc];x=x*(1+A1z+A2z^2+A3z^3)/(1+B1z+B2z^2);];N[x,prec]];expM[pre_Integer]:=Module[{d,k,bb,end,xvals,x,cores=32,tsize=2^7,chunksize,start=1,ll,ctab,pr2=Floor[1.005pre]},chunksize=cores*tsize;n=Floor[1.32pr2];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 precision of around ",pr2," decimal places."];d=ChebyshevT[n,3];{b,c,s}={SetPrecision[-1,Ceiling[1.1*n]],-d,0};Do[xvals=Flatten@ParallelTable[Table[ll=start+j*tsize+l;x=RootPade6[ll,pr2];x,{l,0,tsize-1}],{j,0,cores-1},Method->"EvaluationsPerKernel"->32];ctab=ParallelTable[Table[c=b-c;ll=start+l-2;b*=2(ll+n)(ll-n)/((ll+1)(2ll+1));c,{l,chunksize}],Method->"EvaluationsPerKernel"->16];s+=ctab.(xvals-1);start+=chunksize;st=SessionTime[]-T0;kc=k*chunksize;ti=st/(kc+10^-4)*n/(3600*24);If[kc>1,Print[kc," iterations done in ",N[st,4]," seconds. ","Should take ",N[ti,4]," days, finish ",DatePlus[ds,Quantity[ti,"Days"]],"."]],{k,0,end-1}];N[-s/d,pr2]];t2=AbsoluteTiming[MRB=expM[pr];];Print["Finished on ",DateString[],". Absolute time was ",t2[[1]]," s."];<|"MRB"->MRB,"Precision"->Precision[MRB],"AbsoluteTimeSeconds"->t2[[1]]|>],RemoteProviderSettings-><|"RemoteMachineClass"->"Memory192x1536"|>];
In[]:=
jobmwithcheck10kcores["JobStatus"]
Out[]=
Queued
In[]:=
jobmwithcheck10kcores["JobStatus"]
Out[]=
Running
In[]:=
jobmwithcheck10kcores["JobStatus"]
Out[]=
Succeeded
In[]:=
jobmwithcheck10kcores["EvaluationResult"][[2;;3]]
Out[]=
Precision10044.3,AbsoluteTimeSeconds4.42382
In[]:=
MRB-jobmwithcheck10kcores["EvaluationResult"][[1]]
Out[]=
0.×
-10046
10
In[]:=
jobmwithcheck10kcores=RemoteBatchSubmit["WolframBatch",Module[{ds,pr,T0,RootPade6,expM,MRB,t2,b,c,s,n,st,kc,ti},LaunchKernels[];Print["Start time is ",ds=Now,"."];pr=20000;ClearSystemCache[];T0=SessionTime[];Clear[RootPade6];RootPade6[n_Integer,prec_Integer]:=Module[{x,pc,z,t,N0=n,A1,A2,A3,B1,B2},x=N[N0^(1/N0),10];pc=Precision[x];While[pc<prec,pc=Min[6pc,prec];x=SetPrecision[x,pc];A1=SetPrecision[3(2N0+1)/(5N0),pc];A2=SetPrecision[3(N0+1)(2N0+1)/(20N0^2),pc];A3=SetPrecision[(N0+1)(2N0+1)/(60N0^3),pc];B1=SetPrecision[2(3N0-1)/(5N0),pc];B2=SetPrecision[(2N0-1)(3N0-1)/(20N0^2),pc];t=x^N0;z=SetPrecision[(N0-t)/t,pc];x=x*(1+A1z+A2z^2+A3z^3)/(1+B1z+B2z^2);];N[x,prec]];expM[pre_Integer]:=Module[{d,k,bb,end,xvals,x,cores=32,tsize=2^7,chunksize,start=1,ll,ctab,pr2=Floor[1.005pre]},chunksize=cores*tsize;n=Floor[1.32pr2];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 precision of around ",pr2," decimal places."];d=ChebyshevT[n,3];{b,c,s}={SetPrecision[-1,Ceiling[1.1*n]],-d,0};Do[xvals=Flatten@ParallelTable[Table[ll=start+j*tsize+l;x=RootPade6[ll,pr2];x,{l,0,tsize-1}],{j,0,cores-1},Method->"EvaluationsPerKernel"->32];ctab=ParallelTable[Table[c=b-c;ll=start+l-2;b*=2(ll+n)(ll-n)/((ll+1)(2ll+1));c,{l,chunksize}],Method->"EvaluationsPerKernel"->16];s+=ctab.(xvals-1);start+=chunksize;st=SessionTime[]-T0;kc=k*chunksize;ti=st/(kc+10^-4)*n/(3600*24);If[kc>1,Print[kc," iterations done in ",N[st,4]," seconds. ","Should take ",N[ti,4]," days, finish ",DatePlus[ds,Quantity[ti,"Days"]],"."]],{k,0,end-1}];N[-s/d,pr2]];t2=AbsoluteTiming[MRB=expM[pr];];Print["Finished on ",DateString[],". Absolute time was ",t2[[1]]," s."];<|"MRB"->MRB,"Precision"->Precision[MRB],"AbsoluteTimeSeconds"->t2[[1]]|>],RemoteProviderSettings-><|"RemoteMachineClass"->"Memory192x1536"|>];
In[]:=
jobmwithcheck10kcores["JobStatus"]
Out[]=
Queued
In[]:=
jobmwithcheck10kcores["JobStatus"]
Out[]=
Running
In[]:=
jobmwithcheck10kcores["JobStatus"]
Elapsed Time: 4 hours 37 minutes 13 second in seconds