sophie-germain
sophie-germain

Reputation: 981

HPC node R installing/sourcing latest R version on HPC node

I'm trying to set up the latest version of R on my local directory using a high performance cluster so when I submit jobs, I can source the correct libraries so the allocated node will be using the latest R version.

In the HPC, my local/bin drive does have the latest version of R.

Under the instructions for job submissions and node allocation however, we are supposed to source a setup.bash script with is limited to R version 3.3.2 (not latest).

I looked at the setup.bash file and am interested in creating a local version to set up the export of R libraries so the node can be set up with the latest R version.

case $PATH in
*/usr/usc/R/3.3.2/bin*)
    ;;
*)  PATH=/usr/usc/R/3.3.2/bin:$PATH
    ;;
esac

case "${LD_LIBRARY_PATH:-}" in
 */usr/usc/R/3.3.2/lib64/R/lib*)
     ;;
  *)  LD_LIBRARY_PATH=/usr/usc/R/3.3.2/lib6/R/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
    ;;
esac

if [ -n "${MANPATH:-}" ]; then
MANPATH=/usr/usc/R/3.3.2/share/man:$MANPATH
elif [ -x /usr/bin/manpath ]; then
MANPATH=/usr/usc/R/3.3.2/bin/share/man:$(manpath)
else
MANPATH=/usr/usc/R/3.3.2/bin/share/man
fi
export LD_LIBRARY_PATH MANPATH

The setup.bsh script sets up the R binary alias to $PATH, $LD_LIBRARY_PATH, and $MANPATH.

can I mimic this on my local directory and set up a node to instead using a later version of R under HPC?

I'm not sure if this will be a problem with permissions.

I have compiled the specific R version on my local HPC directory, and will source that, but my question is if this is allowed on the HPC? ~

Upvotes: 0

Views: 224

Answers (1)

Oo.oO
Oo.oO

Reputation: 13405

After you source your setup script, simply override settings. Just make sure to

export PATH=$WHERE_YOUR_R_IS/bin:${PATH}
export LD_LIBRARY_PATH=$WHERE_YOUR_R_IS/lib:${LD_LIBRARY_PATH}

Then, simply run your R

$WHERE_YOUR_R_IS/bin/R

It should do a thing.

As for the:

"I have compiled the specific R version on my local HPC directory, and will source that, but my question is if this is allowed on the HPC? ~"

If you have access to your directory from all nodes that are part of HPC, I don't see any issues here. Why should it be forbidden? Just give it a try.

Upvotes: 2

Related Questions