in reply to Re^2: Parallel running the process
in thread Parallel running the process
It doesn't have to be hard. I was thinking that if that approach worked for you, that you could write a simple script to do the overhead for you. Something like (untested):
#!/usr/bin/perl use strict; use warnings; use autodie; my $num_jobs=4; # Split the work up open my $IFH, '<', 'data.inp'; my @OFH; open $OFH[$_-1], '>', "data.$_" for 1 .. $num_jobs; my $cnt=0; while (<$IFH>) { ++$cnt; my $FH = $OFH[$cnt%$num_jobs]; print $FH, $_; } close $OFH[$_-1] for 1 .. $num_jobs; # Do the work for my $j (1 .. $num_jobs) { `perl orig_do_job --infile=data.$_ --outfile=data.out.$_ & `; } # Collect the results `cat data.out.* >data.out`;
...roboticus
When your only tool is a hammer, all problems look like your thumb.
|
|---|