Преглед на файлове

Initialize buffer to be written for testing disk bandwidth, to avoid any page fault cost, and please valgrind

Samuel Thibault преди 12 години
родител
ревизия
b74c9583ff
променени са 1 файла, в които са добавени 3 реда и са изтрити 1 реда
  1. 3 1
      src/core/disk_ops/disk_stdio.c

+ 3 - 1
src/core/disk_ops/disk_stdio.c

@@ -293,7 +293,7 @@ get_stdio_bandwidth_between_disk_and_main_ram(unsigned node)
 	struct timeval end;
 	
 	srand (time (NULL)); 
-	char * buf = malloc(SIZE_DISK_MIN*sizeof(char));
+	char * buf = malloc(SIZE_DISK_MIN);
 	STARPU_ASSERT(buf != NULL);
 	
 	/* allocate memory */
@@ -303,6 +303,8 @@ get_stdio_bandwidth_between_disk_and_main_ram(unsigned node)
 		return 0;
 	struct starpu_stdio_obj * tmp = (struct starpu_stdio_obj *) mem;
 
+	memset(buf, 0, SIZE_DISK_MIN);
+
 	/* Measure upload slowness */
 	gettimeofday(&start, NULL);
 	for (iter = 0; iter < NITER; ++iter)