add a "parallel2" property that defaults to the parallel value
chrome is taking so long to build, I want to experiment with giving it more cores...
This commit is contained in:
parent
26b2419ccf
commit
0cd41bc4d8
@ -1,5 +1,5 @@
|
||||
# ex:ts=8 sw=4:
|
||||
# $OpenBSD: Core.pm,v 1.87 2018/07/09 20:49:22 espie Exp $
|
||||
# $OpenBSD: Core.pm,v 1.88 2018/09/06 11:31:30 espie Exp $
|
||||
#
|
||||
# Copyright (c) 2010-2013 Marc Espie <espie@openbsd.org>
|
||||
#
|
||||
@ -147,12 +147,6 @@ sub memory
|
||||
return $self->prop->{memory};
|
||||
}
|
||||
|
||||
sub parallel
|
||||
{
|
||||
my $self = shift;
|
||||
return $self->prop->{parallel};
|
||||
}
|
||||
|
||||
sub hostname
|
||||
{
|
||||
my $self = shift;
|
||||
|
@ -1,5 +1,5 @@
|
||||
# ex:ts=8 sw=4:
|
||||
# $OpenBSD: Init.pm,v 1.32 2018/09/05 10:31:55 sthen Exp $
|
||||
# $OpenBSD: Init.pm,v 1.33 2018/09/06 11:31:30 espie Exp $
|
||||
#
|
||||
# Copyright (c) 2010-2013 Marc Espie <espie@openbsd.org>
|
||||
#
|
||||
@ -32,15 +32,29 @@ sub finalize
|
||||
{
|
||||
my ($self, $core) = @_;
|
||||
my $fh = $self->{fh};
|
||||
my $prop = $core->prop;
|
||||
if ($core->{status} == 0) {
|
||||
my $line = <$fh>;
|
||||
chomp $line;
|
||||
if ($line =~ m/^\d+$/) {
|
||||
$core->prop->{jobs} = $line;
|
||||
$prop->{jobs} = $line;
|
||||
}
|
||||
}
|
||||
close($fh);
|
||||
$core->prop->{jobs} //= 1;
|
||||
$prop->{jobs} //= 1;
|
||||
$prop->{parallel2} //= $prop->parallel;
|
||||
for my $p (qw(parallel parallel2)) {
|
||||
if ($prop->{$p} =~ m/^\/(\d+)$/) {
|
||||
if ($prop->{jobs} == 1) {
|
||||
$prop->{$p} = 0;
|
||||
} else {
|
||||
$prop->{$p} = int($prop->{jobs}/$1);
|
||||
if ($prop->{$p} < 2) {
|
||||
$prop->{$p} = 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
# ex:ts=8 sw=4:
|
||||
# $OpenBSD: Port.pm,v 1.182 2018/07/23 13:24:47 espie Exp $
|
||||
# $OpenBSD: Port.pm,v 1.183 2018/09/06 11:31:30 espie Exp $
|
||||
#
|
||||
# Copyright (c) 2010-2013 Marc Espie <espie@openbsd.org>
|
||||
#
|
||||
@ -1123,21 +1123,13 @@ sub new
|
||||
my $job = $class->SUPER::new(@_);
|
||||
|
||||
my $prop = $core->prop;
|
||||
if ($prop->{parallel} =~ m/^\/(\d+)$/) {
|
||||
if ($prop->{jobs} == 1) {
|
||||
$prop->{parallel} = 0;
|
||||
} else {
|
||||
$prop->{parallel} = int($prop->{jobs}/$1);
|
||||
if ($prop->{parallel} < 2) {
|
||||
$prop->{parallel} = 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
# note that lonesome *and* parallel can be specified
|
||||
if ($v->{info}->has_property('lonesome')) {
|
||||
$job->{lonesome} = 1;
|
||||
}
|
||||
if ($prop->{parallel} && $v->{info}->has_property('parallel')) {
|
||||
if ($prop->{parallel2} && $v->{info}->has_property('parallel2')) {
|
||||
$job->{parallel} = $prop->{parallel2};
|
||||
} elsif ($prop->{parallel} && $v->{info}->has_property('parallel')) {
|
||||
$job->{parallel} = $prop->{parallel};
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user