Browse Source

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

Samuel Thibault 8 years ago
parent
commit
ffcd176304

+ 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
 \verbatim
 export STARPU_DISK_SWAP=/tmp
 export STARPU_DISK_SWAP=/tmp
 export STARPU_DISK_SWAP_BACKEND=unistd
 export STARPU_DISK_SWAP_BACKEND=unistd
-export STARPU_DISK_SWAP_SIZE=$((200*1024*1024))
+export STARPU_DISK_SWAP_SIZE=200
 \endverbatim
 \endverbatim
 
 
 When the register function is called, StarPU will benchmark the disk. This can
 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>
 <dd>
 \anchor STARPU_DISK_SWAP_SIZE
 \anchor STARPU_DISK_SWAP_SIZE
 \addindex __env__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.
 memory is getting full. The default is unlimited.
 </dd>
 </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);
 	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)
 	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);
 		_STARPU_DISP("Warning: could not enable disk swap %s on %s with size %ld, could not enable disk swap", backend, path, (long) size);