在Anaconda环境中运行qsub [英] Running qsub with anaconda environment

查看:265
本文介绍了在Anaconda环境中运行qsub的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个程序,该程序通常在Linux的conda环境中运行,因为我使用它来管理我的库,并遵循以下说明:

I have a program that usually runs inside a conda environmet in Linux, because I use it to manage my libraries, with this instructions:

source activate my_environment
python hello_world.py

如何在与PBS兼容的高级计算机上运行 hello_world.py .说明说明了如何运行如下所示的代码 script.sh ,并使用指令 qsub 进行调用.

How can I run hello_world.py in a high computer that works with PBS. Instructions explains to run adapting the code script.sh, shown below, and calling with the instruction qsub.

# script.sh
#!/bin/sh
#PBS -S /bin/sh
#PBS -N job_example
#PBS -l select=24
#PBS -j oe
cd $PBS_O_WORKDIR
mpiexec ./programa_mpi

如何在我的anaconda环境中通过qsub运行hello_world.py?

How do I run hello_world.py with qsub using my anaconda environment?

推荐答案

在激活环境和运行脚本之前,您需要加载Python模块.

You'll need to load the Python module before activating your environment and before running your script.

module load python3

cd $PBS_O_WORKDIR
source activate my_environment

mpiexec python hello_world.py

查看您机构的有关其Python模块的文档.在我的机构中,Anaconda是Python3的环境模块,因此您可以按照我的说明加载它.

Check the documentation for your institution regarding their Python modules. At my institution, Anaconda was the environment module for Python3, so you could load it as I have shown.

这篇关于在Anaconda环境中运行qsub的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