cs410.net

image

Hands-On Day 1: Environment!

Login to the GIBBS compute cluster

Setup Conda Environment

Load Anaconda

Create Environment

Install Jupyter Notebook

NOT REQUIRED!

Install GIT

If git is not a valid command, do the following:

or load the module

Create and Clone Github Repository

Tmux

Connect to Compute Node!

C++ Session

Create Hello, World Example

Compile Hello, World

Python Session

Configure Jupyter Notebook

Install Matplotlib

Start Jupyter Notebook

Setup Tunnel to Gibbs

Mount repo via sshfs

Create new Python Notebook

With the tunnel from above, you can access the jupyter notebook from your local browser using http://localhost:YOUR_ASSIGNED_NUMBER. You need to copy the token value from the terminal where you run jupyter notebook on gibbs (just the part after ?token=). Then, please paste the token into the browser to login to jupyter notebook. There, you use the “New” button to create a Python 3 notebook.

Create Python Package Structure

Packages are a good way of structuring your code. In class, we learned about the Model-View-Controller (MVC) pattern and created the following folder structure. See https://slides.com/haehn/cs410_lecture10#/10 for details and code!

image

Use Autoreload Extension

In jupyter notebook, we can use the autoreload extension. This extension allows us to modify code in .py files and call the updated code in our notebook without restarting the kernel. This allows for fast developing. Warning: if function signatures change, we always need to restart the kernel!\

%load_ext autoreload
%autoreload 2