Переглянути джерело

tests: reduce testcases when running on slow machines

Nathalie Furmento 12 роки тому
батько
коміт
5cac12b599

+ 0 - 1
tests/datawizard/reclaim.c

@@ -91,7 +91,6 @@ int main(int argc, char **argv)
 	mb /= 100;
 	if (mb == 0)
 		mb = 1;
-	ntasks /= 100;
 #endif
 
 	FPRINTF(stderr, "Allocate %d buffers and create %u tasks\n", mb, ntasks);

+ 5 - 5
tests/main/declare_deps_after_submission.c

@@ -22,7 +22,11 @@
 #include <starpu.h>
 #include "../helper.h"
 
-#define NLOOPS	128
+#ifdef STARPU_SLOW_MACHINE
+  #define NLOOPS	4
+#else
+  #define NLOOPS	128
+#endif
 
 static void dummy_func(void *descr[] __attribute__ ((unused)), void *arg __attribute__ ((unused)))
 {
@@ -52,10 +56,6 @@ int main(int argc, char **argv)
 	int ret;
 	unsigned loop, nloops = NLOOPS;
 
-#ifdef STARPU_SLOW_MACHINE
-	nloops /= 8;
-#endif
-
 	ret = starpu_init(NULL);
 	if (ret == -ENODEV) return STARPU_TEST_SKIPPED;
 	STARPU_CHECK_RETURN_VALUE(ret, "starpu_init");

+ 5 - 5
tests/main/declare_deps_after_submission_synchronous.c

@@ -22,7 +22,11 @@
 #include <starpu.h>
 #include "../helper.h"
 
-#define NLOOPS	128
+#ifdef STARPU_SLOW_MACHINE
+  #define NLOOPS	4
+#else
+  #define NLOOPS	128
+#endif
 
 static void dummy_func(void *descr[] __attribute__ ((unused)), void *arg __attribute__ ((unused)))
 {
@@ -52,10 +56,6 @@ int main(int argc, char **argv)
 	int ret;
 	unsigned loop, nloops=NLOOPS;
 
-#ifdef STARPU_SLOW_MACHINE
-	nloops /= 8;
-#endif
-
 	ret = starpu_init(NULL);
 	if (ret == -ENODEV) return STARPU_TEST_SKIPPED;
 	STARPU_CHECK_RETURN_VALUE(ret, "starpu_init");

+ 5 - 1
tests/main/declare_deps_in_callback.c

@@ -23,7 +23,11 @@
 #include <starpu.h>
 #include "../helper.h"
 
-#define NLOOPS	128
+#ifdef STARPU_SLOW_MACHINE
+  #define NLOOPS	4
+#else
+  #define NLOOPS	128
+#endif
 
 static void callback(void *arg)
 {

+ 4 - 0
tests/main/empty_task.c

@@ -23,7 +23,11 @@
 #include <starpu.h>
 #include "../helper.h"
 
+#ifdef STARPU_SLOW_MACHINE
+static unsigned ntasks = 64;
+#else
 static unsigned ntasks = 65536;
+#endif
 
 static void usage(char **argv)
 {

+ 5 - 1
tests/main/execute_on_a_specific_worker.c

@@ -23,7 +23,11 @@
 #include <pthread.h>
 #include "../helper.h"
 
-#define N	1000
+#ifdef STARPU_SLOW_MACHINE
+  #define N 100
+#else
+  #define N 1000
+#endif
 
 #define VECTORSIZE	1024
 

+ 4 - 4
tests/main/get_current_task.c

@@ -22,7 +22,11 @@
 #include <starpu.h>
 #include "../helper.h"
 
+#ifdef STARPU_SLOW_MACHINE
+static unsigned ntasks = 64;
+#else
 static unsigned ntasks = 65536;
+#endif
 
 static void check_task_func(void *descr[], void *arg)
 {
@@ -57,10 +61,6 @@ int main(int argc, char **argv)
 	if (ret == -ENODEV) return STARPU_TEST_SKIPPED;
 	STARPU_CHECK_RETURN_VALUE(ret, "starpu_init");
 
-#ifdef STARPU_SLOW_MACHINE
-	ntasks /= 10;
-#endif
-
 	FPRINTF(stderr, "#tasks : %u\n", ntasks);
 
 	int i;

+ 4 - 4
tests/main/multithreaded.c

@@ -27,7 +27,11 @@
 
 pthread_t threads[16];
 
+#ifdef STARPU_SLOW_MACHINE
+static unsigned ntasks = 64;
+#else
 static unsigned ntasks = 65536;
+#endif
 static unsigned nthreads = 2;
 
 static void dummy_func(void *descr[] __attribute__ ((unused)), void *arg __attribute__ ((unused)))
@@ -105,10 +109,6 @@ int main(int argc, char **argv)
 	if (ret == -ENODEV) return STARPU_TEST_SKIPPED;
 	STARPU_CHECK_RETURN_VALUE(ret, "starpu_init");
 
-#ifdef STARPU_SLOW_MACHINE
-	ntasks /= 10;
-#endif
-
 	FPRINTF(stderr, "#tasks : %u\n", ntasks);
 
 	gettimeofday(&start, NULL);

+ 4 - 0
tests/main/regenerate.c

@@ -22,7 +22,11 @@
 #include <starpu.h>
 #include "../helper.h"
 
+#ifdef STARPU_SLOW_MACHINE
+static unsigned ntasks = 64;
+#else
 static unsigned ntasks = 65536;
+#endif
 static unsigned cnt = 0;
 
 static unsigned completed = 0;

+ 6 - 2
tests/main/restart.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2009, 2010  Université de Bordeaux 1
- * Copyright (C) 2010, 2011  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011, 2012  Centre National de la Recherche Scientifique
  *
  * 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
@@ -24,7 +24,11 @@
 
 #include "../helper.h"
 
-#define N	10
+#ifdef STARPU_SLOW_MACHINE
+  #define N	2
+#else
+  #define N	10
+#endif
 
 struct timeval start;
 struct timeval end;

+ 4 - 3
tests/main/starpu_task_wait.c

@@ -23,7 +23,11 @@
 #include <starpu.h>
 #include "../helper.h"
 
+#ifdef STARPU_SLOW_MACHINE
+static unsigned ntasks = 64;
+#else
 static unsigned ntasks = 65536;
+#endif
 
 static void dummy_func(void *descr[] __attribute__ ((unused)), void *arg __attribute__ ((unused)))
 {
@@ -69,9 +73,6 @@ int main(int argc, char **argv)
 
 	parse_args(argc, argv);
 
-#ifdef STARPU_SLOW_MACHINE
-	ntasks /= 1024;
-#endif
 #ifdef STARPU_HAVE_VALGRIND_H
 	if(RUNNING_ON_VALGRIND) ntasks = 5;
 #endif

+ 4 - 4
tests/main/starpu_task_wait_for_all.c

@@ -22,7 +22,11 @@
 #include <unistd.h>
 #include "../helper.h"
 
+#ifdef STARPU_SLOW_MACHINE
+static unsigned ntasks = 64;
+#else
 static unsigned ntasks = 65536;
+#endif
 
 static void dummy_func(void *descr[], void *arg)
 {
@@ -106,10 +110,6 @@ int main(int argc, char **argv)
 
 	parse_args(argc, argv, &conf);
 
-#ifdef STARPU_SLOW_MACHINE
-	ntasks /= 10;
-#endif
-
 	ret = starpu_init(&conf);
 	if (ret == -ENODEV) return STARPU_TEST_SKIPPED;
 	STARPU_CHECK_RETURN_VALUE(ret, "starpu_init");

+ 4 - 3
tests/main/static_restartable.c

@@ -22,7 +22,11 @@
 #include <starpu.h>
 #include "../helper.h"
 
+#ifdef STARPU_SLOW_MACHINE
+static unsigned ntasks = 64;
+#else
 static unsigned ntasks = 65536;
+#endif
 
 static void dummy_func(void *descr[] __attribute__ ((unused)), void *arg __attribute__ ((unused)))
 {
@@ -63,9 +67,6 @@ int main(int argc, char **argv)
 
 	parse_args(argc, argv);
 
-#ifdef STARPU_SLOW_MACHINE
-	ntasks /= 100;
-#endif
 #ifdef STARPU_HAVE_VALGRIND_H
 	if(RUNNING_ON_VALGRIND) ntasks = 5;
 #endif

+ 4 - 3
tests/main/static_restartable_tag.c

@@ -23,7 +23,11 @@
 #include <starpu.h>
 #include "../helper.h"
 
+#ifdef STARPU_SLOW_MACHINE
+static unsigned ntasks = 64;
+#else
 static unsigned ntasks = 65536;
+#endif
 static starpu_tag_t tag = 0x32;
 
 static void dummy_func(void *descr[] __attribute__ ((unused)), void *arg __attribute__ ((unused)))
@@ -65,9 +69,6 @@ int main(int argc, char **argv)
 
 	parse_args(argc, argv);
 
-#ifdef STARPU_SLOW_MACHINE
-	ntasks /= 100;
-#endif
 #ifdef STARPU_HAVE_VALGRIND_H
 	if(RUNNING_ON_VALGRIND) ntasks = 5;
 #endif

+ 4 - 3
tests/main/static_restartable_using_initializer.c

@@ -25,7 +25,11 @@
 /* This is equivalent to calling starpu_task_init later on */
 struct starpu_task task = STARPU_TASK_INITIALIZER;
 
+#ifdef STARPU_SLOW_MACHINE
+static unsigned ntasks = 64;
+#else
 static unsigned ntasks = 65536;
+#endif
 
 static void dummy_func(void *descr[] __attribute__ ((unused)), void *arg __attribute__ ((unused)))
 {
@@ -64,9 +68,6 @@ int main(int argc, char **argv)
 
 	parse_args(argc, argv);
 
-#ifdef STARPU_SLOW_MACHINE
-	ntasks /= 100;
-#endif
 #ifdef STARPU_HAVE_VALGRIND_H
 	if(RUNNING_ON_VALGRIND) ntasks = 5;
 #endif

+ 4 - 0
tests/main/subgraph_repeat.c

@@ -21,7 +21,11 @@
 
 #include "../helper.h"
 
+#ifdef STARPU_SLOW_MACHINE
+static unsigned niter = 64;
+#else
 static unsigned niter = 16384;
+#endif
 
 /*
  *

+ 4 - 0
tests/main/subgraph_repeat_regenerate.c

@@ -21,7 +21,11 @@
 
 #include "../helper.h"
 
+#ifdef STARPU_SLOW_MACHINE
+static unsigned niter = 64;
+#else
 static unsigned niter = 16384;
+#endif
 
 /*
  *

+ 4 - 0
tests/main/subgraph_repeat_regenerate_tag.c

@@ -21,7 +21,11 @@
 
 #include "../helper.h"
 
+#ifdef STARPU_SLOW_MACHINE
+static unsigned niter = 64;
+#else
 static unsigned niter = 16384;
+#endif
 
 #define TAG_START 0
 #define TAG_A 1

+ 4 - 0
tests/main/subgraph_repeat_tag.c

@@ -21,7 +21,11 @@
 
 #include "../helper.h"
 
+#ifdef STARPU_SLOW_MACHINE
+static unsigned niter = 64;
+#else
 static unsigned niter = 16384;
+#endif
 
 /*
  *

+ 4 - 0
tests/main/wait_all_regenerable_tasks.c

@@ -22,7 +22,11 @@
 #include <starpu.h>
 #include "../helper.h"
 
+#ifdef STARPU_SLOW_MACHINE
+static unsigned ntasks = 64;
+#else
 static unsigned ntasks = 1024;
+#endif
 
 static void callback(void *arg)
 {