Here is a simple example in bash:
/usr/local/sbin# cat torque_submit_filter.sh
while read i
if [[ $i =~ "^#PBS -l nodes=[0-9]" ]]
/var/spool/pbs# cat torque.cfg
This works with cream but not with the lcg-ce.
So lets try again but this time in perl:
/usr/local/sbin# cat torque_submit_filter.pl
# Echo all other input
# By default just copy the line.
my $line = $_;
if ($line =~ m/^#PBS -l nodes=[0-9]/)
$line = $line . ":SL5\n";
Now this works with both cream and lcg-ce! Obviously you can do whatever takes your fancy to the qsub input and make it more intelligent.
A word of warning. We used the same queues for both CE's which meant that SL4 and SL5 resources were indistinguishable to users unless they used OS specific CE requirements. We ended flooded on the SL4 queues, with lots of free slots on the SL5 queues. So in the end we have created a new set of queues for the SL4 CE. Hopefully this will be explicit enough for users to target the correct CE.