sailman
07-17-2006, 04:02 PM
Dear All,
I am writing a program that uses numerical recipes to run a large number of integrations. Roughly I believe I am running bsstep 3e6 times, and bcuint/bcucof 3e8 times as well as a complicated derivs function 3e8 times. I may be off by an order of magnitude or two. After approximately 4 hours of computation the computers crash. I have found that my computer crashes at the same point in the integration (processing times vary based on the speed of the machine). The crash point is independent of the machine it is on (NT or XP, Pentium or Celeron, 256 MB or 1GB RAM). They are all 32-bit machines. I have not moved to linux yet.
After testing many different things I have discovered that simply allocating a Vec_DP within a Do-while loop will cause the program to crash after 4.294 billion iterations. This hardly seems coincidence, especially on a 32-bit machine. The crash point is also independent of the size of the vector (I tried it for both a vector size 1 and size 25). The loop is as follows:
cin >> test_num;
counter = 0;
counter2 = 0;
do{
counter++;
Vec_DP simple_vec(test_num);
simple_vec[0] = 0.0;
if(counter % 1000000 == 0)
{
counter = 0;
counter2++;
cout << counter2 << " ";
flush(cout);
}
}while(true);
I have found that by adding static in front of the declaration of the vector the program will run indefinitely. However my actual integration program is riddled with many instances of Vec_DP and often in function arguments. So, I cannot fix all of the situations where a Vec_DP is declared by adding static. I have considered declaring everything as global but this seems a bit extreme and quite involved. Is there anything else I can do? Is there something I am misunderstanding about my problem?
Thanks in advance.
I am writing a program that uses numerical recipes to run a large number of integrations. Roughly I believe I am running bsstep 3e6 times, and bcuint/bcucof 3e8 times as well as a complicated derivs function 3e8 times. I may be off by an order of magnitude or two. After approximately 4 hours of computation the computers crash. I have found that my computer crashes at the same point in the integration (processing times vary based on the speed of the machine). The crash point is independent of the machine it is on (NT or XP, Pentium or Celeron, 256 MB or 1GB RAM). They are all 32-bit machines. I have not moved to linux yet.
After testing many different things I have discovered that simply allocating a Vec_DP within a Do-while loop will cause the program to crash after 4.294 billion iterations. This hardly seems coincidence, especially on a 32-bit machine. The crash point is also independent of the size of the vector (I tried it for both a vector size 1 and size 25). The loop is as follows:
cin >> test_num;
counter = 0;
counter2 = 0;
do{
counter++;
Vec_DP simple_vec(test_num);
simple_vec[0] = 0.0;
if(counter % 1000000 == 0)
{
counter = 0;
counter2++;
cout << counter2 << " ";
flush(cout);
}
}while(true);
I have found that by adding static in front of the declaration of the vector the program will run indefinitely. However my actual integration program is riddled with many instances of Vec_DP and often in function arguments. So, I cannot fix all of the situations where a Vec_DP is declared by adding static. I have considered declaring everything as global but this seems a bit extreme and quite involved. Is there anything else I can do? Is there something I am misunderstanding about my problem?
Thanks in advance.