工程学院HPC

HPC访问指令

什么是高性能计算?

工程学院(CoE)高性能计算(HPC)系统是一种计算系统 系统具有强大的多核多插座服务器,高性能存储, gpu和大量内存,通过超高速互连连接在一起 网络. Its design allows the HPC to sup港口 some of the most compute and memory 今天开发的强化课程. 而HPC集群一般是为 software that works across multiple 节点, each 节点 in the cluster is a powerful 能够满足大多数用户计算需求的机器.

CoE HPC集群是一种Linux分布式集群,具有大量节点的特点 拥有领先的英特尔处理器,通过非常高速的网络紧密集成 通信网络. A subset of the 节点 have additional memory (256 GB per 节点) 和加速器(NVIDIA P-100 gpu),使它们适合一些最苛刻的 计算任务.

  • 计算基础设施:  A total of 36 节点 of various configurations with a total of 1008 compute cores 由Intel至强E5-2660 v4(代号Broadwell)提供.0GHz, 35M Cache)处理器, 通过56gbps的高速内部网络进行通信. 该系统提供100 峰值性能的TFlop/s. 其中15个节点包含1个NVIDIA Tesla P100 12gb gpu, 1有2个NVIDIA Tesla P100 gpu. GPU子系统提供68.6 TFlop/s 总体100 TFlop/s峰值性能.
  • 记忆: 20个节点(计算节点)有128 GB的内存,16个节点(GPU和共管节点)的功能 256 GB. 系统总内存为6.7 TB.
  • SSD输入/输出: 所有GPU和共管节点都配备了固态硬盘(ssd),以实现超高性能 输入/输出(I / O).  系统SSD总容量为12.8 TB.
  • 并行文件系统: HPC有110 TB的主目录和数据存储空间,所有人都可以使用 节点通过/home和/data. 此外,高性能计算具有高吞吐量光泽并行 可用空间为0的文件系统.541 PB,可通过/scratch获得. 每组将 have a sub-directory in /data and /scratch that they can write to.

如何接入高性能计算

的 HPC can only be accessed while connected to the campus 网络, i.e., 菠菜网lol正规平台_premier WiFi,校内局域网端口,或者VPN. 如果从校外连接,你需要 首先建立VPN连接. 设置VPN的说明 and you can use your 菠菜网lol正规平台One credentials to establish a connection.

HPC systems are primarily accessed via a terminal interface and many of our users have the ability to write custom programs to run complex analysis. 在未来, we may also provide 互动 access 到高性能计算 systems though Jupyter 请注意books 或其他互动选项.

如果您从运行窗户操作系统的计算机连接,则需要下载 和安装 腻子. OSX和Linux不需要额外的软件来连接.

窗户

通过腻子连接 对coe-hpc1.sh-fyz.com.

Linux

打开终端app,输入:

ssh 菠菜网lol正规平台_ID@coe-hpc.sh-fyz.com
Or ssh 菠菜网lol正规平台_ID@coe-hpc1.sh-fyz.com 如果前面的命令通过VPN给您超时错误

请注意:

  • 系统将提示您输入密码. 输入您的菠菜网lol正规平台One密码,然后按ENTER. 当您输入密码时,终端将不会显示您的密码. HPC不存储您的 密码,也不会在本地验证您的密码. 因此,如果你被告知你的 HPC account has been created and you cannot 日志 in, double-check your password by 通过另一个通道登录到菠菜网lol正规平台One.g.,一个.sjsu.来证明你 记住正确的密码,然后再试一次.
  • 的 first time you 日志 in到高性能计算 system, you will be asked if you would like to 缓存服务器指纹. 输入yes并按ENTER.
  • 现在,您已连接到HPC登录节点. 从这里你可以编译程序,提交 作业,或请求交互节点.

请求HPC帐户/访问

的 CoE HPC is only available to be used by CoE faculty and students. 然而,只有 教师可以要求访问HPC. 需要访问研究项目的学生 或者一个班级应该要求他们的研究顾问或班级教授请求HPC访问 通过此表格,也可以在计算机工程系的网站上找到 网站在这里. Access is granted for up to 6 months for a class project, 1 year for a 或研究项目,并无限期地给予教员. 学生访问权限可以是 通过在后续学期提交额外的访问请求来更新/延长.

访问HPC资源

的 HPC system is a community resource, shared by many students and faculty in the 工程学院. 因此,它使用一个叫做SLURM的资源调度程序, 确保所有用户都能公平地使用计算资源. Slurm允许请求 交互计算和批处理模式的资源.e.,一系列命令 will be automatically executed when the resources are allocated. 

