脚本不使用高性能计算机

发布于 2025-01-21 04:22:34 字数 1703 浏览 6 评论 0原文

我正在使用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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

乱了心跳 2025-01-28 04:22:34

消息错误显示在此脚本中:/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 command python3. You can modify it to python, or create a softlink of the real executable python and name it as python3 (and add it to your PATH environment variable).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文