ソースを参照

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

Samuel Thibault 11 年 前
コミット
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)