When first accessing the HPC (via ssh or putty, for example), users are 日志ged in 到同一台服务器 登录 节点. This 节点 can be used to write scripts and code, compile programs, test execution 你的小数据程序. 然而,它不应该被大规模使用 计算,因为它会对其他用户访问和的能力产生负面影响 使用高性能计算系统. Instead, users should schedule jobs to be executed by slurm in 资源可用时的批处理模式(首选) or request 互动 resources to use for executing necessary computations.

批处理作业

批处理作业是简单的Linux Bash脚本,其中包含一个或多个应该执行的命令 由Slurm执行. 脚本的顶部必须包含Slurm的说明 批调度程序,以注释的形式,它将规定的类型和数量 正在请求的资源. 下面列出了一个这样的脚本示例.

#!/bin/bash
#
# SBATCH——作业名= pl2ap
# = pl2ap-srun SBATCH——输出.日志
#
# SBATCH——ntasks = 1
= 1 # SBATCH——节点
# SBATCH——cpus-per-task = 4
# SBATCH——时间= 10
# SBATCH——mem-per-cpu = 1000
# SBATCH——邮件用户= username@sh-fyz.com
# SBATCH——邮件类型=结束
出口OMP_NUM_THREADS = 4
出口OMP_PLACES =核
出口OMP_PROC_BIND =传播
/home/david/programs/pl2ap/build/pl2ap.9 /home/david/data/WikiWords200.企业社会责任

上面的示例脚本使用以下命令执行一个名为pl2ap的多线程OpenMP程序 1个节点4核. 的 SBATCH lines tell Slurm what resources are needed (1 task, 运行在1个节点上,请求4个核心和每个核心1GB RAM,持续10分钟) 并提供运行作业的其他选项(作业名称、作业日志文件应该是什么) 透露姓名). 请注意 that the compute 节点 have a maximum time limit of 24 hours and the Gpu节点48小时. 所有节点的默认时间为4小时. 公寓节点没有 有时间限制. 的 mail-user and mail-type parameters specify that the HPC should email the user at the provided address when the job is complete (or has ended for 其他原因,e.g.,如果时间不够的话). 的 OMP_NUM_THREADS, OMP_PLACES, OMP_PROC_BIND environmental variables are used to ensure thread affinity to physical cores. 请注意 that the program and data are stored in the user’s home directory (/home/david/). 首页 directories are a parallel data resource available on the 登录 and all other 节点. You should always include full 路径s when referencing programs you execute, 它们需要的数据,以及程序应该写入的日志文件.

假设上面的脚本存储在一个名为myscript的文件中.嘘,你可以安排 通过执行:

sbatch myscript.sh

执行man sbatch获取有关批处理中可以包含的选项的详细信息 script. 更多的Slurm帮助和教程可以在以下网站找到:

互动的工作

通过指定一个伪终端,可以通过srun命令请求交互式资源 the task should execute in, which is accomplished by using the –pty flag.

Srun——ntasks 1——节点 1——cpu -per-task 4——pty /bin/bash

这就等于,

srun -n 1 -n 1 -c 4——pty /bin/bash

GPU是一种只能在支持GPU的节点(GPU和公寓分区)上使用的资源。. 它们只有在使用-gres标志请求时才可用.

Srun -p gpu——gres=gpu——pty /bin/bash

分区/队列

有几个队列或节点分区可用于提交作业. 的 compute partition contains all compute 节点 (128GB RAM, no GPU), the gpu 分区包含所有通用GPU编程能力节点(256GB RAM, NVIDIA P100) GPU). 的 公寓 partition is a special partition that contains 节点 that belong to 工程学院的研究实验室. 这些节点可以被一般人使用 用户,只要他们不被他们的所有者使用. 如果公寓节点业主 requests resources on their 节点, any currently running jobs will be preempted to 允许访问节点所有者. 注意,每个队列都有一组不同的限制 关于请求资源. 您可以在其中找到节点的当前限制和状态 通过执行sinfo命令进行分区.

分区 效果 期限 节点 状态 节点列表  
计算* up 1-00:00:00 20 闲置 c[1-20]  
gpu up 2-00:00:00 15 闲置 g[1-15]  
互动 up 8:00:00 35 闲置 c[1-20],g[1-15]  
公寓 up 无限 1 闲置 公寓1  

此外,程序挤压可用于查找有关状态的更多细节 当前在Slurm队列中的作业数量.

公寓/节点队列

