How to import a local python module when using the sbatch command in SLURM

孤者浪人 提交于 2019-12-01 08:15:29

As Slurm copies the submission script to a specific location on the compute node to run it, your Python script will not find the modules that are in the submission directory.

But Slurm correctly sets the current working directory so you can explicitly add it to the python path with something like:

sys.path.append(os.getcwd()) 

near the beginning of your script.

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