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

I am running a perl script that calls multiple programs. This script itself is called by a submitted PBS script. One of the programs called by the parent perl script is parallelized (it is VASP). When I use system("PATH_to_executable > vasp.out"); within the parent script, VASP runs on a single compute node and that is painfully slow. I tried in vain to include the line system("module load impi"); just before initiating the call to VASP. I would be most grateful if any of you has ideas for me.
  • Comment on How can a perl script call a parallelized program using its system function?

Replies are listed 'Best First'.
Re: How can a perl script call a parallelized program using its system function?
by BrowserUk (Patriarch) on Feb 18, 2015 at 21:18 UTC
    I tried in vain to include the line system("module load impi"); just before initiating the call to VASP. I

    Loading the modules in a separate call to system won't help because they will not be visible to the second system call.

    Instead, doing both commands in the same system call ought to work:

    system( "module load impi && PATH_to_executable > vasp.out" );

    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority". I'm with torvalds on this
    In the absence of evidence, opinion is indistinguishable from prejudice. Agile (and TDD) debunked
Re: How can a perl script call a parallelized program using its system function?
by djerius (Beadle) on Feb 19, 2015 at 16:29 UTC
    I wrote the App::Env framework to handle situations like this. It's quite a bit more work to set up than BrowserUK's solution (which is short and to the point), but if you find yourself needing to do a lot of switching between environments, it's worth a look.