公寓节点由CoE中的特定教员拥有. 但是,节点已配置完成 并以与任何其他HPC计算/gpu节点相同的方式访问. 当公寓节点 如果不是由其所有者使用,则任何用户都可以使用它,但要注意 他们的工作随时可能被取代. 当主人(或某人)在他们的 group) requests access to resources on their 公寓 节点, any jobs currently using those resources on the 节点 are alerted (via a signal) that they need to stop and 在5分钟内强制停止,以便向公寓提供资源 老板.

公寓节点应该尽可能地彼此同构,以实现潜力 并行计算工作负载以及减少创建(和维护)的负担 customized 节点 images for different types of hardware architectures. 因此,公寓 每年最多购买一次节点. 我们会给所有CoE教员发邮件 details about the current 公寓 节点 model, giving them the op港口unity to buy-in 去排队买公寓.

模块化的软件

A great deal of software for parallel and scientific computing has been pre-loaded 并且可以通过模块获得. 要查看可用模块,执行:

模块效果

and use the load command to make those modules available to your scripts.

模块加载python3
python - v

更多详情可浏览 Lmod用户指南.

通过Jupyter 请注意book进行交互数据科学

HPC配备了几个版本的Python和一些有用的库 数据挖掘,机器学习和数据科学. 此外,木星笔记本 在HPC上的每个模块化Python版本中都可用. 下面的教程 将向您展示如何在HPC上建立交互式会话并访问该会话 从您的计算机浏览器通过SSH隧道. 只提供指示 Linux. Please read the appropriate manuals or find online instructions for setting 通过腻子打开SSH隧道.

首先,解释这个过程是如何工作的. 我们将创建两个独立的SSH会话 到高性能计算. 的 first will be used to establish an 互动 HPC session. 第二个 SSH会话将打开一条隧道,并从带有ID的端口转发流量 在10000到63999之间任选一个数字. 如果这个端口已经 在使用时,您需要选择另一个端口ID. 然后我们再开一条隧道 从HPC登录节点到分配给您的HPC交互节点,使用相同的方法 港口. Finally, on the HPC 互动 节点, we will start Jupyter 请注意book and use the provided token/link to access the 请注意book session from our browser.

下面将“菠菜网lol正规平台_ID”、“PORT_ID”和“NODE_ID”替换为相应的值.

  1. 连接到HPC并请求交互式会话. 您可以自定义交互 根据任务的需要请求会话. 详细信息请参见Slurm手册. 注意 会话开始所在的交互节点的. 例如,你可能会得到一个会话 在c1或g5上. 在下面的步骤3中为NODE_ID使用此值. 离开终端窗口 打开(可以最小化).
    ssh 菠菜网lol正规平台_ID@coe-hpc.sh-fyz.com
    srun -n 1 -n 1 -c 1——pty /bin/bash
  2. 在不同的Terminal窗口(或Putty会话)中,启动到HPC的隧道,转发 港口PORT_ID.
    ssh -L PORT_ID:localhost:PORT_ID 菠菜网lol正规平台_ID@coe-hpc.sh-fyz.com
  3. 启动从HPC登录节点到HPC交互节点转发端口的隧道 . 参见步骤1中的注释.
    ssh -L PORT_ID:localhost:PORT_ID 菠菜网lol正规平台_ID@NODE_ID
  4. 在HPC交互节点上启动Jupyter 请注意book. 您可以自定义哪个版本 你想加载的Python文件(参见上面的模块部分). 执行下面的命令后,您可以 将获得一个带有令牌ID的链接,该令牌ID将允许您访问Jupyter 请注意book. 复制链接.
    模块加载python3
    jupyter notebook——no-browser——港口=PORT_ID
  5. Paste the 请注意book link from the previous step in your browser, then press ENTER. 享受!
  6. 在您的会话结束时,记得关闭Jupyter 请注意book(保存您的笔记本, 然后,在交互式节点终端窗口中,点击CTRL+C,然后输入y和ENTER), 然后关闭到HPC的两个SSH会话(在终端窗口中,键入exit,然后) 按回车键).

如何安装X版本的Y软件?

简单地说,你需要自己去做. 高性能计算已经建成并正在建设中 由计算机工程系的教员维护,我们没有 可用的时间或资源来支持帮助用户安装软件或 to modify the HPC environment when new software is needed by some faculty. 你可以 按照制作/编译的说明在主目录中安装大多数软件 该软件. Additionally, the HPC provides multiple alternatives to help you install 定制软件:

  • 很多软件都可以通过使用pip或Anaconda的Python模块安装(参见示例) 下图为Tensorflow).
  • Java程序可以从主目录结构运行.
  • 如果需要低级库,并且不能在主目录中本地编译, 可以考虑使用类似Docker的应用程序sigular,它可以在HPC上使用 模块负载奇异性. Singularity提供了构建小型/最小化的功能 containers and run those containers as single application environments. 

