From 7f34feee556c16c4ae61bf4c17f014f740aa8b03 Mon Sep 17 00:00:00 2001 From: Dorian Stoll <dorian.stoll@uni-potsdam.de> Date: Wed, 12 Jun 2024 14:21:58 +0200 Subject: [PATCH] rodinia-srad: c: Remove option to specify OMP threads This option is - redundant, the OpenMP threads can be set with an environment variable - not portable to other threading frameworks (e.g. Julia) - not necessary, because we want all threads to be used --- src/benchmarks/rodinia-srad/c/README | 3 +-- src/benchmarks/rodinia-srad/c/srad.cpp | 15 ++++----------- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/src/benchmarks/rodinia-srad/c/README b/src/benchmarks/rodinia-srad/c/README index bd61c69d..d7f99e7b 100644 --- a/src/benchmarks/rodinia-srad/c/README +++ b/src/benchmarks/rodinia-srad/c/README @@ -1,5 +1,5 @@ Usage: -srad 128 128 0 31 0 31 4 0.5 2 +srad 128 128 0 31 0 31 0.5 2 128 //number of rows in the domain 128 //number of cols in the domain @@ -7,7 +7,6 @@ srad 128 128 0 31 0 31 4 0.5 2 31 //y2 position of the speckle 0 //x1 position of the speckle 31 //x2 position of the speckle -4 //number of threads 0.5 //Lambda value 2 //number of iterations diff --git a/src/benchmarks/rodinia-srad/c/srad.cpp b/src/benchmarks/rodinia-srad/c/srad.cpp index 6bb579f3..678ec9b9 100644 --- a/src/benchmarks/rodinia-srad/c/srad.cpp +++ b/src/benchmarks/rodinia-srad/c/srad.cpp @@ -11,16 +11,13 @@ void random_matrix(float *I, int rows, int cols); void usage(int argc, char **argv) { - fprintf(stderr, "Usage: %s <rows> <cols> <y1> <y2> <x1> <x2> <no. of " - "threads><lamda> <no. of iter>\n", - argv[0]); + fprintf(stderr, "Usage: %s <rows> <cols> <y1> <y2> <x1> <x2> <lamda> <no. of iter>\n", argv[0]); fprintf(stderr, "\t<rows> - number of rows\n"); fprintf(stderr, "\t<cols> - number of cols\n"); fprintf(stderr, "\t<y1> - y1 value of the speckle\n"); fprintf(stderr, "\t<y2> - y2 value of the speckle\n"); fprintf(stderr, "\t<x1> - x1 value of the speckle\n"); fprintf(stderr, "\t<x2> - x2 value of the speckle\n"); - fprintf(stderr, "\t<no. of threads> - no. of threads\n"); fprintf(stderr, "\t<lamda> - lambda (0,1)\n"); fprintf(stderr, "\t<no. of iter> - number of iterations\n"); @@ -38,9 +35,8 @@ int main(int argc, char *argv[]) { float *c, D; float lambda; int i, j; - int nthreads; - if (argc == 10) { + if (argc == 9) { rows = atoi(argv[1]); // number of rows in the domain cols = atoi(argv[2]); // number of cols in the domain if ((rows % 16 != 0) || (cols % 16 != 0)) { @@ -51,9 +47,8 @@ int main(int argc, char *argv[]) { r2 = atoi(argv[4]); // y2 position of the speckle c1 = atoi(argv[5]); // x1 position of the speckle c2 = atoi(argv[6]); // x2 position of the speckle - nthreads = atoi(argv[7]); // number of threads - lambda = atof(argv[8]); // Lambda value - niter = atoi(argv[9]); // number of iterations + lambda = atof(argv[7]); // Lambda value + niter = atoi(argv[8]); // number of iterations } else { usage(argc, argv); } @@ -116,7 +111,6 @@ int main(int argc, char *argv[]) { q0sqr = varROI / (meanROI * meanROI); - omp_set_num_threads(nthreads); #pragma omp parallel for shared(J, dN, dS, dW, dE, c, rows, cols, iN, iS, jW, \ jE) private(i, j, k, Jc, G2, L, num, den, \ qsqr) @@ -155,7 +149,6 @@ int main(int argc, char *argv[]) { } } - omp_set_num_threads(nthreads); #pragma omp parallel for shared(J, c, rows, cols, \ lambda) private(i, j, k, D, cS, cN, cW, cE) for (int i = 0; i < rows; i++) { -- GitLab