From 1ff382d18946a15615be1771f98cb603a90fb07a Mon Sep 17 00:00:00 2001 From: Stephen Bates Date: Tue, 5 May 2015 15:38:46 -0600 Subject: Added -n 0 option to run loops forever --- mbw.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/mbw.c b/mbw.c index 56be86f..8771152 100644 --- a/mbw.c +++ b/mbw.c @@ -35,7 +35,7 @@ * MBW memory bandwidth benchmark * * 2006, 2012 Andras.Horvath@gmail.com - * 2013 j.m.slocum@gmail.com + * 2013 j.m.slocum@gmail.com * (Special thanks to Stephen Pasich) * * http://github.com/raas/mbw @@ -57,7 +57,7 @@ void usage() printf("mbw memory benchmark v%s, https://github.com/raas/mbw\n", VERSION); printf("Usage: mbw [options] array_size_in_MiB\n"); printf("Options:\n"); - printf(" -n: number of runs per test\n"); + printf(" -n: number of runs per test (0 to run forever)\n"); printf(" -a: Don't display average\n"); printf(" -t%d: memcpy test\n", TEST_MEMCPY); printf(" -t%d: dumb (b[i]=a[i] style) test\n", TEST_DUMB); @@ -238,6 +238,11 @@ int main(int argc, char **argv) tests[2]=1; } + if( nr_loops==0 && ((tests[0]+tests[1]+tests[2]) != 1) ) { + printf("Error: nr_loops can be zero if only one test selected!\n"); + exit(1); + } + if(optind Date: Wed, 6 May 2015 14:43:04 -0600 Subject: Added review changes for pull request --- mbw.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/mbw.c b/mbw.c index 8771152..c2e90e1 100644 --- a/mbw.c +++ b/mbw.c @@ -285,9 +285,7 @@ int main(int argc, char **argv) for(testno=0; testno