Changeset 1139 in ProjectBuilder


Ignore:
Timestamp:
Jan 7, 2011, 2:51:40 AM (13 years ago)
Author:
Bruno Cornec
Message:
  • Parallelize pb_build2v
  • Need to work on compatibility issues of pb in VE and outside, now again incompatible.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • devel/pb/bin/pb

    r1138 r1139  
    17741774        pb_rm_rf("$ENV{'PBBUILDDIR'}/$odir");
    17751775    }
     1776    unlink("$ENV{'PBDESTDIR'}/pbscript.$$") if ($cmt =~ /^V[ME]/);
     1777
    17761778    pb_log(2,"Before halt, vmexist: $vmexist, vmpid: $vmpid\n");
    17771779    if ((! $vmexist) && ($cmt =~ /^VM/)) {
     
    21962198
    21972199my ($vmexist,$vmpid) = (undef,undef);
     2200my $pm = new Parallel::ForkManager($pbparallel) if (defined $pbparallel);
    21982201
    21992202foreach my $v (@$v) {
     2203    $pm->start and next if (defined $pbparallel);
    22002204    # Prepare the script to be executed on the VM/VE
    22012205    # in $ENV{'PBDESTDIR'}/pbscript.$$
     
    22982302    ($vmexist,$vmpid) = pb_launchv($vtype,$v,0);
    22992303
     2304
    23002305    if ($vtype eq "vm") {
    23012306        # Skip that VM if it something went wrong
    2302         next if (($vmpid == 0) && ($vmexist == 0));
     2307        if (($vmpid == 0) && ($vmexist == 0)) {
     2308            $pm->finish if (defined $pbparallel);
     2309            next;
     2310        }
    23032311    } else {
    23042312        # VE
     
    23102318    pb_log(2,"Calling send2target $vtype,$v,$vmexist,$vmpid\n");
    23112319    pb_send2target(uc($vtype).$action,"$v",$vmexist,$vmpid);
     2320    $pm->finish if (defined $pbparallel);
     2321}
     2322if (defined $pbparallel) {
     2323    $pm->wait_all_children;
    23122324}
    23132325}
Note: See TracChangeset for help on using the changeset viewer.