Looking for a "get started guide"

Please do not copy paste, some special characters might be inserted.

qsub -- /bin/sleep 100
qsub -- /bin/hostname 
qstat -answ1

after qsub there is space and two hypens and space and application and argument

Have a nice day ! Nice one

Trying to run a test hello world python script on the pbsserver
Got the command from https://www.altair.com/pdfs/pbsworks/PBSUserGuide19.2.3.pdf


Please try this

image

Nothing like pbs.sh exists? Should I create it?

Hmm, trying to wrap my head around how these commands work :smiley:

It seems there is no default queue or queue created;

as root:
qmgr -c “create queue workq queue_type=e, started=t, enabled=t”
qmgr -c “set server default_queue=workq”

as pbsdata user :
qsub – /bin/sleep 1000
qsub -q workq – /bin/sleep 1000
qstat -answ1

This looks like a breakthrough! :smiley:

But not too sure what I’m looking at here.
Two jobs - 13 & 14 - perhaps some others were started before?
Are these jobs doing something in particular or?

Say I wanted to run my hello.python script which does a print. How could I do that?

Getting closer :slight_smile:
image

Are these jobs just waiting in the queue now right? If I wanted them to run?

as there is no node added to run your jobs, hence the jobs were in the queued state. 13 and 14 are queued jobs, that are running sleep commands for 1000 seconds.

As root user:
qmgr -c "create node pbsserver "

To list nodes;
pbsnodes -aSJ
pbsnodes -av

If you want to run your python script:

qsub yourpython.script

You can get the command help on the Linux by executing:

man qstat
man sleep
man qsub
man pbsnodes

Sorry , it seems looking at this thread , i am all over the place. Thank you for your patience.

  1. There is no pbs.sh script that exists on the system, it is the name of the script that needs to be created by the user. It can have any name and extension, but it should be made executable by running chmod +x pbs.sh

  2. You can get help on all the commands that exists on the system
    User and admin commands are present in : /opt/pbs/bin
    You can use man to get an explanation and q to quit the man page

  3. qsub is the command to submit jobs

  4. qstat is the command to know the status of the jobs

  5. Steps to submit a bash script

[pbsdata@pbsserver ~]$ cat pbs.sh
#PBS -N testjob
hostname
echo "########################"
env
echo "####################### "
/bin/sleep 100
echo " Done "

[pbsdata@pbsserver ~]$ chmod + pbs.sh
[pbsdata@pbsserver ~]$

[pbsdata@pbsserver ~]$ qsub pbs.sh
526.pbsserver

[pbsdata@pbsserver ~]$ qstat -answ1

pbsserver:
                                                                                                   Req'd  Req'd   Elap
Job ID                         Username        Queue           Jobname         SessID   NDS  TSK   Memory Time  S Time
------------------------------ --------------- --------------- --------------- -------- ---- ----- ------ ----- - -----
526.pbsserver               pbsdata         workq           testjob           195279    1     1    --    --  R 00:00:00 pbsserver/0
   Job run at Wed Apr 22 at 18:36 on (pbsserver:ncpus=1)
   
   
[pbsdata@pbsserver ~]$ qstat
[pbsdata@pbsserver ~]$

[pbsdata@pbsserver ~]$ ls *526*
testjob.e526  testjob.o526

[pbsdata@pbsserver ~]$ cat testjob.o526 | more
pbsserver
########################
MANPATH=:/opt/pbs/share/man
HOSTNAME=pbsserver
HW_DISABLE_GL_COMPATIBILITY_CHECK=1
SHELL=/bin/bash
HISTSIZE=1000
PBS_JOBNAME=testjob
TMPDIR=/var/tmp/pbs.526.pbsserver
PBS_ENVIRONMENT=PBS_BATCH
PBS_O_WORKDIR=/home/pbsdata
NCPUS=1
QT_GRAPHICSSYSTEM_CHECKED=1
USER=pbsdata
PBS_TASKNUM=1
LD_LIBRARY_PATH=/opt/Mesa-9.2.2/
  1. steps to submit python script
[pbsdata@pbsserver ~]$ cat pbs.py
#!/bin/python
print "This is my first python pbs  job"
print "hello world"

[pbsdata@pbsserver ~]$ chmod +x pbs.py

[pbsdata@pbsserver ~]$ ls -ltr pbs.py
-rwxrwxr-x 1 pbsdata pbsdata 76 Apr 22 18:43 pbs.py

[pbsdata@pbsserver ~]$ qsub pbs.py
530.pbsserver

[pbsdata@pbsserver ~]$ qstat
[pbsdata@pbsserver ~]$ qstat -xH | grep 530
530.uklm-pbstes pbsdata  workq    pbs.py     205791   1   1    --    --  F 00:00


[pbsdata@pbsserver ~]$ ls -ltr *530*

-rw------- 1 pbsdata pbsdata  0 Apr 22 18:47 pbs.py.e530
-rw------- 1 pbsdata pbsdata 45 Apr 22 18:47 pbs.py.o530

[pbsdata@pbsserver ~]$ cat pbs.py.o530
This is my first python pbs  job
hello world
  1. Another way to submit the python script without the python shebang line
[pbsdata@pbsserver ~]$ cat pbs.py
print "This is my first python pbs  job"
print "hello world"

[pbsdata@pbsserver ~]$ chmod +x pbs.py

[pbsdata@pbsserver ~]$ ls -ltr pbs.py
-rwxrwxr-x 1 pbsdata pbsdata 61 Apr 22 18:49 pbs.py

[pbsdata@pbsserver ~]$ qsub -S /opt/pbs/bin/pbs_python pbs.py
532.pbsserver

[pbsdata@pbsserver ~]$ qstat
[pbsdata@pbsserver ~]$ qstat -xH | grep 532
532.uklm-pbstes pbsdata  workq    pbs.py     208954   1   1    --    --  F 00:00

[pbsdata@pbsserver ~]$ ls *532*
pbs.py.e532  pbs.py.o532

[pbsdata@pbsserver ~]$ cat pbs.py.o532
This is my first python pbs  job
hello world

Note : The above jobs are very short jobs, so you do not see their status in the qstat command as they get executed quickly. All jobs by default create standard out and standard error file ( .o and .e ).
Sleep job ( qsub – /bin/sleep 1000 ; qstat -answ1 ) would show you the job status , as it remains on the system as job for 1000 seconds.

I hope this is clear to you.