Home > Blockchain >  Script is not working with high performance computer
Script is not working with high performance computer

Time:04-15

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?

CodePudding user response:

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).

  • Related