Search code examples
perlcluster-computingsubmission

Perl runtime bug in OGS HPC cluster


I'm attempting to debug a HPC cluster.

One problem: submitting Perl scripts into a several hundred node Linux Suse cluster via Open Grid Scheduler (OGS/GE 2011.11).

This generates a runtime error for Perl scripts on the "long queue" in the cluster, but not on the "short queue".

$> qsub -cwd -q short.q ./test.pl

Output is ok

$> qsub -cwd -q long.q ./test.pl

Output error log, /var/spool/sge/comp26/job_scripts/3141815: line 2: syntax error near unexpected token my' /var/spool/sge/comp26/job_scripts/3141815: line 2:open (my $fh, '>', 'test.out');'

If I submit a shell script to the long queue it works, containing

perl ./test.pl 

Any ideas?

System: GNU bash, version 4.2.46(2), Perl v5.16.3 (yuk)

Test script

#!/usr/bin/perl
# Also tried #!/bin/perl
system("perl -v > perl.out");
open (my $fh, '>', 'test.out');
print $fh 'test';
close $fh;

Solution

  • The solution,as @bytepusher described, was

    #!/usr/bin/env perl
    

    and submission to qsub -cwd -q long.q ./test.pl was fine.