瀏覽代碼

Avoid risking dividing by zero due to environment variable

Samuel Thibault 9 年之前
父節點
當前提交
431f798e39
共有 1 個文件被更改,包括 3 次插入1 次删除
  1. 3 1
      src/core/detect_combined_workers.c

+ 3 - 1
src/core/detect_combined_workers.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2010-2015  Université de Bordeaux
+ * Copyright (C) 2010-2016  Université de Bordeaux
  * Copyright (C) 2011, 2012, 2013       CNRS
  *
  * StarPU is free software; you can redistribute it and/or modify
@@ -174,6 +174,8 @@ static void find_and_assign_combinations_with_hwloc(int *workerids, int nworkers
 	if (synthesize_arity == -1)
 		synthesize_arity = 2;
 
+	STARPU_ASSERT_MSG(synthesize_arity > 0, "STARPU_SYNTHESIZE_ARITY_COMBINED_WORKER must be greater than 0");
+
 	/* First, mark nodes which contain CPU workers, simply by setting their userdata field */
 	int i;
 	for (i = 0; i < nworkers; i++)