Okay. You might want to remove your code, because I do not think that there is much that we can do to help you.
Beyond suggesting that you should use strict and -w, which would allow you to notice things like:
open (INPUTFILE, ">$inputfile"); ... close(INTPUTFILE);
And that you should be using lexical file handles within your subroutines. Being IO-bound code, there is not a lot that could be done to speed this up.
I assume from your explanation that most of the CPU bound stuff is going on inside the psi3, and that is outside your remit to tune. Previously, from your mention of PDL, I thought that you were doing the complex math. All that leaves is a little relatively simple, IO-bound code that will not benefit from threading or PDL.
Probably your best bet would be to look at Parallel::ForkManager and see if that fits with you aspirations. It would allow you to start your processes, whilst managing how many run concurrently. If you think that module fits the bill, and you need help on how to use it, I'd suggest posting a new question with that in the title, as I have no experience of it.
In reply to Re^5: How to vectorize a subroutine--perhapse using PDL piddles or threads
by BrowserUk
in thread How to vectorize a subroutine--perhapse using PDL piddles or threads
by Feynman
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |