I am using RStudio server and snowfall. My parallel codes always give me these messages:
> sfInit(cpus = 14, parallel = TRUE)
> sfLapply(seq(along = trials), nvtPar, file)
23 Nov 2014 11:31:36 [rsession-users] ERROR svn: E070008: Can't read directory 'my-current-working-directory': Partial results are valid but processing is incomplete
; LOGGED FROM: core::Error session::modules::svn::status(const core::FilePath&, std::vector<session::modules::source_control::FileWithStatus, std::allocator<session::modules::source_control::FileWithStatus> >*) /home/ubuntu/rstudio/src/cpp/session/modules/SessionSVN.cpp:809
In my parallel function (nvtPar), I read a few files from hard drive and write a file into hard drive. All files are in the sub folder.
This server builds on a VMware virtual server with 16 cores. My working directory is nfs server and mounted as my home directory.
My RStudio server is Version 0.98.994.
This is my session information:
> sessionInfo()
R version 3.1.1 (2014-07-10)
Platform: x86_64-unknown-linux-gnu (64-bit)
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C LC_TIME=C LC_COLLATE=C LC_MONETARY=C LC_MESSAGES=C LC_PAPER=C
[8] LC_NAME=C LC_ADDRESS=C LC_TELEPHONE=C LC_MEASUREMENT=C LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] snowfall_1.84-6 snow_0.3-13 magrittr_1.0.1 XML_3.98-1.1 ncdf4_1.13 dplyr_0.3.0.9000
loaded via a namespace (and not attached):
[1] DBI_0.3.1 Rcpp_0.11.3 assertthat_0.1 lazyeval_0.1.9.9001 parallel_3.1.1 tools_3.1.1
Thanks for any suggestions. Please let me know if my question is not clear.
EDIT: As suggestions by @roman-luštrik, I added my minimum example to reproduce my question (Sorry I cannot post my whole script, but this example will produce the same error message).
trials <- seq(1, 1593)
nvtPar <- function(i, file)
{
# Generate the random string which will store in the disk
MHmakeRandomString <- function(n=1, lenght=12)
{
randomString <- c(1:n) # initialize vector
for (i in 1:n)
{
randomString[i] <- paste(sample(c(0:9, letters, LETTERS),
lenght[i], replace=TRUE),
collapse="")
}
return(randomString)
}
sim <- MHmakeRandomString(2553, round(runif(2553) * 344))
write.table(sim, file = paste0(i, '.sim'),
quote = FALSE,
row.names = FALSE,
col.names = FALSE)
# Do some calculation
Sys.sleep(0.213 * (1 + (runif(1) * 2 - 1)) * 0.4)
# Remove the temp file
file.remove(paste0(i, '.sim'))
# Do other calculaation
Sys.sleep(2.32 * (1 + (runif(1) * 2 - 1)) * 0.1)
}
library(snowfall)
sfInit(cpus = 14, parallel = TRUE)
a <- sfLapply(seq(along = trials), nvtPar, file)
sfStop()
After digging, it seems this error is related with file.remove in the parallel calculation. All errors will disappear if I comment this line:
file.remove(paste0(i, '.sim'))
BTW: I use svn for version control in the working directory.