in reply to Run a script in parallel mode

The easiest way would be to split up the file and then use Parallel::ForkManager (on Unixish OSes) or threads to start multiple tasks via system. Also see runN by Dominus, which wraps this "run multiple programs through the shell" in a short script. Also see GNU parallel, which does the same.

Replies are listed 'Best First'.
Re^2: Run a script in parallel mode
by Anonymous Monk on May 26, 2015 at 18:11 UTC
    If your javaprg reads a sequence from the command line:
    cat sequences | parallel javaprg --sequence {} > output
    If your javaprg reads a sequence from standard input (STDIN):
    cat sequences | parallel --pipe -N1 javaprg > output
    If you sequences are delimited by \n> and javaprg wants 10 records per run:
    cat sequences.fasta | parallel --recstart '>' --recend '\n' --pipe -N1 +0 javaprg > output
    See also biostars.org/p/63816/