소스 검색

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++)