MathGroup Archive 2007

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: request for a few minutes CPU-time

  • To: mathgroup at smc.vnet.net
  • Subject: [mg79509] Re: request for a few minutes CPU-time
  • From: Michael Croucher <michael.p.croucher at googlemail.com>
  • Date: Sat, 28 Jul 2007 05:31:31 -0400 (EDT)

>  If you've got RAM (4GB or so) than I do (1.5 GB),
> could you please run this code  with, say nmax=10 or 20 million? On my
> machine it swapped heavily with nmax=6 million and I had to kill
> MathKernel as I tried nmax=10^7. The lines above took ~181 seconds to
> evaluate (nmax=10^7 has been stopped by me after 15 minutes). I do not
> expect any runtimes of more than ~7-10 minutes. Would this be possible,
> please?
> 

Hi Peter

It turns out that I was about to test Mathematica on a cluster that has a reasonable amount of memory so you are in luck.  I have not gone through your code to see if there is a better way (since part of my test requirement is to use a lot of ram so this is perfect)  - I simply copied and pasted and put an nmax of 5*10^7

Block[{spa, nmax = 5*10^7, expo = 3},
 Reap[For[n = 1, n <= nmax,
    n++, (If[Head[#1] === spa, #1 = n, Sow[{n, #1}]] &)[
     spa[DivisorSigma[expo, n]]]]][[2, 1]]]

The result was

Out[1]= {{194315, 184926}, {295301, 291741}, {590602, 583482}, 
>    {1181204, 1166964}, {1476505, 1458705}, {1886920, 1880574}, 
>    {2067107, 2042187}, {2362408, 2333928}, {2526095, 2404038}, 
>    {2953010, 2917410}, {3248311, 3209151}, {3691985, 3513594}, 
>    {3838913, 3792633}, {4134214, 4084374}, {4469245, 4253298}, 
>    {4724816, 4667856}, {5020117, 4959597}, {5610719, 5543079}, 
>    {5635135, 5362854}, {5906020, 5834820}, {6023765, 5732706}, 
>    {6496622, 6418302}, {6791923, 6710043}, {7382525, 7293525}, 
>    {7677826, 7585266}, {7966915, 7581966}, {8268428, 8168748}, 
>    {8355545, 7951818}, {8563729, 8460489}, {9132805, 8691522}, 
>    {9449632, 9335712}, {10040234, 9919194}, {10298695, 9801078}, 
>    {10335535, 10210935}, {10926137, 10794417}, {11221438, 11086158}, 
>    {11464585, 10910634}, {11812040, 11669640}, {11853215, 11280486}, 
>    {12107341, 11961381}, {12697943, 12544863}, {12993244, 12836604}, 
>    {13019105, 12390042}, {13583846, 13420086}, {13796365, 13129746}, 
>    {14184995, 13499598}, {14469749, 14295309}, {14765050, 14587050}, 
>    {15350885, 14609154}, {15355652, 15170532}, {15650953, 15462273}, 
>    {16128145, 15348858}, {16241555, 16045755}, {16536856, 16337496}, 
>    {17127458, 16920978}, {17294035, 16458414}, {17422759, 17212719}, 
>    {18848555, 17937822}, {18899264, 18671424}, {19194565, 18963165}, 
>    {19625815, 18677526}, {19785167, 19546647}, {20014445, 19047378}, 
>    {20080468, 19838388}, {20671070, 20421870}, {20756120, 20686314}, 
>    {20791705, 19787082}, {20966371, 20713611}, {21180335, 20156934}, 
>    {21556973, 21297093}, {21852274, 21588834}, {21957595, 20896638}, 
>    {22442876, 22172316}, {22738177, 22464057}, {23328779, 23047539}, 
>    {23624080, 23339280}, {24214682, 23922762}, {24509983, 24214503}, 
>    {24529960, 24447462}, {24678005, 23485602}, {25100585, 24797985}, 
>    {25395886, 25089726}, {25455265, 24225306}, {25986488, 25673208}, 
>    {26281789, 25964949}, {26621155, 25334862}, {26872391, 26548431}, 
>    {27009785, 25704714}, {27167692, 26840172}, {28053595, 27715395}, 
>    {28644197, 28298877}, {28939498, 28590618}, {28952935, 27553974}, 
>    {29341565, 27923826}, {29530100, 29174100}, {29825401, 29465841}, 
>    {30507455, 29033382}, {30711304, 30341064}, {31301906, 30924546}, 
>    {31597207, 31216287}, {31673345, 30142938}, {32187809, 31799769}, 
>    {32450605, 30882642}, {32483110, 32091510}, {32839235, 31252494}, 
>    {33073712, 32674992}, {33369013, 32966733}, {33616495, 31992198}, 
>    {33959615, 33550215}, {34254916, 33841956}, {34782385, 33101754}, 
>    {34845518, 34425438}, {35140819, 34717179}, {35171015, 33471606}, 
>    {35731421, 35300661}, {35851480, 35730906}, {36912625, 36467625}, 
>    {37114165, 35320866}, {37502795, 35690718}, {37503227, 37051107}, 
>    {37798528, 37342848}, {38280055, 36430422}, {38389130, 37926330}, 
>    {38668685, 36800274}, {38684431, 38218071}, {39275033, 38801553}, 
>    {39570334, 39093294}, {40160936, 39676776}, {40456237, 39968517}, 
>    {41000465, 39019386}, {41046839, 40551999}, {41342140, 40843740}, 
>    {41932742, 41427222}, {42228043, 41718963}, {42818645, 42302445}, 
>    {43113946, 42594186}, {43332245, 41238498}, {43704548, 43177668}, 
>    {43999849, 43469409}, {44109505, 41978202}, {44498135, 42348054}, 
>    {44590451, 44052891}, {44885752, 44344632}, {45275395, 43087758}, 
>    {45476354, 44928114}, {46362257, 45803337}, {46441285, 44197314}, 
>    {46657558, 46095078}, {46829915, 44567166}, {47248160, 46678560}, 
>    {47543461, 46970301}, {47995805, 45676722}, {48134063, 47553783}, 
>    {48429364, 47845524}, {48773065, 46416426}, {49019966, 48429006}, 
>    {49315267, 48720747}, {49905869, 49304229}, {49938955, 47525982}}

Hope this helps.  Out of interest - what do you want these for?
Best Regards,
Mike


  • Prev by Date: Fwd: combined front end and html conversion problems
  • Next by Date: Re: Workbench 1.1 start up bomb
  • Previous by thread: Re: Storing matrices
  • Next by thread: grid lines cutting into tick labels on y-axes