Can anyone help me figure out how to change the max size of global objects passed to an item in the future package?
任何人都可以帮我弄清楚如何更改传递给未来包中的项目的全局对象的最大大小?
Here's a useless example that shows my point
这是一个无用的例子,显示了我的观点
library(future)
a = 1:200000000
object.size(a)
test %<-% head(a)
I get the following error:
我收到以下错误:
Error in getGlobalsAndPackages(expr, envir = envir, persistent = persistent, : The total size of all global objects that need to be exported for the future expression (‘head(a)’) is 762.95 MiB. This exceeds the maximum allowed size of 500.00 MiB (option 'future.global.maxSize'). There are two globals: ‘a’ (762.94 MiB of class ‘numeric’) and ‘head’ (10.05 KiB of class ‘function’).
getGlobalsAndPackages中的错误(expr,envir = envir,persistent = persistent,:为将来表达式('head(a)')需要导出的所有全局对象的总大小为762.95 MiB。这超出了允许的最大大小500.00 MiB(选项'future.global.maxSize')。有两个全局变量:'a'(762.94 MiB类'数'')和'head'(10.05 KiB类'函数')。
Can anyone help me understand how to adjust that future.global.maxSize option? I tried options(future.global.maxSize = 1500000)
but that didn't work.
谁能帮助我了解如何调整future.global.maxSize选项?我尝试了选项(future.global.maxSize = 1500000)但是没有用。
1 个解决方案
#1
11
Got it figured out and learned how you can edit options for any package.
了解它并了解如何编辑任何包的选项。
This is the line that I used:
这是我使用的行:
options(future.globals.maxSize= 891289600)
If you want to customize your limit, I saw in the package source that the limit was calculated and this is how you would calculate the size for an 850mb limit:
如果你想自定义你的限制,我在包源中看到计算了限制,这就是你如何计算850mb限制的大小:
850*1024^2 = 891289600
Thanks!
#1
11
Got it figured out and learned how you can edit options for any package.
了解它并了解如何编辑任何包的选项。
This is the line that I used:
这是我使用的行:
options(future.globals.maxSize= 891289600)
If you want to customize your limit, I saw in the package source that the limit was calculated and this is how you would calculate the size for an 850mb limit:
如果你想自定义你的限制,我在包源中看到计算了限制,这就是你如何计算850mb限制的大小:
850*1024^2 = 891289600
Thanks!