如何安装Tensorflow?

Tensorflow is very particular about the versions of Python and CUDA it works with. 使用没有gpu的Tensorflow是非常简单的. 执行以下命令,进行替换 你想要的Python版本.

模块加载python3
Python -m PIP安装tensorflow

如果您需要将Tensorflow与gpu一起使用,请继续阅读.

安装Tensorflow-gpu for Python 3.6

# First, install tensorflow-gpu in the correct Python installation.
-hpc1:~$ 模块加载python3/3.6.6
~$模块加载cuda/10.0
~$ python -m PIP install——user tensorflow-gpu
#现在测试tensorflow是否工作.
coe-hpc1:~$ srun -p gpu --gres=gpu -n 1 -N 1 -c 2 --pty /bin/bash
~$ 模块加载python3/3.6.6
G1:~$ module load cuda/10.0
g1: ~ ipython美元
Python 3.6.6(默认,2018年9月1日,23:40:54) 
类型的版权', '学分' or '许可证以获取更多信息
IPython 6.5.0——增强的交互式Python. 类型的?寻求帮助.在[1]中:导入tensorflow为tf
在[2]中:sess = tf.会话(config =特遣部队.ConfigProto (日志_device_placement = True))
2019-08-22 01:13:56.622426: I tensorflow/core/platform/cpu_feature_guard.答:142) CPU支持指令,这个TensorFlow二进制文件没有编译使用:AVX2 菲利普-马萨
[...]
2019-08-22 01:13:56.903809: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1640] 找到带有属性的设备0: 
name: Tesla P100-PCIE-12GB major: 6 minor: 0 memoryClockRate(GHz): 1.3285
pciBusID: 0000:03:00.0
[...]
/job:localhost/replica:0/task:0/device:GPU:0 -> device: 0, name: Tesla P100-PCIE-12GB, Pci总线id: 0000:03:00.0,计算能力:6.0

在Python 3中安装Tensorflow-gpu.7通过蟒蛇

首先,安装Anaconda(如果还没有安装). 更多详情 在Linux环境中安装Anaconda.

  1. 下载首选的Anaconda环境 下面的示例使用Python 3的Linux安装程序.7版本的蟒蛇 2019.07.
    -hpc1:~$ wget http://repo.水蟒.com/archive/水蟒3 - 2019.07-Linux-x86_64.sh
  2. Double-check the downloaded file is legit by comparing its sha256 sum with the 一个 由蟒蛇出版社出版. 的 所有包的哈希值. 的 一个 for the specific package we downloaded is at http://docs.anaconda.com/anaconda/install/hashes/水蟒3 - 2019.07-Linux-x86_64.sh-hash /. 
    的 command below should produce the same hash as on the web page.
    -hpc1:~$ sha256sum Anaconda3-2019.07-Linux-x86_64.sh
  3. 执行安装程序 
    ~$ sh Anaconda3-2019.07-Linux-x86_64.sh
  4. 安装程序提示“为了继续安装过程,请检查。 许可协议.单击Enter查看许可条款.
  5. Scroll to the bottom of the 许可证 terms and enter "Yes" to agree.
  6. 单击Enter接受默认安装位置.
  7. 安装程序提示“您是否希望安装程序通过运行Anaconda3来初始化Anaconda3” conda init?选择“是”。.
  8. 退出HPC并重新登录以激活Anaconda. 如果你在第7步选择不, 当你重新登录时,蟒蛇将不会被激活.  为了初始化水蟒, 运行' source /bin/activate ' 
    然后运行' conda init '.

现在为您的项目设置一个环境并激活它. 在以后的日志中 in到高性能计算 or a 节点, you will have to run `conda activate tf-gpu` to be able to 使用已安装的库. 另外,安装tensorflow-gpu和ippython(前身) 以jupyter笔记本为命令行)中的环境. 目前,TF 1.14日是 不能使用Python 3.7, 
在Anaconda中安装的Python版本是什么. 因此,我们必须安装TF 1.13相反.
(base) core -hpc1:~$ module load cuda/10.0
(base) coe-hpc1:~$ conda create --name tf-gpu tensorflow-gpu=1.13 ipython

如果提示,更新Anaconda.
(base) -hpc1:~$ conda update -n base -c defaults conda

