SpaDES wolfAlps model on HPC (high performance computer) - snapshot.RDS permission denied

37 views
Skip to first unread message

claram...@googlemail.com

unread,
Dec 21, 2018, 10:22:20 AM12/21/18
to SpaDES Users
Hi everyone,
I am currently trying to run the SpaDES wolfAlps module on my university's HPC and I am always getting this error message:


Error in gzfile(file, mode) : cannot open the connection

> > >
> > > Calls: simInit ... Require -> installedVersionsQuick -> saveRDS -> gzfile
> > >
> > > In addition: Warning message:
> > >
> > > In gzfile(file, mode) :
> > > cannot open compressed file
> > > '/Applic.HPC/software/MPI/GCC/6.4.0-2.28/OpenMPI/2.1.2/R/3.4.4-X11-20180131/lib64/R/library/.snapshot.RDS',
> > > probable reason 'Permission denied'
> > >
> > > Execution halted

Quite possibly I have done something wrong with my paths.. but I really don't understand why it would try to write something in the libraries. A minimal example (without wolves..) where I just calculate 2+2 in R works, even loading SpaDES package works, but something seems to go wrong in the simInit call, which is the first time in the script where it really needs all the input / module paths. Do you have any idea what might be wrong? Locally, it seems to work just fine, but on the HPC it never works. Or could it be that there is something wrong with the R packages on the HPC? I would be really grateful for any tips.

I hope you will have wonderful winter / Christmas holidays,
Clara

Alex Chubaty

unread,
Dec 21, 2018, 4:42:00 PM12/21/18
to SpaDES Users
If you are going to use `Require()` then be sure to set the libPath to a directory you have access to. It's a good idea to use a project-specific directory for your packages so that you can ensure the same versions are used each time.
  1. install all required packages to a project directory (e.g., ~/Documents/myProject/packages)
  2. use `Require(listOfMyPackages, libPath = "~/Documents/myProject/packages")
Alex

claram...@googlemail.com

unread,
Jan 9, 2019, 6:19:59 AM1/9/19
to SpaDES Users
Thank you! And sorry for the late reaction, due to chirstmas break..

Do I need to have writing rights to the directory where the packages are installed? Because they are installed on the HPC system right now.

I am not using `Require()` directly, rather, in the wolfAlps.R it is 
 
defineModule(sim, list(
  name = "wolfAlps",
  description = "Movement model for wolves in the Italian Alps -- translation of the SELES model from Marucco and McIntire, 2010",
  
(...)
  reqdPkgs = list("NetLogoR", "SpaDES", "raster", "plyr", "data.table", "fpCompare", "testthat"),

(...)

And reqdPkgs uses Require (as I understand it..). I don't think there is an option to set the libPaths in reqdPkgs, or have I overlooked something?

Curiously, when I start an interactive R session on the HPC, .libPaths() shows me the correct one where all the packages that I need are installed. 

Could I just leave the require out entirely? Since the packages are already installed? uncommenting the line seems to have no effect whatsoever, unfortunately. 

Clara

Eliot McIntire

unread,
Jan 9, 2019, 9:51:32 AM1/9/19
to SpaDES Users
.libPaths is something that is set by you. You can install packages anywhere you want and it can be in multiple places. Normally the fist location in .libPaths is a place you have write access, the 2nd and possibly 3rd are places you don't normally have write access. Require will only try to install packages if you don't have them.

Try setting options("reproducible.useRequire" = FALSE)

claram...@googlemail.com

unread,
Jan 9, 2019, 10:37:23 AM1/9/19
to SpaDES Users
Thank you so much, it works now! 
Reply all
Reply to author
Forward
0 new messages