Coding Resources

Here we provide a brief summary of useful coding resources across multiple languages.

Visual Studio Code

Visual Studio Code is a powerful code editing suite that is maintained by Microsoft, but is available on Windows, Mac, and Linux.

Here we will provide the basic setup for VS Code and then provide a list of modules that are useful for scientific computing.

To install Visual Studio Code, go to https://code.visualstudio.com and follow the getting started page.

Once you have the basic program installed we reccomend installing the following extensions.

Visual Studio Code Extensions

Many of the coding languages and features of those languages are not by default provided in VS Code. Instead you need to add extensions that fit your needs. Many of these extensions will imediately be reccomended to you upon opening a file that may be aided by that extension, but the list below are some reccomended extensions to start with.

To add extensions either:

  • In VS Code find the extension menue (in the activity bar, usually on the left of the screen), four blocks with the top right removed, and search for the desired extension there. We reccomend this method.

  • Follow https://marketplace.visualstudio.com/VSCode and log in to your Microsoft account. Then search for the extension you want. Once you have added your extensions you will need to log into your Microsoft account in VS Code and let the extensions download. You may need to restart VS Code after the installations.

Many of these extensions will be downloaded together, but we include all of the information for completness. As an example, adding the Python Extension (ms-python.python) will automatically add Pylance and the Python Debugger.

C/C++

If you will be working with C/C++, these extensions provide language support, IntelliSense, and debugging capabilities.

Name: C/C++
Id: ms-vscode.cpptools
Description: C/C++ IntelliSense, debugging, and code browsing.
Version: 1.20.5
Publisher: Microsoft
Name: C/C++ Extension Pack
Id: ms-vscode.cpptools-extension-pack
Description: Popular extensions for C++ development in Visual Studio Code.
Version: 1.3.0
Publisher: Microsoft
Name: C/C++ Themes
Id: ms-vscode.cpptools-themes
Description: UI Themes for C/C++ extension.
Version: 2.0.0
Publisher: Microsoft

H5Web

If you will be using data that is stored as a HDF5 format, we reccomend the H5Web extension for basic data visualization. This extension will allow you to look at the structure of the data as well as visualize the data in a limited manner.

Name: H5Web
Id: h5web.vscode-h5web
Description: Visualize HDF5 files in VS Code
Version: 0.1.5
Publisher: H5Web

Jupyter

If you will be using Jupyter for accessing remote computers or basic python notebooking we reccomned the following extensions.

Name: Jupyter
Id: ms-toolsai.jupyter
Description: Jupyter notebook support, interactive programming and computing that supports Intellisense, debugging and more.
Version: 2024.4.0
Publisher: Microsoft
Name: Jupyter Cell Tags
Id: ms-toolsai.vscode-jupyter-cell-tags
Description: Jupyter Cell Tags support for VS Code
Version: 0.1.9
Publisher: Microsoft
Name: Jupyter Keymap
Id: ms-toolsai.jupyter-keymap
Description: Jupyter keymaps for notebooks
Version: 1.1.2
Publisher: Microsoft
Name: Jupyter Notebook Renderers
Id: ms-toolsai.jupyter-renderers
Description: Renderers for Jupyter Notebooks (with plotly, vega, gif, png, svg, jpeg and other such outputs)
Version: 1.0.17
Publisher: Microsoft
Name: Jupyter Slide Show
Id: ms-toolsai.vscode-jupyter-slideshow
Description: Jupyter Slide Show support for VS Code
Version: 0.1.6
Publisher: Microsoft

Modern Fortran

If you will be working with Fortran, this extensions provide language support, IntelliSense, and debugging capabilities.

Name: Modern Fortran
Id: fortran-lang.linter-gfortran
Description: Fortran language support, syntax highlighting, Language Server support, Debugging, Diagnostics and much more.
Version: 3.2.0
Publisher: The Fortran Programming Language

Python

If you will be working with Python, these extensions provide language support, IntelliSense, and debugging capabilities.

Name: Python
Id: ms-python.python
Description: Python language support with extension access points for IntelliSense (Pylance), Debugging (Python Debugger), linting, formatting, refactoring, unit tests, and more.
Version: 2024.6.0
Publisher: Microsoft
Name: Pylance
Id: ms-python.vscode-pylance
Description: A performant, feature-rich language server for Python in VS Code
Version: 2024.5.1
Publisher: Microsoft
Name: Python Debugger
Id: ms-python.debugpy
Description: Python Debugger extension using debugpy.
Version: 2024.6.0
Publisher: Microsoft

Remote SSH

If you want to access remote computers via VS Code you will need the following extensions.

Name: Remote - SSH
Id: ms-vscode-remote.remote-ssh
Description: Open any folder on a remote machine using SSH and take advantage of VS Code’s full feature set.
Version: 0.110.1
Publisher: Microsoft
Name: Remote - SSH: Editing Configuration Files
Id: ms-vscode-remote.remote-ssh-edit
Description: Edit SSH configuration files
Version: 0.86.0
Publisher: Microsoft
Name: Remote Explorer
Id: ms-vscode.remote-explorer
Description: View remote machines for SSH and Tunnels.
Version: 0.4.3
Publisher: Microsoft

Remote Access in VS Code with SSH

By usig VS Code to access a remote site you maintain all of the usual command line functions of SSH, but with an added directory explorer and all of the features of a code editor suite.

Once you have installed Remote - SSH, a new icon will appear in the activity bar (usually to the left of the screen), a monitor with a small circle in the bottom right corner, called Remote Explorer.

Opening this menue will present a(n) (empty) menue with two drop down menues, REMOTES (TUNNELS/SSH) and HELP AND FEEDBACK.

Open the REMOTES menue and you will be presented with >SSH.

To the right of this there is a gear and a +.

Clicking the + and you should be presented with an empty grey bar at the top of the screen that says

Press ‘Enter’ to confirm your inpt or ‘Escape/ to cancel.

Connect to cassowary as described here.

and hit enter. This will produce a new option under SSH called ‘cassowary2.device.utk.edu’ with an arrow and a new window icon to the right.

Open a new window with the new window option or just open the connection with the arrow. You will be pnow have a (new) instance of VS Code running that is connected to cassowary. From here VS Code runs exactly the same.

Once you open a folder under the Explorer menue in the activity bar, this folder will automatically become a target for the Remote Explorer and it will add a folder under the relaveant SSH Host drop down menue.

If you are connecting to a host that is password protected, you will have an additional input at the top center of the screen asking for this password.

This is of primary use when connecting to hosts at the Oak Ridge National Laboratory’s Leadership Computing Facility (OLCF) or the National Energy Research Scientific Computing Center (NERSC).

Name

Site

Home

user@home.ccs.ornl.gov

Data Transfer Node

user@dtn.ccs.ornl.gov

Summit

user@summit.olcf.ornl.gov

Andes

user@andes.olcf.ornl.gov

Frontier

user@frontier.olcf.ornl.gov

Python

Julia

Matlab

Mathematica

Fortan

C++