This is an internal function. The function_to_do is done in parallel and its output is saved either on slave (locally) or on master.
do_in_parallel(
function_to_do,
function_params,
save_to_file,
save_params,
socket_names,
libraries,
save_locally = TRUE
)
this is the function that will be done in parallel
a list where function_params[[i]]
is
a named list of parameters to be passed to function_to_do
for
job i
function that saves stuff to file
a list where save_params[[i]]
is a named list of parameters to be passed to save_to_file
for
job i
. Each save_params[[i]]
must include out_dir
,
which is location where file is to be saved.
quoting from makePSOCKcluster
:
"either a character vector of host names on which to run the worker
copies of R, or a positive integer (in which case that number of
copies is run on localhost)."
character vector of R packages that will be needed on the slaves.
if TRUE, then files will be saved on slaves. If FALSE, they will be saved on master.