Student Support Forum: 'Stopping after 10 hours' topicStudent Support Forum > General > Archives > "Stopping after 10 hours"

 Next Comment > Help | Reply To Topic
 Author Comment/Response Nandor 03/09/05 07:51am Greetings. I am running some major CPU-intensive code, and after about 10 hours, Mathematica resets. What I mean by this is that the program stops the calculation it is running and resets all of the variables. If I have a running counter called "counter," then not only do I wake up in the morning with the program not running, but "counter" does not even have a value. When I evaluate counter I get the output "counter" and that is all. I am running on both a Macintosh and a PC, with the same result, so the problem is not platform-dependent. The program is searching for sums of inverses of squares that add to unitary fractions, and it could take months to run. I have output coming out every few minutes, which helps me to narrow down the time of running to about 10 hours. When I start with different seed values, I get the same result - ten hours of running. This is reproducible on multiple platforms. Below, in case you need it or want it, is the code I am running. It is pretty straightforward. Thank you for your attention and time. If anyone can lend insight to the problem, I'd be grateful. Nandor reftable = Table[n, {n, 1, 100}]; setstilltogo = {1/17(*, 1/19, 1/20, 1/21, 1/23, 1/26, 1/29, 1/ 31, 1/33, 1/35, 1/37, 1/38, 1/39, 1/41, 1/ 43, 1/44, 1/46, 1/47, 1/51, 1/52, 1/57, 1/58, 1/62, 1/65, 1/66, 1/ 68, 1/69, 1/70, 1/74, 1/76, 1/77, 1/78, 1/82, 1/84, 1/85, 1/ 86, 1/87, 1/88, 1/91, 1/92, 1/93, 1/94, 1/95, 1/99*)}; smallest = Min[setstilltogo] largest = Max[setstilltogo] i = 15; While[i++ < 25, reftable = Cases[reftable, x_?(MemberQ[Divisors[#], Prime[i]] == False &)]]; reftable = Sort[Flatten[Append[reftable, {}]]]; addingtable = Table[1/reftable[[n]]^2, {n, 1, Length[reftable]}]; listssize = Length[reftable]; maxtrials = 2^listssize; coeff = Table[0, {n, 1, listssize}]; coeff[[5]] = 1; coeff[[8]] = 1; coeff[[24]] = 1; coeff[[62]] = 1; coeff[[66]] = 1; coeff[[67]] = 1; coeff[[73]] = 1; coeff[[76]] = 1; counter = 439360000\[InvisibleSpace]; consecs = 0; While[counter++ < maxtrials, {currentsum = Sum[coeff[[n]]*addingtable[[n]], {n, 1, listssize}], If[MemberQ[setstilltogo, currentsum] == True, {lastcount = counter, counter = maxtrials}], oneslist = Position[Table[coeff[[n]], {n, 1, listssize}], 1], lastone = oneslist[[Length[oneslist], 1]], If[(currentsum < largest) && (lastone < listssize), {coeff[[lastone + 1]] = 1, consecs++}, If[(currentsum > smallest) && (lastone < listssize), {coeff[[lastone + 1]] = 1, coeff[[lastone]] = 0, consecs = 0}]], If[(lastone == listssize) && (MemberQ[setstilltogo, currentsum] == False), {coeff[[Table[ii, {ii, lastone - consecs, lastone}]]] = 0, consecs = 0, oneslist = Position[Table[coeff[[n]], {n, 1, listssize}], 1], lastone = oneslist[[Length[oneslist], 1]], coeff[[lastone]] = 0, coeff[[lastone + 1]] = 1, If[Mod[counter, 10000] == 0, Print[counter, " ", Part[reftable, Flatten[oneslist]], " ", ToDate[AbsoluteTime[]]]]}]}]; Print["count=", lastcount]; Print[currentsum]; Part[reftable, Flatten[oneslist]] URL: ,

 Subject (listing for 'Stopping after 10 hours') Author Date Posted Stopping after 10 hours Nandor 03/09/05 07:51am Re: Stopping after 10 hours yehuda ben-s... 03/17/05 03:54am Re: Stopping after 10 hours Nandor 03/22/05 9:48pm Re: Stopping after 10 hours yehuda ben-s... 03/23/05 2:19pm Re: Stopping after 10 hours Nandor 03/24/05 4:37pm Re: Stopping after 10 hours yehuda ben-s... 03/26/05 3:23pm Re: Stopping after 10 hours Andrew DuBui... 03/28/05 12:20pm Re: Stopping after 10 hours Nandor 03/31/05 2:00pm Re: Stopping after 10 hours Andrew DuBui... 03/31/05 3:35pm Re: Stopping after 10 hours Nandor 04/05/05 1:26pm
 Next Comment > Help | Reply To Topic