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 
<gupta567va...@gmail.com<mailto:gupta567va...@gmail.com>> 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 
<re...@staff.uni-marburg.de<mailto:re...@staff.uni-marburg.de>> 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
> users@gridengine.org<mailto:users@gridengine.org>
> https://gridengine.org/mailman/listinfo/users


_______________________________________________
users mailing list
users@gridengine.org<mailto:users@gridengine.org>
https://gridengine.org/mailman/listinfo/users
_______________________________________________
users mailing list
users@gridengine.org
https://gridengine.org/mailman/listinfo/users

Reply via email to