New User Setup

From LTX Wiki
Jump to: navigation, search

User Accounts

Unix

Necessary for logging into Portal. Contact the Help Desk. We should update this with details.

Wiki

In order to gain editing rights on the LTX-β wiki, send an email to the current LTX project wiki administrator requesting wiki membership. Standard wiki usernames are first initial of given name + full surname (e.g. "Phughes"), but please specify if another username is preferred.

Network Locations

On a Windows system, network locations can be added as pointer directories by right-clicking in "This PC" and selecting "Add a network location" from the context menu. The following network location addresses will be useful:

  • "\\pppl.gov\files"
  • "\\samba\<*>" where <*> is your username
  • "\\samba\projects\ltxdata"

NoMachine

For most purposes we will ssh into sunfire with the command ssh -Y <username>@portal for LTX-related work. The linux shell is C Shell. The initialization config file .cshrc is run at login, and should have certain lines of code to establish important paths, install standard modules, etc.

NoMachine can be acquired by asking the Help Desk to add it to your Software Center. It should show up in the Software Center interface's (on a win10 machine, Start Menu>>Microsoft System Center>>Software Center) "Available" tab for installation.

To set up a NoMachine connection to the PPPL cluster...

  1. At the "Recent Connections" page, make a New connection (center of the toolbar)
  2. Select NX protocol (default); Continue
  3. Enter nx.pppl.gov in the "Host" field and enter 4000 in the "Port" field (default)
  4. Uncheck "Use USP communication" checkbox; Continue
  5. Select the "Password" radio button (default); Continue
  6. Select the "Don't use a proxy" radio button (default); Continue
  7. Enter the connection name you want in the "Name" field, e.g. "PPPL Cluster"; the connection setup is Done

Linux (e.g. Portal)

Linux Prompt

Linux prompts are highly configurable with a command in the .cshrc or equivalent startup shell script. Some of the important options in tcshell (on Portal) include:

  •  %n - username (e.g. "phughes")
  •  %m - hostname (e.g. "sunfire04")
  •  %~ - current working directory with full path
  •  %c - current working directory only (in /u/phughes/python, returns only "python")
  •  %C<x> - where <x> is an integer returns the working directory and <x>-1 prior directories
  •  %p - timestamp (e.g. "11:02:46am")

For example:

  • set prompt='[%n@%m %C2] '

while in /u/phughes/python/toytree gives a prompt that looks like:

  • phughes@sunfire04 python/toytree

More customization options can be found here, and elsewhere online.

Matlab

To ensure access to the proper modules, the following should be copied into a shell script (e.g. startmatlab.sh) in your user directory:

  • #!/bin/tcsh
  • module load nstx/mdsplus
  • module load matlab/r2013a_princeton
  • matlab

This script can then be executed to start matlab, i.e. typing "startmatlab.sh" rather than "matlab" at the command line.

Python MDSplus

Running on Portal

As of March 18th 2021, the following lines should be included in the .cshrc script (assuming your shell on portal is tcsh) in your user directory:
module load anaconda3
setenv toytree_path 'lithos.pppl.gov:8000::/usr/local/ltx/toytree/'
setenv ltx_b_path 'lithos.pppl.gov:8000::'
setenv ltx_cameras_path 'lithos.pppl.gov:8000::'
setenv ltx_nbi_path 'lithos.pppl.gov:8000::'

Due to changes made in the CentOS7 update, there is no longer a standard python environment, and users are required to construct their own virtual environments. General instructions are available at this CIT page. The method recommended by the help desk is the Anaconda setup, which requires the following commands entered at the command line:

conda create --prefix [path] python=3.7
conda init tcsh (assuming your shell on portal is tcsh)
conda activate [path]
conda install [package]
conda deactivate

The first command creates a directory for the virtual environment at [path], e.g. ~/python/virtual_env. The second sets up the basic installation of the virtual environment, optimized to run smoothly in the selected shell; it may be necessary to restart the shell (e.g. open a new terminal in NoMachine) before the new virtual environment can be used. The third command enters the virtual environment. The fourth installs the package named in place of [package], e.g. conda install matplotlib. The fifth is only necessary when leaving the virtual environment.

Many packages exist, but some of the most commonly used include matplotlib and scipy (which together should include pylab).

Running MDSplus requires a specialized command, because the standard anaconda repositories do not have the MDSplus module and a specific repository must be specified. Instead of the fourth command above, use the following:

conda install MDSplus --channel conda-forge

