Hereâs an alternative to matching hostnames in lmstat output:
Â
#!/usr/bin/perl
Â
my $running_claims = qx( condor_q -constraint 'JobStatus == 2 && ! isUndefined(ConcurrencyLimits)
' -format '%v' 'split(ConcurrencyLimits, ", ")' ); Â
my @running_claims = $running_claims =~ ( m{"([^"]+)"}g );
Â
my %limit;
for (@running_claims) {
ÂÂÂ my ($name, $count) = split(':');
ÂÂÂ $count = length($count) ? $count : 1;
ÂÂÂ $limit{$name} += $count;
}
Â
for $key (keys(%limit)) {
ÂÂÂ print "${key}_condor_used = $limit{$key}\n";
}
Â
Then you can set the limit like so:
Â
App_license_lmstat_available = <pulled from lmstat>
App_license_condor_used = <pulled from condor_q above>
App_license_limit = Â$(app_license_lmstat_
available) + $(app_license_condor_used) Â
Iâm trying to remember if thereâs a mechanism in the configuration where you can say â$(value:0) and get 0 if value is undefined, rather than using an if/endif block but Iâm not finding it offhand. So whateverâs generating the config file would need to take that into account since the code above will only produce outputs for limits which are in current use..
Â
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ -Michael Pelletier.
_______________________________________________
HTCondor-users mailing list
To unsubscribe, send a message to htcondor-users-request@cs.wisc.edu with a
subject: Unsubscribe
You can also unsubscribe by visiting
https://lists.cs.wisc.edu/mailman/listinfo/htcondor- users
The archives can be found at:
https://lists.cs.wisc.edu/archive/htcondor-users/