脚本不使用高性能计算机
我正在使用Tinaroo(昆士兰州大学的一台高性能计算机),
我构建了一个Demo Python代码(Demo1.py),该代码简单创建了一个具有执行代码时间的文件。
import datetime
StartTime = datetime.datetime.now().strftime("%Y%m%d%H%M%S")
print("Start : " + StartTime)
out = "Hello This working at " + StartTime
text_file = open("Result_" + "_" + StartTime , "w")
n = text_file.write(out)
text_file.close()
我测试了它,现在正常工作
,现在我想将其作为PBS作业发送到服务器。
我构建了此PBS文件(SimpleDemo.pbs),
#!/bin/bash
#PBS -j oe
#PBS -m ae
#PBS -N SimpleDemo
#PBS -o out.log
#PBS -e out.log
#PBS -l walltime=01:00:00
#PBS -l select=1:ncpus=1:mem=4GB
shopt -s expand_aliases
source /etc/profile.d/modules.sh
cd ${PBS_O_WORKDIR}
module load python3
python3 demo1.py
但它没有执行Python代码,并且我得到了此out.log
文件
########################### Execution Started #############################
JobId:731935.tinmgr2
UserName:asmgx
GroupName:qj
ExecutionHost:tn327a
###############################################################################
/var/spool/pbs/mom_priv/jobs/731935.tinmgr2.SC: line 14: python3: command not found
########################### Job Execution History #############################
JobId:731935.tinmgr2
UserName:asmgx
GroupName:qj
JobName:SimpleDemo
SessionId:27100
ResourcesRequested:mem=4gb,ncpus=1,place=free,walltime=01:00:00
ResourcesUsed:cpupercent=100,cput=00:00:05,mem=0kb,ncpus=1,vmem=0kb,walltime=00:00:05
QueueUsed:General
AccountString:qj
ExitStatus:127
###############################################################################
,并且显然会遇到此错误:
python3: command not found
是否有人知道如何解决此问题?
I am using Tinaroo (a high-performance computer in University of Queensland)
I built a demo python code (demo1.py), simple that creates a file that has the time of the execution of the code.
import datetime
StartTime = datetime.datetime.now().strftime("%Y%m%d%H%M%S")
print("Start : " + StartTime)
out = "Hello This working at " + StartTime
text_file = open("Result_" + "_" + StartTime , "w")
n = text_file.write(out)
text_file.close()
I tested it, works fine
Now I want to send it as a PBS JOB to the server.
I built this PBS file (simpledemo.pbs)
#!/bin/bash
#PBS -j oe
#PBS -m ae
#PBS -N SimpleDemo
#PBS -o out.log
#PBS -e out.log
#PBS -l walltime=01:00:00
#PBS -l select=1:ncpus=1:mem=4GB
shopt -s expand_aliases
source /etc/profile.d/modules.sh
cd ${PBS_O_WORKDIR}
module load python3
python3 demo1.py
But it does not execute the python code and I get this out.log
file
########################### Execution Started #############################
JobId:731935.tinmgr2
UserName:asmgx
GroupName:qj
ExecutionHost:tn327a
###############################################################################
/var/spool/pbs/mom_priv/jobs/731935.tinmgr2.SC: line 14: python3: command not found
########################### Job Execution History #############################
JobId:731935.tinmgr2
UserName:asmgx
GroupName:qj
JobName:SimpleDemo
SessionId:27100
ResourcesRequested:mem=4gb,ncpus=1,place=free,walltime=01:00:00
ResourcesUsed:cpupercent=100,cput=00:00:05,mem=0kb,ncpus=1,vmem=0kb,walltime=00:00:05
QueueUsed:General
AccountString:qj
ExitStatus:127
###############################################################################
And it is clearly getting this error:
python3: command not found
Does anyone have an idea how to resolve this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
消息错误显示在此脚本中:
/var/spool/pbs/mom_priv/jobs/731935.tinmgr2.sc
,它找不到命令python3
。您可以将其修改为python
,或创建真实可执行文件python
的软链接,并将其命名为python3
(并将其添加到您的路径环境变量)。
Message error shows that in this script:
/var/spool/pbs/mom_priv/jobs/731935.tinmgr2.SC
, it cannot find commandpython3
. You can modify it topython
, or create a softlink of the real executablepython
and name it aspython3
(and add it to yourPATH
environment variable).