3

I am running the same R file (file.R) in 12 folders simultaneously (m1, m2,... m12) using a supercomputer. The file has exactly the same name and content, the only difference is that it is contained in different folders. There's no .RData file in any of each folder. All the files call the same .RData file in another folder. Similarly for the R packages.

The file runs smoothly in all folders but in folder m2, where the output of the .Rout file is:

Error in load(name, envir = .GlobalEnv) : 
  ReadItem: unknown type 0, perhaps written by later version of R
Calls: sys.load.image -> load
Execution halted

The file starts by:

##############################################################################
##                                                                          ##
##                              -  -  -  -  -  -                            ##
##                                                                          ##
##                           S I M U L A T I O N S                          ##
############################################################################## 
require(tidyverse)
require(dplyr)
require(scales)
require(pracma)
require(foreach)
require(doSNOW)

and the .Rout file does not even print the comments and packages. It exits immediately with that error message. I don't understand why folder m2 is so exceptional. Any idea on this error?

PS: I'm sorry, I know I'm not giving you a replicable example, but I just can't replicate it. Running bsub -n 2 -q long_int -Ip -W 48:00 -R "rusage[mem=20000]" -M 20000 -hl R CMD BATCH simulation_doParallel2.R works fine.

Andrew
  • 678
  • 2
  • 9
  • 19
  • There's a lot of information missing... Is there a `.RData` (yes, that's the full name) inside `m2`? Does it help to add `--vanilla` to R's options? Does it work if you rename `m2` to something else? Does it work if you symlink (or even copy, but I understand that kind of defeats the purpose) your `.RData` into each folder? – Zé Loff Jul 30 '19 at 13:28
  • No there is no data file in `m2`. The script calls data in another folder. I haven't tried the `--vanilla` option. Yes, it works with another name. – Andrew Jul 30 '19 at 13:47
  • There is a call to `sys.load.image` being triggered before anything else is run, and this suggests that there is something inside `m2` that is being automatically loaded during R's [startup sequence](https://stat.ethz.ch/R-manual/R-devel/library/base/html/Startup.html)... An `.RData` file (usually hidden) would be the most likely culprit. – Zé Loff Jul 30 '19 at 14:02
  • I see, but there are only other .R file or .Rout files in the folder. – Andrew Jul 30 '19 at 14:59
  • 1
    @Andrew I know I'm beating a dead horse here a little, but just to be 100% sure, have you checked the hidden files? As you say this is a "supercomputer" I'll assume you're on Linux, so this would be accomplished in a terminal via `ls -a` (assuming your current terminal working directory was `m2`) – duckmayr Jul 31 '19 at 09:50
  • Maybe there are lock or empty files? [See this](https://stackoverflow.com/a/17448816/5793905). – Alexis Aug 01 '19 at 18:08
  • Yes there was an `.RData` hidden in the folder. Thank you @Andrew. I should give you the correct answer. – Andrew Aug 02 '19 at 09:37

1 Answers1

1

i think there might be an .RData on the folder where you call Rscript from... may be home

run: find /home -iname *.RData to find the file

Daniel Fischer
  • 947
  • 6
  • 8