Explorar o código

Avoid dividing by zero

Samuel Thibault %!s(int64=7) %!d(string=hai) anos
pai
achega
5f90e0cedb
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  1. 3 1
      starpufft/src/starpufftx.c

+ 3 - 1
starpufft/src/starpufftx.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2009-2012, 2014  Université de Bordeaux
+ * Copyright (C) 2009-2012, 2014, 2017  Université de Bordeaux
  * Copyright (C) 2010, 2011, 2012, 2013, 2014  CNRS
  *
  * StarPU is free software; you can redistribute it and/or modify
@@ -451,6 +451,8 @@ STARPUFFT(showstats)(FILE *out)
 	for (worker = 0, total = 0; worker < starpu_worker_get_count(); worker++)
 		total += task_per_worker[worker];
 
+	if (!total)
+		return;
 	for (worker = 0; worker < starpu_worker_get_count(); worker++)
 	{
 		if (task_per_worker[worker])