Explorar el Código

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

Samuel Thibault hace 11 años
padre
commit
b74c9583ff
Se han modificado 1 ficheros con 3 adiciones y 1 borrados
  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)