egf_parallel function

Define a Parallelization Method

Define a Parallelization Method

Defines instructions for parallelization by linking a method with options.

egf_parallel(method = c("serial", "multicore", "snow"), outfile = "", cores = getOption("egf.cores", 1L), args = list(), cl = NULL)

Arguments

  • method: a character string indicating a method of parallelization. "serial" indicates no parallelization. "multicore" indicates level forking. It is intended for use from a terminal rather than from a GUI. "snow" indicates socket clusters. On Windows, "multicore" is equivalent to "serial". "snow" is supported on both Unix-alikes and Windows.

  • outfile: a character string indicating a file path where console output should be diverted. An empty string indicates no diversion. If method = "snow", then diversion may be necessary to view output.

  • cores: a positive integer indicating a number of threads/processes to fork/spawn when parallel != "serial". detectCores can be called to detect the theoretical maximum.

  • args: a list of optional arguments to mclapply (method = "multicore") or makePSOCKcluster (method = "snow").

  • cl: an existing socket cluster

    (method = "snow"). The default is to create a new cluster stop it upon job completion.

Returns

A list inheriting from class "egf_parallel"

containing the arguments (after possible matching and coercion).

See Also

vignette("parallel", "parallel").

Examples

parallel <- egf_parallel() str(parallel)