[R] parallel processing with multiple directories

Rainer M Krug r.m.krug at gmail.com
Wed Apr 18 09:13:21 CEST 2012


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 17/04/12 20:06, David Schaefer wrote:
> Hello,
> 
> I would like to run some code in parallel with each cluster reading/writing to a different
> working directory.  I've tried the following code without success. The error I get is: "Error
> in setwd(x) : cannot change working directory"

1) more likely to get a response from the sig-hpc mailing list as here

2) What scheduler is the cluster using? Some use the current working directory, others change the
working directory - so check there

3) What I did in a similar situation (cluster using torque and maoi) was to use tempdir to creat
the directory in the script - might work for you or not

4) to use print(getwd()) in your script is a good idea - but you could even use

echo `pwd`

in your submit script to check

Many possibilities what is going wrong, many solutions - we need more info

Cheers,

Rainer

> 
> library(parallel) dirs <- list("out1","out2","out3")   # these directories are located within
> the current working directory temp <- 1:3 testF <- function(x) { setwd(x) 
> saveRDS(temp,"temp.drs") } mclapply(dirs, testF)
> 
> Any help would be appreciated!
> 
> --David
> 
> ********************************************* David R. Schaefer, Ph.D. Assistant Professor 
> School of Social and Family Dynamics Arizona State University www.public.asu.edu/~schaef/
> 
> ______________________________________________ R-help at r-project.org mailing list 
> https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained,
> reproducible code.


- -- 
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys.
(Germany)

Centre of Excellence for Invasion Biology
Stellenbosch University
South Africa

Tel :       +33 - (0)9 53 10 27 44
Cell:       +33 - (0)6 85 62 59 98
Fax :       +33 - (0)9 58 10 27 44

Fax (D):    +49 - (0)3 21 21 25 22 44

email:      Rainer at krugs.de

Skype:      RMkrug
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk+OaZEACgkQoYgNqgF2egpY6wCfaPNnuUIrOiHv+T6G8mnmxgIJ
4NQAn0S+vmTP06jkHVJAayBcoCNYoqav
=RqJW
-----END PGP SIGNATURE-----



More information about the R-help mailing list