karthik167 has asked for the wisdom of the Perl Monks concerning the following question:

Hi,

I have written some perl scripts which I would like to run as a PBS scheduled job on an HPC cluster. The perl script uses an additional module which we installed from CPAN on the head node. Hence the script works fine on head node directly but I am not be able to run it as PBS job since the requisites are not installed in all the compute nodes.

Is there a work around for us to run such job, without installing the add-on module on all the compute nodes?

Please let me know. Thanks.

Regards, Karthik

  • Comment on Perl with Custom Modules via PBS on HPC cluster

Replies are listed 'Best First'.
Re: Perl with Custom Modules via PBS on HPC cluster
by Athanasius (Archbishop) on Oct 26, 2013 at 03:57 UTC

    Hello karthik167, and welcome to the Monastery!

    Say your perl scripts reside in the directory /foo/bar/scripts. Create a new directory, for example /foo/bar/scripts/inc, and simply copy the additional module (.pm file) into it, along with any dependencies not already installed on the target nodes. Then add the following to the head of each script:

    use lib '/foo/bar/scripts/inc';

    and use the additional module in the normal way. (See lib.) This should provide an acceptable workaround.

    Hope that helps,

    Athanasius <°(((><contra mundum Iustus alius egestas vitae, eros Piratica,

      Thanks. It worked great.