CU Research Computing: Difference between revisions
No edit summary |
|||
| Line 30: | Line 30: | ||
=== Source the KellerLab preferences === | === Source the KellerLab preferences === | ||
This will import all of the KellerLab preferences, including changing the prompt and adding some other useful aliases. To do this add the following to the bottom of your <tt>.my.bashrc</tt> | This will import all of the KellerLab preferences, including changing the prompt and adding some other useful aliases. To do this add the following to the bottom of your <tt>.my.bashrc</tt> | ||
< | |||
<syntaxhighlight lang="bash"> | |||
. /work/KellerLab/opt/bash_profile | . /work/KellerLab/opt/bash_profile | ||
</ | </syntaxhighlight> | ||
an easy way to do that is by pasting the following into a terminal on RC | an easy way to do that is by pasting the following into a terminal on RC | ||
< | <syntaxhighlight lang="bash"> | ||
echo ". /work/KellerLab/opt/bash_profile" >> ~/.my.bashrc | echo ". /work/KellerLab/opt/bash_profile" >> ~/.my.bashrc | ||
</ | </syntaxhighlight> | ||
=== Only add the paths === | === Only add the paths === | ||
If you prefer your own command prompt and other settings, then you can just add the paths to your <tt>.my.bashrc</tt> To do that, add the following lines to the bottom of your <tt>.my.bashrc</tt> | If you prefer your own command prompt and other settings, then you can just add the paths to your <tt>.my.bashrc</tt> To do that, add the following lines to the bottom of your <tt>.my.bashrc</tt> | ||
< | <syntaxhighlight lang="bash"> | ||
PATH=${PATH}:/work/KellerLab/opt/bin | PATH=${PATH}:/work/KellerLab/opt/bin | ||
MANPATH=${MANPATH}:/work/KellerLab/opt/share/man | MANPATH=${MANPATH}:/work/KellerLab/opt/share/man | ||
export PERL5LIB=/work/KellerLab/opt/lib/perl5/ | export PERL5LIB=/work/KellerLab/opt/lib/perl5/ | ||
</ | </syntaxhighlight> | ||
== Emacs and ESS == | == Emacs and ESS == | ||
Revision as of 18:08, 29 February 2016
General documentation for using RC is [on their website]. This document will mostly cover specific instructions for using it in the Vrieze and Keller labs.
Logging in
Put these settings in your ~/.ssh/config file so you only have to enter your OTP once per session, instead of for every ssh connection you make
# These rules only apply for connections to login.rc.colorado.edu Host login.rc.colorado.edu # Setup a master ssh session the first time, and subsequent times # use the existing master connection ControlMaster auto ControlPath ~/.ssh/%r@%h:%p # X forwarding. Remove this on a Mac if you # don't want it to start X11 each time you # connect to RC ForwardX11 yes # Compress the data stream. Compression yes # Send keep alive packets to prevent disconnects from # CU wireless and behind NAT devices ServerAliveInterval 60
These settings should work from Mac and Linux. I'm not sure how to do the equivalent from Windows with Putty. On a Mac, those settings will cause X11 to start. If you don't want that to happen, then remove the ForwardX11 yes line.
KellerLab software
These instructions are for accessing the software and utilities that have been installed by the KellerLab. There are two choices.
Source the KellerLab preferences
This will import all of the KellerLab preferences, including changing the prompt and adding some other useful aliases. To do this add the following to the bottom of your .my.bashrc
. /work/KellerLab/opt/bash_profilean easy way to do that is by pasting the following into a terminal on RC
echo ". /work/KellerLab/opt/bash_profile" >> ~/.my.bashrcOnly add the paths
If you prefer your own command prompt and other settings, then you can just add the paths to your .my.bashrc To do that, add the following lines to the bottom of your .my.bashrc
PATH=${PATH}:/work/KellerLab/opt/bin
MANPATH=${MANPATH}:/work/KellerLab/opt/share/man
export PERL5LIB=/work/KellerLab/opt/lib/perl5/Emacs and ESS
ESS on RC
To add the ESS package to Emacs, add the following lines to the bottom of your .emacs file
;;getting ESS to work (load "/work/KellerLab/opt/ESS/ess-13.09-1/lisp/ess-site.el") (require 'ess-site)
ESS on your local Emacs
Running Emacs (or Aquamacs) on your local computer, but editing files and using R on RC is not difficult, but requires some setup.
Setup
First, edit your local .emacs file and add the following statement
(setq tramp-ssh-controlmaster-options
(concat
"-o ControlPath=~/.ssh/%%r@%%h:%%p "
"-o ControlMaster=auto -o ControlPersist=no"))
This will cause tramp to share the same SSH socket as your login.rc.colorado.edu SSH sessions. That way you can open files without having to re-enter your OTP.
Opening a remote file with tramp
Opening a file on a remote host with tramp is similar to opening a local file. Press ctrl-x ctrl-f and then for the remote file enter /ssh:login.rc.colorado.edu: and then enter the path to the file, for example /ssh:login.rc.colorado.edu:/work/KellerLab/myfile.R or /ssh:login.rc.colorado.edu:scripts/mystuff.R. Once a single path element (/work or ~/, for example> is entered then tab completion will work.
Activating a remote R session in ESS
Activating a remote R session is accomplished by using a shell within Emacs. It is most convenient to open a new Emacs frame with ctrl-x 5 2. Then within the new frame enter M-x shell. Then from the shell within Emacs run ssh login.rc.colorado.edu and then from that shell run ssh himem04 or ssh node0219 or whatever to get to the location where you actually want to run R.
Once you have a shell on your job node, then run R by typing R. Then run M-x ess-remote and then press enter to accept the Dialect line that is put up.
Once that is done you will be able to edit an R script in your local Emacs and submit lines to the R process on the RC job node.