Whenever installing new modules, it is wise to enter the python command line and try to import those modules to verify that the installation went smoothly.

It is currently best to run scripts by specifying the loaded python environment (e.g. python scriptname.py) rather than the executable ./ form with a shebang at the head of the script. The executable form currently appears prone to hanging the terminal if the header is incorrectly formulated, so it's best to simply avoid using it.

For python users, the following files can be downloaded and/or used freely on Portal to make MDSplus access easier:

NB: The MDSplus build at PPPL is still in a state of flux, so this procedure may change with little or no notice, and some components of the system may break intermittently.

Running Remotely

Windows

"Remotely" in this sense means from another machine, e.g. a PPPL-provided personal computer. This requires a local (on your computer) installation of MDSplus:

  1. Install the Java Runtime Environment (JRE).
  2. Install MDSplus.

You may need to add your MDSplus directory (on Windows, typically something like C:\Program Files\MDSplus\mdsobjects\python) to your python path list (e.g. in the "Tools" menu in Spyder) and/or run setup.py install in your MDSplus directory.

Linux (Ubuntu/Debian)

  • Installation
    • MDSplus can be installed using instructions at MDSplus for Linux. The usual location of download is "/usr/local/mdsplus"
  • MDSplus + Python
    • Python is usually installed on linux systems. This can be quickly checked by running the following commands
    • which python
    • python --version
    • The first command should give you python home directory and the second should give you the version (v 3.6 preferable). More information on python installation can be found at Ubuntu/Debian python installation.
    • Once Python and dependencies are installed, start any pyhton kernel (popular options are 'Jupyter QTConsole' and 'Spyder'; which can be found at QTConsole Installation and Spyder installation ) and run the following commands in the console in the following order (look at this Python-MDSplus-Remote example at In [1] , In [2] and Out [2])i
    • import sys
    • sys.path
    • The output of sys.path should list a bunch of directories; these are the locations where python searches for packages when you type in import <Module_Name> command. The MDSplus python module is most likely at "/usr/local/mdsplus/mdsobjects/python" if this is not one of the outputs of sys.path, you will need to link it to python. Do the following in the order listed
      • Make a shortcut of "/usr/local/mdsplus/mdsobjects/python" in your home folder and give it a name of your choice (in the example listed above, the folder's name is 'pmds')
      • Open a terminal and run the following command
      • sudo gedit .bashrc
      • The command should open a text editor with your copy of .bashrc, append the following line at the end of the file
      • export PYTHONPATH=$PYTHONPATH:$home/home/<username>/<shortcut folder's name>
      • save and close. In the terminal execute the .bashrc file with the following command
      • source ~/.bashrc
    • Close and restart your python kernel and run 'import sys' and 'sys.path' again. This time you should see the path listed. The rest of the steps of importing and reading data are listed in the example file (look at In [6] and In [23])

Linux VPN Configuration (Ubuntu/Debian)

Unless the user is on PPPL internal network (pppl-wpa or a wired connection), a VPN connection must be established to access ~/ltxdata or sign into no machine etc. The instructions for VPN access can be found here (Linux 64 bit VPN Instructions); Option 3 is recommended.

  • The instructions to mount a network drive can be found here. ~/ltxdata can be accessed by running the following command in the terminal as root; where /mnt is the local location of the mount.
  • mount.cifs ''samba.pppl.gov/projects/ltxdata /mnt -o user=<pppl user id>,workgroup=PPPL,pass=<pppl password>

Connecting to Hypnotoad

Hypnotoad is a standalone PC (contact Drew Elliott for physical access) that can be remotely accessed to for Solidworks and CAD. To access, first connect to the VPN (unless you are onsite and on PPPL network). From Windows, open the Remote Desktop Connection wizard and enter the following credentials
Computer: ltx-hypnotoad/pppl.gov
User name: ltxuser
click save and connect, this should open a window to Hypnotaod with a password prompt (contact any LTX staff for the password).

Adobe Acrobat Reader Signatures

Adobe Acrobat Reader has an issue where certain default settings cause it to crash when trying to digitally sign a document. In order to avoid this problem:

  1. In the menu bar, go to Edit >> Preferences
  2. Go to the General tab, and uncheck "Show online storage when saving files" (8th checkbox)
  3. Go to the Signatures tab, and click the "More" button in the Creation & Appearance section
  4. Uncheck "Use modern user interface for signing and Digital ID configuration" (last checkbox)