earthlab/rslurm

The `libPaths` argument to `slurm_apply` reverses the order of libraries used

Patrick330 opened this issue · 3 comments

When you pass multiple libraries to libPaths, the slurm_run.R file generated adds each one to the beginning of .libPaths() in the order they were passed. This results in the libraries being reversed in order in .libPaths(), which means that any packages are loaded from the last library in which they are available. This causes issues for users who, for example, operate on a shared cluster where there is both a centrally-managed package library and a personal package library and would prefer to load packages from one library rather than another.

Hi Patrick,
Thanks a lot for bringing this to my attention! I've reversed the order of the arguments in the relevant lines of the template, so that multiple paths are added to .libPaths() at the end rather than the beginning. See this commit. Please confirm that this resolves your issue.
best,
Quentin

Hi Quentin,
Yes, I believe that will fix the issue. Thank you!

Patrick

Excellent, thanks again for your help. Closing the issue.