[R] snow and different R versions

Gábor Csárdi csardi.gabor at gmail.com
Fri Jan 16 11:41:56 CET 2009


Just for the records. The problem was that the R version Rscript
starts is determined at compile time, and I had to move my R
installation to another place for some technical reasons. At the
compile-time place there was another R version and Rscript started
that one.

The solution was to create a dummy rscript file that sets up the RHOME
environment variable for the real Rscript:
-----------------------------
#! /bin/sh
export RHOME="/home/gabor/software/lib64/R"
/home/gabor/software/lib64/R/bin/Rscript "$@"
-----------------------------
and then use this file with snow, via the setDefaultClusterOptions
function or some other way.

Gabor

On Tue, Jan 13, 2009 at 1:40 AM,  <luke at stat.uiowa.edu> wrote:
> As far as I can tell looking at the code and running on my stytem this
> should use the one in rscript if you are starting via makeCluster or
> makeMPIcluster. You might double check by doing debug(makeMPIcluster)
> and stepping through and looking at what is uses in the call to
> mpi.comm.spawn for mpitask and args.
>
> luke
>
> On Fri, 9 Jan 2009, Gábor Csárdi wrote:
>
>> Dear Luke and others,
>>
>> I have many R versions on my machine and want to start a particular
>> one when snow builds its cluster. (The same version I start snow
>> from.) It seems that everything is set up correctly in
>> defaultClusterOptions:
>>
>>> mget(ls(defaultClusterOptions), defaultClusterOptions)
>>
>> $homogeneous
>> [1] TRUE
>>
>> $manual
>> [1] FALSE
>>
>> $master
>>     nodename
>> "maya.unil.ch"
>>
>> $outfile
>> [1] "/dev/null"
>>
>> $port
>> [1] 10187
>>
>> $rhome
>>                       R_HOME > sessionInfo()
>> R version 2.8.0 (2008-10-20)
>> x86_64-redhat-linux-gnu
>>
>> locale:
>>
>> LC_CTYPE=en_US.UTF-8;LC_NUMERIC=C;LC_TIME=en_US.UTF-8;LC_COLLATE=en_US.UTF-8;LC_MONETARY=C;LC_MESSAGES=en_US.UTF-8;LC_PAPER=en_US.UTF-8;LC_NAME=C;LC_ADDRESS=C;LC_TELEPHONE=C;LC_MEASUREMENT=en_US.UTF-8;LC_IDENTIFICATION=C
>>
>> attached base packages:
>> [1] stats     graphics  grDevices utils     datasets  methods   base
>>
>> other attached packages:
>> [1] snow_0.3-3
>>
>> "/home/gabor/software/lib64/R"
>>
>> $rlibs
>>                                    R_LIBS
>> "/usr/lib64/R/library:/usr/share/R/library"
>>
>> $rprog
>> [1] "/home/gabor/software/lib64/R/bin/R"
>>
>> $rscript
>> [1] "/home/gabor/software/lib64/R/bin/Rscript"
>>
>> $rshcmd
>> [1] "ssh"
>>
>> $scriptdir
>> [1] "/home/gabor/.R/library/snow"
>>
>> $snowlib
>> [1] "/home/gabor/.R/library"
>>
>> $timeout
>> [1] 31536000
>>
>> $type
>> [1] "MPI"
>>
>> $user
>>  user
>> "gabor"
>>
>> $useRscript
>> [1] TRUE
>>
>> but snow still starts a different version, the one in /usr/bin/R. Is
>> this a bug? If not, how can I tell snow to start the same version, the
>> one that is listed in defaultClusterOptions?
>>
>> Thanks,
>> Gabor
>>
>>> sessionInfo()
>>
>> R version 2.8.0 (2008-10-20)
>> x86_64-redhat-linux-gnu
>>
>> locale:
>>
>> LC_CTYPE=en_US.UTF-8;LC_NUMERIC=C;LC_TIME=en_US.UTF-8;LC_COLLATE=en_US.UTF-8;LC_MONETARY=C;LC_MESSAGES=en_US.UTF-8;LC_PAPER=en_US.UTF-8;LC_NAME=C;LC_ADDRESS=C;LC_TELEPHONE=C;LC_MEASUREMENT=en_US.UTF-8;LC_IDENTIFICATION=C
>>
>> attached base packages:
>> [1] stats     graphics  grDevices utils     datasets  methods   base
>>
>> other attached packages:
>> [1] snow_0.3-3
>>
>>
>>
>
> --
> Luke Tierney
> Chair, Statistics and Actuarial Science
> Ralph E. Wareham Professor of Mathematical Sciences
> University of Iowa                  Phone:             319-335-3386
> Department of Statistics and        Fax:               319-335-3017
>   Actuarial Science
> 241 Schaeffer Hall                  email:      luke at stat.uiowa.edu
> Iowa City, IA 52242                 WWW:  http://www.stat.uiowa.edu



-- 
Gabor Csardi <Gabor.Csardi at unil.ch>     UNIL DGM




More information about the R-help mailing list