Browser-Based Visualisation (Gaussian / GAMESS / ORCA / NWChem) on duhpc
An interactive 3D molecular visualisation (structures, orbitals, trajectories) run on the cluster and viewed in users web browser
Step-by-step
1. Start Jupyter on a compute node (in your master login shell)
module load viz
srun --partition=short --pty --time=04:00:00 duhpc-jupyterIt prints a block like:
Node : cn01 Port : 9139 Job : 6139
ssh -N -L 9139:cn01:9139 <you>@10.58.5.101
http://localhost:9139/lab?token=….
…followed by Jupyter’s own log, ending with a line containing your token:
http://cn01.hpc:9139/lab?token=0043fc6005dbea4fdf…
Leave this window running.
2. Open the tunnel (a NEW terminal ON YOUR PC)
Open a fresh terminal on your own computer — Windows Terminal, PowerShell, or MobaXterm’s local terminal (a shell on your laptop, not an SSH session to the cluster). Run the ssh -N -L ... line from Step 1, with your username:
ssh -N -L 9139:cn01:9139 you@10.58.5.101
Enter your cluster password. It will then sit silent — correct; leave it open.
3. Open JupyterLab in your browser
Paste into your browser’s address bar, using localhost and the token from Step 1:
http://localhost:9139/lab?token=0043fc6005dbea4fdf…
JupyterLab loads. You will see your /scratch/home/<you> files on the left.
4. Visualise (in a notebook cell in the browser)
Click Notebook → Python 3 (ipykernel). In a cell, type and press Shift+Enter:
import cclib, py3Dmol
from cclib.parser.utils import PeriodicTable
pt = PeriodicTable()
data = cclib.io.ccread('/scratch/home/YOURNAME/gaussian/myjob.log')
coords = data.atomcoords[-1] # last/optimised geometry
xyz = f"{data.natom}\n\n" + "\n".join(
f"{pt.element[z]} {x:.4f} {y:.4f} {zc:.4f}"
for z, (x, y, zc) in zip(data.atomnos, coords))
v = py3Dmol.view()
v.addModel(xyz, 'xyz')
v.setStyle({'stick': {}, 'sphere': {'scale': 0.3}})
v.zoomTo(); v.show()The cclib library reads your job output and extracts the final geometry. A rotatable 3D molecule appears in the cell (drag to rotate, scroll to zoom).
5. Finish
Close the browser tab → press Ctrl-C in the Jupyter window (Step 1) → close the tunnel terminal (Step 2). This releases your compute allocation.
Rules & etiquette
- Use the
shortpartition for interactive sessions (4-hour limit). Don’t hold acomputenode idle with a forgotten Jupyter session. - Always launch via
srun— never run Jupyter on the login node (master). - One session at a time is plenty; close it (Step 5) when done so the node is freed for others.
- Put files you want to view on
/scratch(your home) so the compute node can read them. Files under a node’s local/tmpare not visible elsewhere. - The Jupyter token is your access key — don’t share the URL with the token in it.
Trouble?
- Browser can’t connect / “site can’t be reached”: the tunnel (Step 2) isn’t running, or you used a stale port. Each session gets a new port — always use the port from the current Step 1 output.
- “Invalid credentials” / token page: copy the full token from the Step 1 output again (it changes every session).
srunwaits at “queued”: theshortpartition is busy; wait or try later.- Anything else: contact Mr. Imran Ghani on ighani[at]ducc[dot]du[dot]ac[dot]in.