Skip to content

Demo notebook to process Drekar/Trilinos output file with Xarray

Notifications You must be signed in to change notification settings

JiaweiZhuang/process_drekar_output

Repository files navigation

Example notebook

Environment

Install Miniconda, and then:

conda env create -n ac290 -f ./environment.yaml
conda activate ac290
which ipython jupyter

Note on using Jupyter on Odyssey

Jupyter on login node

ssh [email protected] -L 8889:localhost:8889
conda activate ac290
jupyter notebook --NotebookApp.token='' --no-browser --port=8889

Visit localhost:8889 in browser.

Jupyter on compute node (with sbatch)

Make a script like:

#!/bin/bash
#SBATCH -p test
#SBATCH -N 1
#SBATCH -n 6
#SBATCH -t 1:00:00
#SBATCH --mem-per-cpu 3000
#SBATCH --job-name notebook
#SBATCH --output jupyter-address-%J.log

## get tunneling info
jupyter_port=8889  # other number also works
jupyter_ip=$(hostname -i)

## print tunneling instructions to jupyter-log-{jobid}.txt
echo -e "
    Copy/Paste this in your local terminal to ssh tunnel with remote
    -----------------------------------------------------------------
    ssh [email protected] -N -L ${jupyter_port}:${jupyter_ip}:${jupyter_port}
    -----------------------------------------------------------------

    Then open a browser on your local machine to the following address
    ------------------------------------------------------------------
    localhost:${jupyter_port}  (prefix w/ https:// if using password)
    ------------------------------------------------------------------
    "

## launch jupyter
conda activate ac290
jupyter-notebook --NotebookApp.token='' --no-browser --port=${jupyter_port} --ip=${jupyter_ip}

Follow instruction in the generated log file.

Jupyter on compute node (with srun; doesn't work)

Ref: https://informatics.fas.harvard.edu/port-forwarding-on-odyssey-nodes.html

In principle it should work, but I keep getting srun: Force Terminated job after launching notebook.

About

Demo notebook to process Drekar/Trilinos output file with Xarray

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published