测试TF-gpu是否工作. 注意TF-gpu只能在gpu/公寓节点上工作 have requested and have been granted access to the GPU resource. 它会产生错误 登录节点或计算节点.
(base) coe-hpc1:~$ srun -p gpu --gres=gpu -n 1 -N 1 -c 2 --pty /bin/bash
(base) G1:~$ module load cuda/10.0
(base) g1:~$ conda激活tf-gpu

Conda可能已经从其他Python安装中添加了一个站点包路径 (e.g., the base Python 3 installation on the system) in your list of sys路径s. If 如果发生这种情况,TF将失败并产生错误. 仔细检查系统路径列表并更正 如果有必要的话.
(tf-gpu) g1:~$ ippython
Python 3.7.4(默认,2019年8月13日,20:35:49) 
输入“版权”、“信用”或“许可”获取更多信息
IPython 7.7.0——增强的交互式Python. 类型的?寻求帮助.
在[1]中:im港口 sys
在[2]中:sys.路径 
[2]: 
[' / home /大卫/ 水蟒3 / env / tf-gpu / bin ',
“/ home /大卫/ 水蟒3 / env / tf-gpu / lib / python37.邮政”,
“/ home /大卫/ 水蟒3 / env / tf-gpu / lib / python3.7',
“/ home /大卫/ 水蟒3 / env / tf-gpu / lib / python3.7 / lib-dynload ',
'',
“/ home /大卫/.本地/ lib / python3.7 /网站”,
“/ home /大卫/ 水蟒3 / env / tf-gpu / lib / python3.7 /网站”,
“/ home /大卫/ 水蟒3 / env / tf-gpu / lib / python3.7 /网站/ IPython /扩展”,
“/ home /大卫/.ipython ']
在[3]中:sys.路径.删除(“/ home /大卫/.本地/ lib / python3.7 /网站”)
在[4]中:导入tensorflow为tf
在[5]中:sess = tf.会话(config =特遣部队.ConfigProto (日志_device_placement = True)) 
2019-08-22 10:47:10.502572: I tensorflow/core/platform/cpu_feature_guard . I.答:141) CPU支持指令,这个TensorFlow二进制文件没有编译使用:SSE4.1 SSE4.2avx avx2 fma
[...]
2019-08-22 10:47:10.667236: I tensorflow/core/common_runtime/gpu/gpu_device . ini.cc:1433] 找到带有属性的设备0: 
name: Tesla P100-PCIE-12GB major: 6 minor: 0 memoryClockRate(GHz): 1.3285
pciBusID: 0000:03:00.0
total记忆: 11.91gb free记忆: 11.66年镶条
[...]
/job:localhost/replica:0/task:0/device:XLA_GPU:0 -> device: XLA_GPU device

在Python 3中安装Tensorflow-gpu.6通过蟒蛇

If necessary, follow the steps in the `Install Tensorflow in Python 3.7通过蟒蛇 安装和初始化Anaconda的教程.

创建Python 3.6蟒蛇环境,安装tensorflow-gpu和ippython.
(base) core -hpc1:~$ module load cuda/10.0
(base):~$ conda create -n py36 python=3.6 tensorflow-gpu python

测试TF-gpu是否工作. 注意TF-gpu只能在gpu/公寓节点上工作 have requested and have been granted access to the GPU resource. 它会产生错误 登录节点或计算节点.
(base) coe-hpc1:~$ srun -p gpu --gres=gpu -n 1 -N 1 -c 2 --pty /bin/bash
(base) G1:~$ module load cuda/10.0
(base) g1:~$ conda激活py36
(py36) g1:~$ pypython
Python 3.6.9 |蟒蛇公司.|(默认,2019年7月30日,19:07:31) 
输入“版权”、“信用”或“许可”获取更多信息
IPython 7.7.0——增强的交互式Python. 类型的?寻求帮助.
在[1]中:导入tensorflow为tf
在[2]中:sess = tf.会话(config =特遣部队.ConfigProto (日志_device_placement = True)) 
2019-08-22 10:54:23.302337: I tensorflow/core/platform/cpu_feature_guard . io.答:142) CPU支持指令,这个TensorFlow二进制文件没有编译使用:AVX2 菲利普-马萨
[...]
2019-08-22 10:54:23.516445: I tensorflow/core/common_runtime/gpu/gpu_device . ini.cc:1640] 找到带有属性的设备0: 
name: Tesla P100-PCIE-12GB major: 6 minor: 0 memoryClockRate(GHz): 1.3285
pciBusID: 0000:03:00.0
[...]
/job:localhost/replica:0/task:0/device:GPU:0 -> device: 0, name: Tesla P100-PCIE-12GB, Pci总线id: 0000:03:00.0,计算能力:6.0