[torqueusers] submitting a job (interactively) issue

Jason bacon jwbacon at tds.net
Sat Feb 11 16:31:10 MST 2012


If I use -I on the command line, my system drops me into a shell on a 
scheduled node, which seems to be what the man page is describing.

However, if I use #PBS -I in a script, the job fails, which seems to 
contradict the man page.

Example:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#!/bin/sh

#PBS -I
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

In this case, I get the following email:

 From adm at peregrine.hpc.uwm.edu Sat Feb 11 17:18:09 2012
Date: Sat, 11 Feb 2012 17:18:09 -0600 (CST)
From: adm at peregrine.hpc.uwm.edu
To: bacon at peregrine.hpc.uwm.edu
Subject: PBS JOB 742.peregrine.hpc.uwm.edu

PBS Job Id: 742.peregrine.hpc.uwm.edu
Job Name:   hostname
Exec host:  compute-02/0
Aborted by PBS Server
Job cannot be executed
See Administrator for help

and error messages in the logs.

I haven't considered this a major issue.  Instead, I've worked around 
the issue using the following script, which waits until the job ends and 
then shows the output.  It doesn't allow interaction, but if all you 
need is to see the output when the job is done, it works fine.

#!/bin/sh

# Script:  qsubw
#          Submit a job, wait for it to complete, and show the output

if [ $# -ne 1 ]; then
     printf "Usage: $0 script\n"
     exit 1
fi

script=$1

# Strip out job name and output file options
# FIXME: This will strip out other options on the same line
egrep -v '#PBS -[Noe]' $script > $script.tmp

job_id=`qsub $script.tmp | cut -d '.' -f 1`
printf '    Job ID = %s\n' $job_id

qstat -f $job_id | fgrep exec_host

while [ `qstat | grep "^$job_id" | awk ' { print $5 }'` != 'C' ]; do
     sleep 1
done

stem=${script%.*}
for file in $stem.pbs.tmp.o$job_id $stem.pbs.tmp.e$job_id; do
     if [ -s $file ]; then
         printf "\n%s:\n" $file
         cat $file
     fi
     rm $file
done


     -J

On 2/11/12 5:01 PM, Gustavo Correa wrote:
> Hi Hakeem
>
> Not sure if I understood right the issue.
> Anyway, did the job return a shell prompt to you?
> That is what it is expected to do.
>
> > From 'man qsub':
>
> "       If the -I option is specified on the command line or in a script
>         directive, or if the "interactive" job attribute  declared  true
>         via  the  -W  option, -W interactive=true, either on the command
>         line or in a script directive, the job is  an  interactive  job.
>         The  script  will  be  processed for directives, but will not be
>         included with the job.  When the job begins execution, all input
>         to  the  job  is from the terminal session in which qsub is run-
>         ning."
>
> Only the #PBS directives in your shell script [if any] would be processed, not the commands.
>
> Have you tried to submit the job without the shell script?
>
>>> qsub –l nodes=1 –N jobName –I –v “some parameters”
>
> This should give you a shell prompt in one of the nodes.
> > From there you can 'cd' to your work directory [cd $PBS_O_WORKDIR],
> and run the shell script [./shellscript].
> All I/O is on the terminal, no stderr/stdout files are generated.
> At the end just do CTRL-D at the shell prompt to end the job.
>
> Check the details in 'man qsub'.
>
> I hope this helps,
> Gus Correa
>
> On Feb 11, 2012, at 4:32 PM, Jason bacon wrote:
>
>> I've (apparently) had the same issue, but have not found a solution yet.
>>
>> Can you provide the following:
>>
>> 1.    Operating system and version
>> 2.    Torque version
>> 3.    Relevant entries from server_logs on the submit node and mom_logs on the allocated compute node
>> 4.    Anything unusual in the system log
>>
>> When I ran into this issue, I found some errors in the logs regarding failed socket connections.  I think it might be a permissions issue, but have not had time to investigate yet.
>>
>>      -J
>>
>> On 2/9/12 3:33 PM, Hakeem Almabrazi wrote:
>>> Hi,
>>>
>>> I have tried to submit a job using the option –I and I got the message
>>>
>>> Qsub: waiting for job # to start
>>> Qsub: job # ready
>>>
>>> And that is it.
>>>
>>> If I qstat I got a message saying the job # is still “R” running …
>>>
>>> It looks like I have lack of understanding on how to use this option but here is my submit job request:
>>>
>>>> qsub –l nodes=1 –N jobName –I –v “some parameters” shellScript
>>>
>>>
>>> If I run the above request without  the –I option, it runs fine without any issue.
>>>
>>> Someone might ask the question, why I am running it “interactively”?
>>>
>>> Well, I want to force the program which issued the request to wait for the result and do something with it after that.
>>>
>>> Thank you for your help.
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> _______________________________________________
>>> torqueusers mailing list
>>>
>>> torqueusers at supercluster.org
>>> http://www.supercluster.org/mailman/listinfo/torqueusers
>> _______________________________________________
>> torqueusers mailing list
>> torqueusers at supercluster.org
>> http://www.supercluster.org/mailman/listinfo/torqueusers
> _______________________________________________
> torqueusers mailing list
> torqueusers at supercluster.org
> http://www.supercluster.org/mailman/listinfo/torqueusers



More information about the torqueusers mailing list