Browse Source

tests: reduce testcases when quick-check is enabled

Nathalie Furmento 12 years ago
parent
commit
1121946f7b

+ 4 - 4
tests/datawizard/acquire_release2.c

@@ -19,7 +19,11 @@
 
 #include "../helper.h"
 
+#ifdef STARPU_QUICK_CHECK
+static unsigned ntasks = 40;
+#else
 static unsigned ntasks = 40000;
+#endif
 
 #ifdef STARPU_USE_CUDA
 extern void increment_cuda(void *descr[], __attribute__ ((unused)) void *_args);
@@ -92,10 +96,6 @@ int main(int argc, char **argv)
 
         FPRINTF(stderr, "Token: %u\n", token);
 
-#ifdef STARPU_QUICK_CHECK
-	ntasks /= 10;
-#endif
-
 	for(i=0; i<ntasks; i++)
 	{
                 ret = starpu_data_acquire_cb(token_handle, STARPU_W, callback, NULL);  // recv

+ 4 - 0
tests/datawizard/copy.c

@@ -18,7 +18,11 @@
 #include <starpu.h>
 #include "../helper.h"
 
+#ifdef STARPU_QUICK_CHECK
+static unsigned nloops = 10;
+#else
 static unsigned nloops = 1000;
+#endif
 
 static void dummy_func(void *descr[] __attribute__ ((unused)), void *arg __attribute__ ((unused)))
 {

+ 5 - 4
tests/datawizard/critical_section_with_void_interface.c

@@ -48,13 +48,14 @@ static struct starpu_codelet cl =
 
 int main(int argc, char **argv)
 {
-	int ntasks = 1000;
-	int ret;
-
 #ifdef STARPU_QUICK_CHECK
-	ntasks /= 10;
+	int ntasks = 10;
+#else
+	int ntasks = 1000;
 #endif
 
+	int ret;
+
 	ret = starpu_init(NULL);
 	if (ret == -ENODEV) return STARPU_TEST_SKIPPED;
 	STARPU_CHECK_RETURN_VALUE(ret, "starpu_init");

+ 2 - 2
tests/datawizard/data_invalidation.c

@@ -24,9 +24,9 @@
 #include "../helper.h"
 
 #ifdef STARPU_QUICK_CHECK
-#define NLOOPS		100
+#  define NLOOPS		100
 #else
-#define NLOOPS		1000
+#  define NLOOPS		1000
 #endif
 #define VECTORSIZE	1024
 

+ 5 - 1
tests/datawizard/dsm_stress.c

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

+ 5 - 0
tests/datawizard/increment_redux.c

@@ -220,8 +220,13 @@ int main(int argc, char **argv)
 
 	starpu_data_set_reduction_methods(handle, &redux_cl, &neutral_cl);
 
+#ifdef STARPU_QUICK_CHECK
+	unsigned ntasks = 32;
+	unsigned nloops = 4;
+#else
 	unsigned ntasks = 1024;
 	unsigned nloops = 16;
+#endif
 
 	unsigned loop;
 	unsigned t;

+ 5 - 0
tests/datawizard/increment_redux_lazy.c

@@ -201,8 +201,13 @@ int main(int argc, char **argv)
 
 	starpu_data_set_reduction_methods(handle, &redux_cl, &neutral_cl);
 
+#ifdef STARPU_QUICK_CHECK
+	unsigned ntasks = 32;
+	unsigned nloops = 4;
+#else
 	unsigned ntasks = 1024;
 	unsigned nloops = 16;
+#endif
 
 	unsigned loop;
 	unsigned t;

+ 5 - 0
tests/datawizard/increment_redux_v2.c

@@ -233,8 +233,13 @@ int main(int argc, char **argv)
 
 	starpu_data_set_reduction_methods(handle, &redux_cl, &neutral_cl);
 
+#ifdef STARPU_QUICK_CHECK
+	unsigned ntasks = 32;
+	unsigned nloops = 4;
+#else
 	unsigned ntasks = 1024;
 	unsigned nloops = 16;
+#endif
 
 	unsigned loop;
 	unsigned t;

+ 7 - 2
tests/datawizard/mpi_like_async.c

@@ -20,8 +20,13 @@
 #include <pthread.h>
 #include "../helper.h"
 
-#define NTHREADS_DEFAULT	16
-#define NITER_DEFAULT		128
+#ifdef STARPU_SLOW_MACHINE
+#  define NTHREADS_DEFAULT	4
+#  define NITER_DEFAULT		8
+#else
+#  define NTHREADS_DEFAULT	16
+#  define NITER_DEFAULT		128
+#endif
 
 static int nthreads = NTHREADS_DEFAULT;
 static int niter = NITER_DEFAULT;

+ 4 - 0
tests/datawizard/readers_and_writers.c

@@ -56,7 +56,11 @@ int main(int argc, char **argv)
 	/* initialize the resource */
 	starpu_vector_data_register(&book_handle, 0, (uintptr_t)&book, 1, sizeof(unsigned));
 
+#ifdef STARPU_QUICK_CHECK
+	unsigned ntasks = 16;
+#else
 	unsigned ntasks = 16*1024;
+#endif
 
 	unsigned t;
 	for (t = 0; t < ntasks; t++)

+ 7 - 2
tests/datawizard/scratch.c

@@ -23,8 +23,13 @@
 #include <stdlib.h>
 #include "../helper.h"
 
-#define NLOOPS		128
-#define VECTORSIZE	1024
+#ifdef STARPU_QUICK_CHECK
+#  define NLOOPS		8
+#  define VECTORSIZE		128
+#else
+#  define NLOOPS		128
+#  define VECTORSIZE		1024
+#endif
 
 static unsigned *A;
 starpu_data_handle_t A_handle, B_handle;

+ 13 - 6
tests/datawizard/user_interaction_implicit.c

@@ -23,8 +23,13 @@
 #include <pthread.h>
 #include "../helper.h"
 
-#define NBUFFERS	16
-#define NITER		128
+#ifdef STARPU_QUICK_CHECK
+#  define NBUFFERS	4
+#  define NITER		16
+#else
+#  define NBUFFERS	16
+#  define NITER		128
+#endif
 
 struct data
 {
@@ -61,11 +66,13 @@ int main(int argc, char **argv)
 
 	unsigned iter;
 	for (iter = 0; iter < NITER; iter++)
-	for (b = 0; b < NBUFFERS; b++)
 	{
-		ret = starpu_data_acquire_cb(buffers[b].handle, STARPU_RW,
-					     callback_sync_data, &buffers[b]);
-		STARPU_CHECK_RETURN_VALUE(ret, "starpu_data_acquire_cb");
+		for (b = 0; b < NBUFFERS; b++)
+		{
+			ret = starpu_data_acquire_cb(buffers[b].handle, STARPU_RW,
+						     callback_sync_data, &buffers[b]);
+			STARPU_CHECK_RETURN_VALUE(ret, "starpu_data_acquire_cb");
+		}
 	}
 
 	ret = starpu_task_wait_for_all();

+ 5 - 0
tests/datawizard/wt_broadcast.c

@@ -99,8 +99,13 @@ int main(int argc, char **argv)
 	 * to broadcast the handle whenever it is modified. */
 	starpu_data_set_wt_mask(handle, ~0);
 
+#ifdef STARPU_QUICK_CHECK
+	unsigned ntasks = 32;
+	unsigned nloops = 4;
+#else
 	unsigned ntasks = 1024;
 	unsigned nloops = 16;
+#endif
 
 	unsigned loop;
 	unsigned t;

+ 5 - 0
tests/datawizard/wt_host.c

@@ -99,8 +99,13 @@ int main(int argc, char **argv)
 	uint32_t wt_mask = (1<<0);
 	starpu_data_set_wt_mask(handle, wt_mask);
 
+#ifdef STARPU_QUICK_CHECK
+	unsigned ntasks = 32;
+	unsigned nloops = 4;
+#else
 	unsigned ntasks = 1024;
 	unsigned nloops = 16;
+#endif
 
 	unsigned loop;
 	unsigned t;