Prechádzať zdrojové kódy

define --enable-slow-machine to run tests and examples with smaller inputs

Nathalie Furmento 14 rokov pred
rodič
commit
2f3d6b8515

+ 8 - 0
configure.ac

@@ -113,6 +113,14 @@ else
   AC_DEFINE([starpu_erand48(xsubi)],[starpu_drand48()],[erand48 equivalent function])
 fi
 
+# Define slow machine
+AC_ARG_ENABLE(slow-machine, [AS_HELP_STRING([--disable-slow-machine],
+				   [Lower default values for the testcases run by make check])],
+				   enable_slow_machine=$enableval, enable_slow_machine=false)
+if  test x$enable_slow_machine = xyes; then
+	AC_DEFINE(STARPU_SLOW_MACHINE, [1], [enable slow machine])
+fi
+
 AC_CHECK_HEADERS([malloc.h], [AC_DEFINE([STARPU_HAVE_MALLOC_H], [1], [Define to 1 if you have the <malloc.h> header file.])])
 
 # This defines HAVE_SYNC_VAL_COMPARE_AND_SWAP

+ 3 - 0
examples/basic_examples/variable.c

@@ -43,6 +43,9 @@ int main(int argc, char **argv)
 
 	starpu_init(NULL);
 
+#ifdef STARPU_SLOW_MACHINE
+	niter /= 100;
+#endif
         if (argc == 2) niter = atoi(argv[1]);
         foo = 0.0f;
 

+ 3 - 0
examples/incrementer/incrementer.c

@@ -43,6 +43,9 @@ int main(int argc, char **argv)
 {
 	starpu_init(NULL);
 
+#ifdef STARPU_SLOW_MACHINE
+	niter /= 100;
+#endif
 	if (argc == 2)
 		niter = atoi(argv[1]);
 

+ 7 - 1
examples/scheduler/dummy_sched.c

@@ -118,10 +118,16 @@ static starpu_codelet dummy_codelet =
 
 int main(int argc, char **argv)
 {
+	int ntasks = NTASKS;
+
 	starpu_init(&conf);
 
+#ifdef STARPU_SLOW_MACHINE
+	ntasks /= 100;
+#endif
+
 	unsigned i;
-	for (i = 0; i < NTASKS; i++)
+	for (i = 0; i < ntasks; i++)
 	{
 		struct starpu_task *task = starpu_task_create();
 	

+ 2 - 0
include/starpu_config.h.in

@@ -64,4 +64,6 @@ typedef ssize_t starpu_ssize_t;
 #define __starpu_func__ __func__
 #endif
 
+#undef STARPU_SLOW_MACHINE
+
 #endif

+ 4 - 0
tests/core/get_current_task.c

@@ -54,6 +54,10 @@ int main(int argc, char **argv)
 
 	starpu_init(NULL);
 
+#ifdef STARPU_SLOW_MACHINE
+	ntasks /= 10;
+#endif
+
 	FPRINTF(stderr, "#tasks : %u\n", ntasks);
 
 	int i;

+ 4 - 0
tests/core/multithreaded.c

@@ -99,6 +99,10 @@ int main(int argc, char **argv)
 
 	starpu_init(NULL);
 
+#ifdef STARPU_SLOW_MACHINE
+	ntasks /= 10;
+#endif
+
 	FPRINTF(stderr, "#tasks : %u\n", ntasks);
 
 	gettimeofday(&start, NULL);

+ 4 - 0
tests/core/starpu_task_wait.c

@@ -68,6 +68,10 @@ int main(int argc, char **argv)
 
 	parse_args(argc, argv);
 
+#ifdef STARPU_SLOW_MACHINE
+	ntasks /= 10;
+#endif
+
 	starpu_init(NULL);
 
 	FPRINTF(stderr, "#tasks : %u\n", ntasks);

+ 4 - 0
tests/core/starpu_task_wait_for_all.c

@@ -114,6 +114,10 @@ int main(int argc, char **argv)
 
 	parse_args(argc, argv);
 
+#ifdef STARPU_SLOW_MACHINE
+	ntasks /= 10;
+#endif
+
 	starpu_init(&conf);
 
 	init_gordon_kernel();

+ 4 - 0
tests/datawizard/acquire_release2.c

@@ -68,6 +68,10 @@ int main(int argc, char **argv)
 
         FPRINTF(stderr, "Token: %u\n", token);
 
+#ifdef STARPU_SLOW_MACHINE
+	ntasks /= 10;
+#endif
+
 	for(i=0; i<ntasks; i++)
 	{
                 starpu_data_acquire_cb(token_handle, STARPU_W, callback, NULL);  // recv

+ 4 - 0
tests/datawizard/critical_section_with_void_interface.c

@@ -44,6 +44,10 @@ int main(int argc, char **argv)
 	int ntasks = 1000;
 	int ret;
 
+#ifdef STARPU_SLOW_MACHINE
+	ntasks /= 10;
+#endif
+
 	starpu_init(NULL);
 
 	critical_var = 0;

+ 5 - 1
tests/datawizard/reclaim.c

@@ -25,7 +25,11 @@
 #include <hwloc.h>
 #endif
 
-#define BLOCK_SIZE	(64*1024*1024)
+#ifdef STARPU_SLOW_MACHINE
+#  define BLOCK_SIZE (64*1024)
+#else
+#  define BLOCK_SIZE (64*1024*1024)
+#endif
 #define FPRINTF(ofile, fmt, args ...) do { if (!getenv("STARPU_SSILENT")) {fprintf(ofile, fmt, ##args); }} while(0)
 
 static unsigned ntasks = 1000;