summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
f012817)
Dear Git,
It has been a while since I sent you a personal message.
I hope this hasn't offended you.
A Deer,
Sam
// The main computation loop
while (true)
{
// The main computation loop
while (true)
{
-
- if (runstate != RUN) pthread_exit(NULL); //Check whether the thread needs to exit
-
-
-
//Check whether the program should quit due to steps being computed, or a timeout
if (ExitCondition())
{
QuitProgram(false);
//Check whether the program should quit due to steps being computed, or a timeout
if (ExitCondition())
{
QuitProgram(false);
- continue; // The check at the start of the next loop will stop the thread
}
if (options.draw_graphics == false && options.verbosity != 0
}
if (options.draw_graphics == false && options.verbosity != 0
+ //printf("Left compute loop\n");
}
#pragma omp section
{
if (options.draw_graphics)
Graphics_Run(argc, argv);
}
#pragma omp section
{
if (options.draw_graphics)
Graphics_Run(argc, argv);
- printf("Got to bit after Graphics_Run()\n");
+ //printf("Got to bit after Graphics_Run()\n");
//Check whether the program should quit due to steps being computed, or a timeout
if (ExitCondition())
{
//Check whether the program should quit due to steps being computed, or a timeout
if (ExitCondition())
{
+ //printf("Leave graphics loop\n");
+ glutLeaveMainLoop();
#ifdef SINGLE_THREADED
if (options.verbosity != 0 && universe.steps % options.verbosity == 1)
DisplayStatistics();
System_Compute(&universe);
#endif
#ifdef SINGLE_THREADED
if (options.verbosity != 0 && universe.steps % options.verbosity == 1)
DisplayStatistics();
System_Compute(&universe);
#endif
-
-
- //Check whether the runstate has been set to quit the program
- switch (runstate)
- {
- case RUN:
- break;
- case QUIT:
- glutLeaveMainLoop();
- return;
- break;
- case QUIT_ERROR:
- glutLeaveMainLoop();
- return;
- break;
- }
-
if (options.draw_graphics == false)
return;
if (options.draw_graphics == false)
return;
{
if (theKey == 'x' || theKey == 'X')
{
{
if (theKey == 'x' || theKey == 'X')
{
*/
bool ExitCondition(void)
{
*/
bool ExitCondition(void)
{
- return ((options.timeout > 0.00 && ((unsigned)(time(NULL) - options.start_time.tv_sec) >= options.timeout))
+ return (runstate != RUN || (options.timeout > 0.00 && ((unsigned)(time(NULL) - options.start_time.tv_sec) >= options.timeout))
|| (options.num_steps > 0 && universe.steps > options.num_steps));
}
|| (options.num_steps > 0 && universe.steps > options.num_steps));
}