I think Hugh is right. According your job script, the jobs will
generate output files named as " ${filename}_BR.fastq". So the jobs
following the 1st job may not get the right input file as
"filename=${file%.fastq}".
You may just change the input file names as ****.${SGE_TASK_ID} and to
see if it solve the problem.
file=$(ls -1 *.fastq | tail -n +${SGE_TASK_ID}| head -1)
filename=${file%.fastq}
awk 'NR % 2 == 0{print substr($1,7,100)};NR % 2 ==1' $file >
${filename}_BR.fastq
On Wed, Sep 2, 2015 at 7:35 PM, MacMullan, Hugh
<[email protected]> wrote:
> Hi: when you submit with '-t 1-2' option, they DO run together. But not
> precisely at the same moment, so what Reuti and I said, that the second job
> might be picking up the output of the first job instead of the file you
> intended, still seems valid. If you run Reuti or my scripts with the '-t
> 1-2' option, does it work? If not, you have another problem. If so, when you
> run your script with '-t 1-2', what files get created (ls before and after
> job), and what's the output say?
>
>
>
> On Sep 2, 2015, at 6:41 PM, VG <[email protected]> wrote:
>
> Hi Reuti,
> So basically none of my above script commands runs both of them together.
> Only one finishes. But to debug the script , i use $file and $filename and
> they got printed out perfectly fine. I STILL DON'T UNDERSTAND WHAT COULD BE
> WRONG WITH MY SCRIPT?
>
> On Wed, Sep 2, 2015 at 3:55 PM, Reuti <[email protected]> wrote:
>>
>> Hi,
>>
>> Am 02.09.2015 um 19:17 schrieb VG:
>>
>> > HI everyone,
>> >
>> > I am trying to make a job array script. I have 2 files in my working
>> > directory namely abc.fastq and def.fastq
>> >
>> > I want to run one command on these 2 files(later on I will include more
>> > .fastq files) on different compute nodes. So I made this array script, but
>> > it only produces output for abc.fastq.
>> >
>> > Here is the script:
>> >
>> > #!/bin/bash
>> >
>> > file=$(ls -1 *.fastq | tail -n +
>> > ${SGE_TASK_ID}
>> > | head -1)
>> > filename=${file%.fastq}
>> > awk 'NR % 2 == 0{print substr($1,7,100)};NR % 2 ==1' $file >
>> > ${filename}_BR.fastq
>> >
>> >
>> > I submit it as qsub -cwd -j y -t 1-2 -N testjob ./script.sh
>> >
>> > But only abc.fastq file gets processed?:
>>
>> After the first run the list of files looks different and includes the
>> outputfile of the first run. I fear you ended up with an additional file abc
>> _BR_BR.fastq.
>>
>> filename=$(ls *.fastq | sed -n "1~2s/.fastq$//p" | sed -n ${SGE_TASK_ID}p)
>>
>> -- Reuti
>>
>> PS: If `ls` doesn't see a TTY, it defaults to single column output.
>>
>>
>> > What am I doing wrong here?
>> >
>> > Hope to hear sonn from you guys.
>> >
>> > Thanks
>> > _______________________________________________
>> > users mailing list
>> > [email protected]
>> > https://gridengine.org/mailman/listinfo/users
>>
>
> _______________________________________________
> users mailing list
> [email protected]
> https://gridengine.org/mailman/listinfo/users
>
>
> _______________________________________________
> users mailing list
> [email protected]
> https://gridengine.org/mailman/listinfo/users
>
--
Best,
Feng
_______________________________________________
users mailing list
[email protected]
https://gridengine.org/mailman/listinfo/users