Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

Re: PBS not finding file.

by onelesd (Pilgrim)
on Sep 27, 2011 at 19:00 UTC ( #928146=note: print w/replies, xml ) Need Help??

in reply to PBS not finding file.

There is nothing inherently wrong with your first code sample.

That said, you haven't made it clear how your "qsub script" ties into your example at all, and your error messages don't help us because they are not generated by your example code.

My (wild) guess is that you call your "simple script" but don't pass it an argument, or are not passing the correct argument, which I am guessing should be your "qsub script".

Try this:

my $infile = $ARGV[0]; die "can't read infile\n" if (! -r $infile);

Replies are listed 'Best First'.
Re^2: PBS not finding file.
by Jeri (Scribe) on Sep 27, 2011 at 19:09 UTC

    Your guess is correct! I had a hard time explaining that, yes, the argument should be passed from the qsub script, but it's not. I tried your code. It kills the script, as expected.

      Correction. The argument is not being passed from the qsub script, but should be.

        Let me use my crystal ball again... are you trying to run the "qsub script" from the first code sample and get it's output? If so, use backticks.

        my $PBS_ARRAYID = '123' ; my @output = `/usr/bin/perl /chongle/jeri/timecheck/ $PBS_ +ARRAYID > /chongle/jeri/timecheck/output.$PBS_ARRAYID.txt 2> /chongle +/jeri/timecheck/error.$PBS_ARRAYID.txt` ;

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://928146]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (6)
As of 2018-06-24 23:37 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (126 votes). Check out past polls.