Explorar o código

Avoid risking dividing by zero due to environment variable

Samuel Thibault %!s(int64=9) %!d(string=hai) anos
pai
achega
431f798e39
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  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++)