浏览代码

Fix unit for STARPU_DISK_SWAP_SIZE: Bytes is really too small, use MB just like LIMIT*

Samuel Thibault 8 年之前
父节点
当前提交
ffcd176304
共有 3 个文件被更改,包括 3 次插入3 次删除
  1. 1 1
      doc/doxygen/chapters/401_out_of_core.doxy
  2. 1 1
      doc/doxygen/chapters/501_environment_variables.doxy
  3. 1 1
      src/core/disk.c

+ 1 - 1
doc/doxygen/chapters/401_out_of_core.doxy

@@ -45,7 +45,7 @@ This can also be achieved by just setting environment variables:
 \verbatim
 export STARPU_DISK_SWAP=/tmp
 export STARPU_DISK_SWAP_BACKEND=unistd
-export STARPU_DISK_SWAP_SIZE=$((200*1024*1024))
+export STARPU_DISK_SWAP_SIZE=200
 \endverbatim
 
 When the register function is called, StarPU will benchmark the disk. This can

+ 1 - 1
doc/doxygen/chapters/501_environment_variables.doxy

@@ -873,7 +873,7 @@ read/write with O_DIRECT), and leveldb (i.e. using a leveldb database).
 <dd>
 \anchor STARPU_DISK_SWAP_SIZE
 \addindex __env__STARPU_DISK_SWAP_SIZE
-This specifies then size to be used by StarPU to push data when the main
+This specifies then maximum size in MiB to be used by StarPU to push data when the main
 memory is getting full. The default is unlimited.
 </dd>
 

+ 1 - 1
src/core/disk.c

@@ -389,7 +389,7 @@ void _starpu_swap_init(void)
 
 	size = starpu_get_env_number_default("STARPU_DISK_SWAP_SIZE", -1);
 
-	dd = starpu_disk_register(ops, path, size);
+	dd = starpu_disk_register(ops, path, ((size_t) size) << 20);
 	if (dd < 0)
 	{
 		_STARPU_DISP("Warning: could not enable disk swap %s on %s with size %ld, could not enable disk swap", backend, path, (long) size);