[torqueusers] help with unwanted concurrency in a torque script

Dan Kortschak dan.kortschak at adelaide.edu.au
Tue Dec 8 20:01:40 MST 2009


OK. I've had a chance to test all this. The relevant output from
Gareth's queries indicate it's not in a terminal while the csh run
scripts are.

The locks didn't work to prevent the problem so I guess the expect route
is the way to go. Can anyone suggest a good tutorial for expect - I've
had a look around and it leaves me confused (I've neveer used expect
before).

Thanks for everyone's help with this.

cheers
Dan 

On Tue, 2009-12-08 at 09:25 -0500, Kevin Van Workum wrote:

>         
>         > -----Original Message-----
>         > From: Dan Kortschak [mailto:dan.kortschak at adelaide.edu.au]
>         > Sent: Tuesday, 8 December 2009 12:26 PM
>         > To: Joshua Bernstein
>         > Cc: torqueusers at supercluster.org
>         > Subject: Re: [torqueusers] help with unwanted concurrency in
>         a torque
>         > script
>         >
>         > Hi Josh,
>         >
>         > I haven't run them in bash, but since all the pbs directives
>         are
>         > comments in csh, it can be run as a standard csh batch
>         script. In this
>         > case it performs exactly as expected.
>         >
>         > As far as confusion between different runs goes, that's
>         unlikely since
>         > (there are parts of the script that I've left off for
>         simplicity, but
>         > don't affect this issue) the last command is a set of DELETE
>         FROM
>         > statements - there is nothing left in the database between
>         runs.
>         >
>         > The other interesting thing is that while the running it as
>         a csh script
>         > works from the command line, running it as a csh script from
>         a torque
>         > script breaks the same way as having the commands within the
>         torque
>         > script - I haven't tried using perl as the glue to see if
>         somehow it can
>         > be bound into a single glob.
>         >
>         > My suspicion is that somehow postgresql's non-completion
>         before the
>         > completion of each command is ignored when run in the torque
>         context,
>         > but not in any other context. But I don't have any thing
>         except my
>         > limited observations to base this on.
>         >
>         > I've had a look at the -W switch, and it's unfortunately not
>         going to do
>         > the job for me here.
>         >
>         > cheers
>         > Dan
>         
>         
>         We had someone with what seemed a similar problem with
>         sqlite.  That turned out to be a programming/scripting error -
>         there was no flush to the database in the script, but there
>         was an implicit flush when one ran the same commands in an
>         interactive session.  Strange but true.  Might be related to
>         having a terminal (or not) in the environment
>         
>         Cheers,
>         
>         Gareth
> 
> I agree with Gareth, the issues seems to be related to (not) having a
> terminal. I had once a very similar issue with mysql. Try writing an
> Expect script to run your commands. This will fool the postgresql
> processes into thinking you're running it from an interactive session
> and give you the expected (*pun*) exit behaviors. 
> 
> Kevin





More information about the torqueusers mailing list