Pbs script completes but gives no output

after installed openpbs, i want to check whether it is installed successfully with the following script

#PBS -S /bin/bash
#PBS -N job1
#PBS -l nodes=1:ppn=8

export PATH=$PBS_O_PATH
sleep 100
pwd > hello.txt

this job can be submitted successfully to the queue, as showed by qstat

[node01@node01 test2]$ qstat -a

node01:
Req’d Req’d Elap
Job ID Username Queue Jobname SessID NDS TSK Memory Time S Time


23.node01 node01 batch job1 16676 1 8 – 01:00:00 C

but my problem is it seems that
pwd>hello.txt
did not work as there is no hello.txt file generated.

Meanwhile, job1.e23 and job1.o23 are generated but both of these two files are empty. This really puzzles me, so i come here for some help. Thanks!

ps: below is the screen output of qstat -f jobid

Job Id: 23.node01
Job_Name = job1
Job_Owner = node01@node01
resources_used.cput = 00:00:00
resources_used.energy_used = 0
resources_used.mem = 2924kb
resources_used.vmem = 338868kb
resources_used.walltime = 00:01:41
job_state = C
queue = batch
server = node01
Checkpoint = u
ctime = Mon Dec 27 16:38:01 2021
Error_Path = node01:/home/node1/test2/job1.e23
exec_host = node01/0-7
Hold_Types = n
Join_Path = n
Keep_Files = n
Mail_Points = a
mtime = Mon Dec 27 16:39:42 2021
Output_Path = node01:/home/node1/test2/job1.o23
Priority = 0
qtime = Mon Dec 27 16:38:01 2021
Rerunable = True
Resource_List.nodes = 1:ppn=8
Resource_List.nodect = 1
Resource_List.walltime = 01:00:00
session_id = 16676
Shell_Path_List = /bin/bash
Variable_List = PBS_O_QUEUE=batch,PBS_O_HOME=/home/node1,
PBS_O_LOGNAME=node01,
PBS_O_PATH=/opt/intel/oneapi/clck/2021.1-beta10/bin/intel64:/opt/inte
l/oneapi/intelpython/latest/bin:/opt/intel/oneapi/intelpython/latest/c
ondabin:/opt/intel/oneapi/mpi/2021.1-beta10/libfabric/bin:/opt/intel/o
neapi/mpi/2021.1-beta10/bin:/opt/intel/oneapi/dpcpp-ct/2021.1.1/bin:/o
pt/intel/oneapi/vtune/2021.1.1/bin64:/opt/intel/oneapi/mkl/latest/bin/
intel64:/opt/intel/oneapi/compiler/2021.1-beta10/linux/lib/oclfpga/llv
m/aocl-bin:/opt/intel/oneapi/compiler/2021.1-beta10/linux/lib/oclfpga/
bin:/opt/intel/oneapi/compiler/2021.1-beta10/linux/bin/intel64:/opt/in
tel/oneapi/compiler/2021.1-beta10/linux/bin:/opt/intel/oneapi/compiler
/2021.1-beta10/linux/ioc/bin:/opt/intel/oneapi/dev-utilities/2021.1-be
ta10/bin:/usr/local/torque/bin:/usr/local/torque/sbin:/usr/local/bin:/
usr/bin:/usr/local/sbin:/usr/sbin:/Programs/Torque/bin:/Programs/Torqu
e/sbin:/home/node1/.local/bin:/home/node1/bin,
PBS_O_MAIL=/var/spool/mail/node01,PBS_O_SHELL=/bin/bash,
PBS_O_LANG=en_US.UTF-8,PBS_O_WORKDIR=/home/node1/test2,
PBS_O_HOST=node01,PBS_O_SERVER=node01
euser = node01
egroup = node1
queue_type = E
comment = Job started on Mon Dec 27 at 16:38
etime = Mon Dec 27 16:38:01 2021
exit_status = 0
submit_args = job1
start_time = Mon Dec 27 16:38:01 2021
start_count = 1
fault_tolerant = False
comp_time = Mon Dec 27 16:39:42 2021
job_radix = 0
total_runtime = 100.249841
submit_host = node01
init_work_dir = /home/node1/test2

Did you check for hello.txt in your $HOME directory? A PBS job starts in $HOME. You can put a

cd $PBS_O_WORKDIR

in your script to change to the directory where the job was submitted.

1 Like

Thanks mate! It works.