Ask.Cyberinfrastructure

How to use a parameter-sweep or task array without numbering the files?

I’m trying to do a simple parameter-sweep with SGE, previously I’ve been using array jobs from SGE’s -t flag but the files I have all have different names like F15WT or R20683KY. Is there a straightforward way to use these in an array job without renaming them?

One way to do that is to make a file with one filename per line and then use something (sed in this example) to assign a line to a variable

First making the file

for name in * ; do
echo $name >> inputfilelist.txt;
done

Next
make sure you have the correct number of files
wc -l inputfilelist.txt

in the submit script with the output of wc as N

. . .
#$ -t 1-N

infile=$(sed -n -e "$SGE_TASK_ID p" inputfilelist.txt)

myscript.sh $infile