Examples
Pantarhei Examples
This section contains ready-to-run job script examples for Pantarhei covering Python, C, MPI, GPU (CUDA/CuPy/PyTorch), Jupyter notebooks, and VSCode tunneling. All source files are hosted on GitHub and can be cloned directly onto Pantarhei.
Getting the Examples
Clone the repository into your Pantarhei home directory from the login node:
git clone https://github.com/kamalcou/pantarhei-examples.git
cd pantarhei-examples
If you already have a copy and want the latest updates:
cd pantarhei-examples
git pull
Repository Structure
pantarhei-examples/
├── python/
│ ├── myscript.py
│ ├── myscript_parallel.py
│ ├── myscript_mpi4py.py
│ ├── python_serial_job.sh
│ ├── python_parallel_job.sh
│ └── python_mpi4py_job.sh
├── c/
│ ├── serial_compute.c
│ ├── mpi_compute.c
│ ├── c_serial_job.sh
│ └── mpi_c_job.sh
├── mpi/
│ ├── mpi_integrate.c
│ ├── mpi_omp_integrate.c
│ ├── mpi_reduce.py
│ ├── mpi_single_node.sh
│ ├── mpi_multi_node.sh
│ ├── mpi_omp_job.sh
│ └── mpi_python_job.sh
├── gpu/
│ ├── vector_add.cu
│ ├── matmul.cu
│ ├── cupy_example.py
│ ├── pytorch_example.py
│ ├── cuda_vector_add.sh
│ ├── cuda_matmul.sh
│ ├── cupy_job.sh
│ └── pytorch_job.sh
├── hydrology/
│ ├── generate_hydrology_data.py
│ ├── hydrology_toy_example.py
│ ├── hydrology_toy_example_mpi.py
│ ├── generate_hydrology_data.c
│ ├── hydrology_toy_c.c
│ ├── hydrology_mpi_c.c
│ ├── hydrology_toy_job.sh
│ ├── hydrology_mpi_job.sh
│ ├── hydrology_toy_c_job.sh
│ └── hydrology_mpi_c_job.sh
├── jupyter/
│ ├── jupyter_notebook.job
│ └── jupyter_notebook_gpu.job
└── vscode/
└── vscode.job
Connecting to Pantarhei
Before cloning or submitting any jobs, log in to the Pantarhei login node:
ssh username@pantarhei.ua.edu
Replace username with your Pantarhei account username.
Running an Example
Step 1 — Copy the example files to your working directory:
cp pantarhei-examples/python/* ~/my_jobs/
cd ~/my_jobs/
Step 2 — Submit the job:
sbatch python_serial_job.sh
Step 3 — Monitor the job:
squeue -u $USER
Step 4 — Check output when complete:
cat slurm-<JOBID>.out
Available Examples
Interactive Node
Request an interactive compute node on Pantarhei using salloc for testing, debugging, and exploratory work.
Pantarhei Python Job Examples
Python example job scripts for Pantarhei using Slurm
Pantarhei C Job Examples
C example job scripts for Pantarhei using Slurm
Hydrologist Python Job Examples
Hydrologic Python examples for Pantarhei, including time-series processing, watershed metrics, and MPI-enabled analysis.
Hydrologist C Job Examples
Hydrologic C examples for Pantarhei, including SCS Curve Number runoff estimation, Clark routing, baseflow separation, and an MPI-enabled parallel version.
VSCode Tunneling on Pantarhei
Run a VSCode tunnel on a Pantarhei compute node and connect from your local machine using the VS Code Remote Tunnels extension.
MPI Job Examples
MPI job examples for Pantarhei covering single-node, multi-node, and hybrid MPI+OpenMP patterns in C and Python.
GPU Job Examples
GPU job examples for Pantarhei using CUDA C and Python (CuPy, PyTorch) on the gpu and gpu-more-time partitions.
Jupyter Notebook (Normal Partition)
Run a Jupyter Lab or Jupyter Notebook server on a Pantarhei CPU compute node and connect from your local browser via SSH tunneling.
Jupyter Notebook (GPU Partition)
Run a GPU-enabled Jupyter Lab or Jupyter Notebook server on a Pantarhei GPU compute node and connect from your local browser via SSH tunneling.
Hydrologist Notebook Example (Normal Partition)
SCS Curve Number hydrologic workflow using NumPy and Matplotlib inside a Jupyter session on Pantarhei's normal CPU partition.
Hydrologist GPU Notebook Example
GPU-accelerated SCS Curve Number hydrologic workflow using CuPy inside a Jupyter session on Pantarhei's GPU partition.