Przeglądaj źródła

mpi/tests/mpi_reduction.c: skip test when running on valgrind

Nathalie Furmento 8 lat temu
rodzic
commit
6df46001ca
2 zmienionych plików z 19 dodań i 1 usunięć
  1. 3 1
      mpi/tests/mpi_reduction.c
  2. 16 0
      tests/helper.h

+ 3 - 1
mpi/tests/mpi_reduction.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  *
  * Copyright (C) 2013, 2015  Université de Bordeaux
  * Copyright (C) 2013, 2015  Université de Bordeaux
- * Copyright (C) 2012, 2013, 2014, 2015, 2016  CNRS
+ * Copyright (C) 2012, 2013, 2014, 2015, 2016, 2017  CNRS
  *
  *
  * StarPU is free software; you can redistribute it and/or modify
  * 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
  * it under the terms of the GNU Lesser General Public License as published by
@@ -97,6 +97,8 @@ int main(int argc, char **argv)
 
 
 	int nb_elements, step, loops;
 	int nb_elements, step, loops;
 
 
+	STARPU_SKIP_IF_VALGRIND_RETURN_SKIP;
+
 	/* Not supported yet */
 	/* Not supported yet */
 	if (starpu_get_env_number_default("STARPU_GLOBAL_ARBITER", 0) > 0)
 	if (starpu_get_env_number_default("STARPU_GLOBAL_ARBITER", 0) > 0)
 		return STARPU_TEST_SKIPPED;
 		return STARPU_TEST_SKIPPED;

+ 16 - 0
tests/helper.h

@@ -79,6 +79,21 @@ static int _starpu_valgrind_print_once STARPU_ATTRIBUTE_UNUSED = 0;
 		}							\
 		}							\
 	} while(0)
 	} while(0)
 
 
+#  define STARPU_SKIP_IF_VALGRIND_RETURN_SKIP \
+	do \
+	{								\
+		if(STARPU_RUNNING_ON_VALGRIND)					\
+		{							\
+			STARPU_HG_DISABLE_CHECKING(_starpu_valgrind_print_once);	\
+			if (!_starpu_valgrind_print_once)		\
+			{						\
+				FPRINTF(stderr, "Running on valgrind, skipping the actual computations\n"); \
+				_starpu_valgrind_print_once = 1;	\
+			}						\
+			return STARPU_TEST_SKIPPED;			\
+		}							\
+	} while(0)
+
 #  define STARPU_RETURN(ret) \
 #  define STARPU_RETURN(ret) \
 	do								\
 	do								\
 	{								\
 	{								\
@@ -94,6 +109,7 @@ static int _starpu_valgrind_print_once STARPU_ATTRIBUTE_UNUSED = 0;
 #  define STARPU_RETURN(ret) return ret
 #  define STARPU_RETURN(ret) return ret
 #  define STARPU_SKIP_IF_VALGRIND
 #  define STARPU_SKIP_IF_VALGRIND
 #  define STARPU_SKIP_IF_VALGRIND_RETURN_ZERO
 #  define STARPU_SKIP_IF_VALGRIND_RETURN_ZERO
+#  define STARPU_SKIP_IF_VALGRIND_RETURN_SKIP
 #endif  /* defined(STARPU_HAVE_VALGRIND_H) && !defined(STARPU_VALGRIND_FULL) */
 #endif  /* defined(STARPU_HAVE_VALGRIND_H) && !defined(STARPU_VALGRIND_FULL) */
 
 
 #ifndef ANNOTATE_HAPPENS_BEFORE
 #ifndef ANNOTATE_HAPPENS_BEFORE