added --one-run option

git-svn-id: svn://anubis/gvsu@345 45c1a28c-8058-47b2-ae61-ca45b979098e
This commit is contained in:
josh 2008-12-08 23:17:54 +00:00
parent 37e494a30f
commit f85f20be57

View File

@ -52,6 +52,7 @@ int main(int argc, char * argv[])
Computation * computation = NULL; Computation * computation = NULL;
int fractal_type = 0; int fractal_type = 0;
bool display_times = false; bool display_times = false;
bool one_run = false;
SDL_Surface * screen; SDL_Surface * screen;
Uint32 * pixels; Uint32 * pixels;
@ -83,6 +84,10 @@ int main(int argc, char * argv[])
{ {
task_size = atoi(strlen(argv[i]) > 2 ? argv[i] + 2 : argv[++i]); task_size = atoi(strlen(argv[i]) > 2 ? argv[i] + 2 : argv[++i]);
} }
else if (!strcmp(argv[i], "--one-run"))
{
one_run = true;
}
} }
getSizes(&my_rank, &world_size, &nprocs); getSizes(&my_rank, &world_size, &nprocs);
if (my_rank == 0) if (my_rank == 0)
@ -135,6 +140,8 @@ int main(int argc, char * argv[])
gettimeofday(&before, NULL); gettimeofday(&before, NULL);
draw(my_rank, world_size, nprocs, width, height, draw(my_rank, world_size, nprocs, width, height,
pixels, taskVals, computation); pixels, taskVals, computation);
if (one_run)
going = false;
gettimeofday(&after, NULL); gettimeofday(&after, NULL);
if (display_times) if (display_times)
{ {