浏览代码

Reduce stencil execution time on valgrind

Samuel Thibault 5 年之前
父节点
当前提交
4a7481131a
共有 2 个文件被更改,包括 34 次插入4 次删除
  1. 17 2
      examples/stencil/implicit-stencil.c
  2. 17 2
      examples/stencil/stencil.c

+ 17 - 2
examples/stencil/implicit-stencil.c

@@ -16,6 +16,10 @@
 
 #include "implicit-stencil.h"
 
+#ifdef STARPU_HAVE_VALGRIND_H
+#include <valgrind/valgrind.h>
+#endif
+
 /* Main application */
 
 /* default parameter values */
@@ -26,18 +30,20 @@ static unsigned ticks = 1000;
 #ifdef STARPU_QUICK_CHECK
 static unsigned niter = 4;
 #define SIZE 16
+#define NBZ 8
 #else
 static unsigned niter = 32;
 #define SIZE 128
+#define NBZ 64
 #endif
 
 /* Problem size */
 static unsigned sizex = SIZE;
 static unsigned sizey = SIZE;
-static unsigned sizez = 64*SIZE;
+static unsigned sizez = NBZ*SIZE;
 
 /* Number of blocks (scattered over the different MPI processes) */
-unsigned nbz = 64;
+unsigned nbz = NBZ;
 
 double start;
 double begin, end;
@@ -120,6 +126,15 @@ static void parse_args(int argc, char **argv)
 			 exit(0);
 		}
 	}
+
+#ifdef STARPU_HAVE_VALGRIND_H
+	if (RUNNING_ON_VALGRIND)
+	{
+		sizex = sizey = 3;
+		nbz = 10;
+		sizez = nbz*3;
+	}
+#endif
 }
 
 static void init_problem(int argc, char **argv, int rank, int world_size)

+ 17 - 2
examples/stencil/stencil.c

@@ -16,6 +16,10 @@
 
 #include "stencil.h"
 
+#ifdef STARPU_HAVE_VALGRIND_H
+#include <valgrind/valgrind.h>
+#endif
+
 /* Main application */
 
 /* default parameter values */
@@ -26,18 +30,20 @@ static unsigned ticks = 1000;
 #ifdef STARPU_QUICK_CHECK
 static unsigned niter = 4;
 #define SIZE 16
+#define NBZ 8
 #else
 static unsigned niter = 32;
 #define SIZE 128
+#define NBZ 64
 #endif
 
 /* Problem size */
 static unsigned sizex = SIZE;
 static unsigned sizey = SIZE;
-static unsigned sizez = 64*SIZE;
+static unsigned sizez = NBZ*SIZE;
 
 /* Number of blocks (scattered over the different MPI processes) */
-unsigned nbz = 64;
+unsigned nbz = NBZ;
 
 /*
  *	Initialization
@@ -116,6 +122,15 @@ static void parse_args(int argc, char **argv)
 			 exit(0);
 		}
 	}
+
+#ifdef STARPU_HAVE_VALGRIND_H
+	if (RUNNING_ON_VALGRIND)
+	{
+		sizex = sizey = 3;
+		nbz = 10;
+		sizez = nbz*3;
+	}
+#endif
 }
 
 static void init_problem(int argc, char **argv, int rank, int world_size)