admin管理员组文章数量:1400201
I have difficulties setting my environment variables when launching a python script using Slurm.
The following python script import petsc4py without error when launched from a shell session :
from petsc4py import PETSc
print("petsc4py imported successfully")
However when I try to run it using srun with the following sbatch script (first setting the same environment by sourcing the same python env and loading the same modules) :
#!/bin/bash
#SBATCH --job-name=petsc4py_import_test
#SBATCH --ntasks=2
#SBATCH --cpus-per-task=8
#SBATCH --time=00:30:00
#SBATCH --output=output.log
#SBATCH --error=error.log
#SBATCH --nodes=1
source $HOME/.bash_profile
module purge
module load python/3.10.0 openmpi gcc openblas/latest slurm
source $HOME/my_env/bin/activate
srun --export=ALL --mpi=pmix_v3 python3 petsc4py_test.py
It fails with :
ImportError: liblapack.so.3: cannot open shared object file: No such file or directory
srun: error: node001: tasks 0-1: Exited with exit code 1
I have difficulties setting my environment variables when launching a python script using Slurm.
The following python script import petsc4py without error when launched from a shell session :
from petsc4py import PETSc
print("petsc4py imported successfully")
However when I try to run it using srun with the following sbatch script (first setting the same environment by sourcing the same python env and loading the same modules) :
#!/bin/bash
#SBATCH --job-name=petsc4py_import_test
#SBATCH --ntasks=2
#SBATCH --cpus-per-task=8
#SBATCH --time=00:30:00
#SBATCH --output=output.log
#SBATCH --error=error.log
#SBATCH --nodes=1
source $HOME/.bash_profile
module purge
module load python/3.10.0 openmpi gcc openblas/latest slurm
source $HOME/my_env/bin/activate
srun --export=ALL --mpi=pmix_v3 python3 petsc4py_test.py
It fails with :
ImportError: liblapack.so.3: cannot open shared object file: No such file or directory
srun: error: node001: tasks 0-1: Exited with exit code 1
Share
Improve this question
edited Mar 25 at 18:25
sbrisson
asked Mar 24 at 14:47
sbrissonsbrisson
234 bronze badges
1 Answer
Reset to default 1This could be because liblapack
is available as a operating system package on the node where the shell session is run and not available on the node on which the job runs. You might have to load the lapack
module if one exists
module load python/3.10.0 openmpi gcc openblas/latest lapack/latest slurm
本文标签: Dynamic libraries not found when launching a python script using SlurmStack Overflow
版权声明:本文标题:Dynamic libraries not found when launching a python script using Slurm - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744245820a2597006.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论