浏览代码

include/starpu_util.h: check that StarPU environment variables have non-negative values

Nathalie Furmento 8 年之前
父节点
当前提交
bbc5afae3a
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      include/starpu_util.h

+ 2 - 1
include/starpu_util.h

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2010-2016  Université de Bordeaux
- * Copyright (C) 2010, 2011, 2012, 2013, 2014, 2015  CNRS
+ * Copyright (C) 2010, 2011, 2012, 2013, 2014, 2015, 2016  CNRS
  *
  * StarPU is free software; you can redistribute it and/or modify
  * it under the terms of the GNU Lesser General Public License as published by
@@ -352,6 +352,7 @@ static __starpu_inline int starpu_get_env_number(const char *str)
 		}
 
 		/* fprintf(stderr, "ENV %s WAS %d\n", str, val); */
+		STARPU_ASSERT_MSG(val >= 0, "The value for the environment variable '%s' cannot be negative", str);
 		return (int)val;
 	}
 	else