Skip to content

Commit

Permalink
add simple check for unserialize mem req (#335)
Browse files Browse the repository at this point in the history
  • Loading branch information
mschubert committed Jan 10, 2025
1 parent 622ff14 commit 3eb8f23
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion R/Q_rows.r
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ Q_rows = function(df, fun, const=list(), export=list(), pkgs=c(), seed=128965,
log_worker=log_worker, verbose=verbose)
workers$env(fun=fun, rettype=rettype, common_seed=seed, const=const)
workers$pkg(pkgs)
do.call(workers$env, export)
objs = do.call(workers$env, export)
if (!is.null(template$memory) && 2*sum(objs$size)/1024^2 > template$memory)
stop("Not enough memory requested to unserialize data on workers")

# heuristic for chunk size
if (is.na(chunk_size))
Expand Down

0 comments on commit 3eb8f23

Please sign in to comment.