I often use the clusterEvalQ function to initialize the cluster workers.
To set the "warn" option, you could use:

    clusterEvalQ(cl, options(warn=1))

For something more complicated, I use clusterCall, but clusterEvalQ
is perfect for something like this.

- Steve



On Thu, Apr 18, 2013 at 7:53 AM, Martin Ivanov <
martin.ivanov@ifg.uni-tuebingen.de> wrote:

> Dear all,
>
> I am running R-3.0.0 on Slackware64-Linux with kernel 2.6.38.4. I want to
> have the
> warnings printed as they occur, so I have to set options(warn=1). The
> problem is that the
> options settings are not automatically transferred to the worker
> processes. And I do not know how to achieve this.
> The workaround I found is exporting the .Options variable and then setting
> options locally in the worker process:
>
> library(parallel)
> ow <- options("warn");
> options(warn=1);
> cl <- makeCluster(getOption("cl.**cores", detectCores()), outfile="");
> varlist <- unlist(sapply(X=c(".GlobalEnv"**), FUN=ls));
> clusterExport(cl=cl, varlist=c(varlist, ".Options"), envir=.GlobalEnv);
> x <- parSapply(cl=cl, X=1:240, FUN=function(repl) { options(.Options);
> matrix(1:7, 3,4); } );
> stopCluster(cl=cl);
> options(ow); # reset
>
>
> If you comment the options(.Options) command above, you will see that
> again no warnings are printed.
> My question is, is there a neater way of exporting options to the worker
> processes?
>
> Best regards,
>
>
> --
> Dr. Martin Ivanov
> Eberhard-Karls-Universität Tübingen
> Mathematisch-**Naturwissenschaftliche Fakultät
> Fachbereich Geowissenschaften
> Water & Earth System Science (WESS)
> Hölderlinstraße 12, 72074 Tübingen, Deutschland
> Tel. +4970712974213
>
> ______________________________**_________________
> R-sig-hpc mailing list
> R-sig-hpc@r-project.org
> https://stat.ethz.ch/mailman/**listinfo/r-sig-hpc<https://stat.ethz.ch/mailman/listinfo/r-sig-hpc>
>

	[[alternative HTML version deleted]]

