如何解决Python 环境和 Slurm (sbatch) 的问题
当我尝试在 SLURM HPC 集群上运行批处理作业时遇到问题。
.py 文件在我的 HPC 用户目录中运行良好。 但是,当我使用 sbatch 命令在 GPU 上运行它时,它会抛出:
slurmstepd: 错误: execve(): /var/spool/slurm/d/job401100/slurm_script: 不是目录
我的 Python 版本:
<div>{this.$scopedSlots.default?.({ myProp: "hello world" })}</div>
test.py 在 python3 上运行。
test.py 中的 Python 代码示例:
$ python -V
Python 2.7.5
$ python3 -V
Python 3.6.8
gpu.job :
import pandas as pd
import numpy as np
from sklearn.model_selection import train_test_split
from sklearn.pipeline import Pipeline
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.feature_extraction.text import TfidfTransformer
from sklearn.metrics import accuracy_score,confusion_matrix,classification_report
from sklearn.linear_model import LogisticRegression
from sklearn.svm import LinearSVC
from sklearn.naive_bayes import MultinomialNB
true = pd.read_csv("testfile.csv")
print('Just Testing. End for now.')
我知道当 slurm 执行脚本时,它会在自己的 slurm 目录和环境中执行 - 除非我特别告诉它,否则它不知道我的环境。
但是,在作业文件中包含 #!/bin/bash/
#SBATCH --job-name=testgpu # Job name
#SBATCH --output=job.%j.out # Name of output file (%j expands to jobId)
#SBATCH --cpus-per-task=4 # Schedule one core
#SBATCH --gres=gpu # Schedule a GPU
#SBATCH --time=71:59:59 # Run time (hh:mm:ss) - run for one hour max
#SBATCH --partition=red # Run on either the Red or Brown queue
#SBATCH --mail-type=END # Send an email when the job finishes
#SBATCH --export=ALL # All of the users environment will be loaded from callers environment
python3 test.py
并没有帮助。
我该如何解决这个问题?
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。