首页 > 其他 > 详细

在HPC的节点上使用jupyter notebook

时间:2019-12-09 11:55:54      阅读:106      评论:0      收藏:0      [点我收藏+]

投递任务,注意资源设置

#!/bin/bash
#SBATCH --nodes=1
#SBATCH --ntasks=1
#SBATCH --cpus-per-task=1
#SBATCH --mem=4G
#SBATCH --time 00:05:00
#SBATCH --job-name jupyter-notebook
#SBATCH --output jupyter-notebook-%J.log

# get tunneling info
XDG_RUNTIME_DIR=""
node=$(hostname -s)
user=$(whoami)
cluster="tigercpu"
port=8889

# print tunneling instructions jupyter-log
echo -e "
Command to create ssh tunnel:
ssh -N -f -L ${port}:${node}:${port} ${user}@${cluster}.princeton.edu

Use a Browser on your local machine to go to:
localhost:${port}  (prefix w/ https:// if using password)
"

# load modules or conda environments here
module load anaconda3

# Run Jupyter
jupyter-lab --no-browser --port=${port} --ip=${node}

  

在本地电脑映射端口

ssh -N -f -L 8889:tiger-h26c2n22:8889 <yourusername>@tigercpu.princeton.edu

 

在浏览器中打开即可使用

 

 

 

 

 

参考:

Jupyter on the Cluster

 

在HPC的节点上使用jupyter notebook

原文:https://www.cnblogs.com/leezx/p/12009741.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!