瀏覽代碼

tests/disk: lower values when quick-check is enabled

Nathalie Furmento 10 年之前
父節點
當前提交
d789ba4ce2
共有 3 個文件被更改,包括 41 次插入22 次删除
  1. 10 5
      tests/disk/disk_compute.c
  2. 16 6
      tests/disk/disk_copy.c
  3. 15 11
      tests/disk/disk_pack.c

+ 10 - 5
tests/disk/disk_compute.c

@@ -1,6 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2013 Corentin Salingue
+ * Copyright (C) 2015 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
@@ -31,13 +32,17 @@
 #include "../helper.h"
 
 #ifdef STARPU_HAVE_WINDOWS
-        #include <io.h>
-#if defined(_WIN32) && !defined(__CYGWIN__)
-#define mkdir(path, mode) mkdir(path)
-#endif
+#  include <io.h>
+#  if defined(_WIN32) && !defined(__CYGWIN__)
+#    define mkdir(path, mode) mkdir(path)
+#  endif
 #endif
 
-#define NX (1024)
+#ifdef STARPU_QUICK_CHECK
+#  define NX (128)
+#else
+#  define NX (1024)
+#endif
 
 int dotest(struct starpu_disk_ops *ops, char *base)
 {

+ 16 - 6
tests/disk/disk_copy.c

@@ -1,6 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2013 Corentin Salingue
+ * Copyright (C) 2015 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
@@ -27,16 +28,25 @@
 #include "../helper.h"
 
 #ifdef STARPU_HAVE_WINDOWS
-#if defined(_WIN32) && !defined(__CYGWIN__)
-#define mkdir(path, mode) mkdir(path)
-#endif
+#  include <io.h>
+#  if defined(_WIN32) && !defined(__CYGWIN__)
+#    define mkdir(path, mode) mkdir(path)
+#  endif
 #endif
 
 /* size of one vector */
-#if SIZEOF_VOID_P == 4
-#define	NX	(32*1024/sizeof(double))
+#ifdef STARPU_QUICK_CHECK
+#  if SIZEOF_VOID_P == 4
+#    define	NX	(32*128/sizeof(double))
+#  else
+#    define	NX	(32*65536/sizeof(double))
+#  endif
 #else
-#define	NX	(32*1048576/sizeof(double))
+#  if SIZEOF_VOID_P == 4
+#    define	NX	(32*1024/sizeof(double))
+#  else
+#    define	NX	(32*1048576/sizeof(double))
+#  endif
 #endif
 
 #if !defined(STARPU_HAVE_SETENV)

+ 15 - 11
tests/disk/disk_pack.c

@@ -1,6 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2013 Corentin Salingue
+ * Copyright (C) 2015 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
@@ -31,14 +32,17 @@
 #include "../helper.h"
 
 #ifdef STARPU_HAVE_WINDOWS
-        #include <io.h>
-#if defined(_WIN32) && !defined(__CYGWIN__)
-#define mkdir(path, mode) mkdir(path)
+#  include <io.h>
+#  if defined(_WIN32) && !defined(__CYGWIN__)
+#    define mkdir(path, mode) mkdir(path)
+#  endif
 #endif
 
-#endif 
-
-#define NX (1024)
+#ifdef STARPU_QUICK_CHECK
+#  define NX (128)
+#else
+#  define NX (1024)
+#endif
 
 const struct starpu_data_copy_methods my_vector_copy_data_methods_s;
 struct starpu_data_interface_ops starpu_interface_my_vector_ops;
@@ -96,13 +100,13 @@ int dotest(struct starpu_disk_ops *ops, char *base)
 	int new_dd = starpu_disk_register(ops, (void *) base, 1024*1024*1);
 	/* can't write on /tmp/ */
 	if (new_dd == -ENOENT) goto enoent;
-	
+
 	unsigned dd = (unsigned) new_dd;
 
 	/* allocate two memory spaces */
 	starpu_malloc_flags((void **)&A, NX*sizeof(int), STARPU_MALLOC_COUNT);
 	starpu_malloc_flags((void **)&C, NX*sizeof(int), STARPU_MALLOC_COUNT);
-	
+
 	FPRINTF(stderr, "TEST DISK MEMORY \n");
 
 	unsigned int j;
@@ -165,8 +169,8 @@ int dotest(struct starpu_disk_ops *ops, char *base)
 	/* register vector in starpu */
 	starpu_my_vector_data_register(&vector_handleA, dd, (uintptr_t) data, NX, sizeof(int));
 
-	/* and do what you want with it, here we copy it into an other vector */ 
-	starpu_my_vector_data_register(&vector_handleC, dd, (uintptr_t) data_result, NX, sizeof(int));	
+	/* and do what you want with it, here we copy it into an other vector */
+	starpu_my_vector_data_register(&vector_handleC, dd, (uintptr_t) data_result, NX, sizeof(int));
 
 	starpu_data_cpy(vector_handleC, vector_handleA, 0, NULL, NULL);
 
@@ -178,7 +182,7 @@ int dotest(struct starpu_disk_ops *ops, char *base)
 	starpu_disk_close(dd, data, NX*sizeof(int));
 	starpu_disk_close(dd, data_result, NX*sizeof(int));
 
-	/* check results */	
+	/* check results */
 	f = fopen(path_file_end, "rb+");
 	if (f == NULL)
 		goto enoent2;