Running qsub with anaconda environment

廉价感情. 提交于 2021-02-08 15:34:40

问题


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

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

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


回答1:


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

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.



来源:https://stackoverflow.com/questions/53346159/running-qsub-with-anaconda-environment

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!