Browse Source

- fix environment variable parsing (thanks Pierrick)
- modify testcase to check multi-digit omp num threads

Olivier Aumage 11 years ago
parent
commit
292dde37b9
2 changed files with 2 additions and 2 deletions
  1. 1 1
      src/util/openmp_runtime_support_environment.c
  2. 1 1
      tests/openmp/environment.c

+ 1 - 1
src/util/openmp_runtime_support_environment.c

@@ -364,7 +364,7 @@ static void convert_num_threads_string(const char *_str, int *num_threads_list,
 			level++;
 			if (level == max_levels)
 				break;
-			i++;
+			i = endptr - str;
 			state = state_split;
 		}
 		else

+ 1 - 1
tests/openmp/environment.c

@@ -37,7 +37,7 @@ main (int argc, char *argv[]) {
 	setenv("OMP_CANCELLATION","false", 1);
 	setenv("OMP_DEFAULT_DEVICE","0", 1);
 	setenv("OMP_PROC_BIND","spread, spread, close", 1);
-	setenv("OMP_NUM_THREADS","4, 2, 2", 1);
+	setenv("OMP_NUM_THREADS","4, 16, 2", 1);
 	setenv("OMP_PLACES","{1,2,3,4},{5,6,7,8}", 1);
 	setenv("OMP_DISPLAY_ENV","verbose", 1);
 	int ret = starpu_omp_init();