---
# System prepended metadata

title: A tutorial on using the physics cluster to do calculations

---

# A tutorial on using the physics cluster to do calculations

## Connecting to the physics cluster
The machines are 
````
adrastea amalthea augustus caligula callisto cassini claudius
europa galileo ganymede io jovian jupiter marduk megadon metis
monolith parsley rosemary sage thebe thyme tiberius zenobia
````

The full name of any machine is machinename.physics.wustl.edu. For example augustus.physics.wustl.edu. augustus, tiberius, caligula and claudius are our newest machines. europa, galileo, jovian and jupiter are the oldest and will be replaced by a quad-box that we have on order.

To connect to the cluster, use the following ssh command
````
ssh username@machinename.physics.wustl.edu
````

Please login to any of the machines and run the command 
````
hpcload
````
to see the load on all the machines. You can ssh to the machine with the least load to do your calculations.

Data should be stored under the directory
````
/data/username
````

## Using python and jupyter notebook
For the python environment, we will use the `rh-python38` software collection. Load the collection with the command 
````
scl enable rh-python38 bash
````
Then python, pip etc refer to the 3.8 version.


If you are using python for the first time, you will need to install a few modules, including jupyter notebook, matplotlib, h5py, toml. Install jupyter notebook using the following command:
````
pip install notebook --user
````
You can install other python modules similarly.

**Update**: to use newer version of python, run the following command in the terminal instead:
````
eval "$(/opt/Anaconda/anaconda3/bin/conda shell.bash hook)"
````
This is the newer version of anaconda3; it has python 3.11, and packages like notebook and matplotlib are already installed.

We can use jupyter notebook in the following way. Start jupyter notebook on the physics cluster using the following command
````
jupyter notebook --no-browser --port=8887 --ip=127.0.0.1
````
Now in a terminal on your local computer, use the following ssh command
````
ssh -N -L localhost:8889:127.0.0.1:8887 username@machinename.physics.wustl.edu
````
Open a browser window and type the following
````
localhost:8889
````
You will be directed to the jupyter notebook on the physics cluster. You will need to put in the token (displayed when you launch the jupyter notebook) to access the page.

## The simulation Data

The data for the 3D Alfven wave evolution is under this directory:
````
/faculty/yyuan/data/3d_downsample
````

The data for the 2D GRMHD simulation is under this directory:
````
/faculty/yyuan/data/bhac_runs/2druns/cnorm-h0.1-beta100-bh0.1-br-0.25
````