summaryrefslogtreecommitdiff
path: root/environment
diff options
context:
space:
mode:
authorChris Dyer <cdyer@cs.cmu.edu>2011-11-11 14:13:26 -0500
committerChris Dyer <cdyer@cs.cmu.edu>2011-11-11 14:13:26 -0500
commitcb762a9c0e50e4e49b688dcc3f52498191efb20a (patch)
treef9dfe9e899e0262106b41b14028ec9d8a1d22e29 /environment
parent5c019bda38cb19e09cb16c5eefa6793d920015eb (diff)
new improved distributed operation for PRO, MERT
Diffstat (limited to 'environment')
-rw-r--r--environment/LocalConfig.pm43
1 files changed, 33 insertions, 10 deletions
diff --git a/environment/LocalConfig.pm b/environment/LocalConfig.pm
index 4e5e0d5f..831a3a43 100644
--- a/environment/LocalConfig.pm
+++ b/environment/LocalConfig.pm
@@ -4,7 +4,7 @@ use strict;
use warnings;
use base 'Exporter';
-our @EXPORT = qw( qsub_args mert_memory environment_name );
+our @EXPORT = qw( qsub_args mert_memory environment_name env_default_jobs has_qsub );
use Net::Domain qw(hostname hostfqdn hostdomain domainname);
@@ -14,47 +14,62 @@ my $host = domainname;
my $CCONFIG = {
'StarCluster' => {
'HOST_REGEXP' => qr/compute-\d+\.internal$/,
+ 'JobControl' => 'qsub',
'QSubMemFlag' => '-l mem',
+ 'DefaultJobs' => 20,
},
'LTICluster' => {
'HOST_REGEXP' => qr/^cluster\d+\.lti\.cs\.cmu\.edu$/,
+ 'JobControl' => 'qsub',
'QSubMemFlag' => '-l h_vmem=',
'QSubExtraFlags' => '-l walltime=0:45:00',
+ 'DefaultJobs' => 15,
#'QSubQueue' => '-q long',
},
'UMIACS' => {
'HOST_REGEXP' => qr/^d.*\.umiacs\.umd\.edu$/,
+ 'JobControl' => 'qsub',
'QSubMemFlag' => '-l pmem=',
'QSubQueue' => '-q batch',
'QSubExtraFlags' => '-l walltime=144:00:00',
+ 'DefaultJobs' => 15,
},
'CLSP' => {
'HOST_REGEXP' => qr/\.clsp\.jhu\.edu$/,
+ 'JobControl' => 'qsub',
'QSubMemFlag' => '-l mem_free=',
'MERTMem' => '9G',
+ 'DefaultJobs' => 15,
},
'Valhalla' => {
'HOST_REGEXP' => qr/^(thor|tyr)\.inf\.ed\.ac\.uk$/,
+ 'JobControl' => 'fork',
+ 'DefaultJobs' => 8,
},
'Blacklight' => {
'HOST_REGEXP' => qr/^(tg-login1.blacklight.psc.teragrid.org|blacklight.psc.edu|bl1.psc.teragrid.org|bl0.psc.teragrid.org)$/,
- 'QSubMemFlag' => '-l pmem=',
+ 'JobControl' => 'fork',
+ 'DefaultJobs' => 32,
},
'Barrow/Chicago' => {
'HOST_REGEXP' => qr/^(barrow|chicago).lti.cs.cmu.edu$/,
- 'QSubMemFlag' => '-l pmem=',
+ 'JobControl' => 'fork',
+ 'DefaultJobs' => 8,
},
'OxfordDeathSnakes' => {
'HOST_REGEXP' => qr/^(taipan|tiger).cs.ox.ac.uk$/,
- 'QSubMemFlag' => '-l pmem=',
+ 'JobControl' => 'fork',
+ 'DefaultJobs' => 12,
},
- 'LOCAL' => {
- 'HOST_REGEXP' => qr/local\./,
+ 'LOCAL' => { # LOCAL must be last in the list!!!
+ 'HOST_REGEXP' => qr//,
'QSubMemFlag' => ' ',
+ 'JobControl' => 'fork',
+ 'DefaultJobs' => 2,
},
};
-our $senvironment_name;
+our $senvironment_name = 'LOCAL';
for my $config_key (keys %$CCONFIG) {
my $re = $CCONFIG->{$config_key}->{'HOST_REGEXP'};
die "Can't find HOST_REGEXP for $config_key" unless $re;
@@ -63,15 +78,23 @@ for my $config_key (keys %$CCONFIG) {
}
}
-die "NO ENVIRONMENT INFO FOR HOST: $host\nPLEASE EDIT LocalConfig.pm\n" unless $senvironment_name;
-
our %CONFIG = %{$CCONFIG->{$senvironment_name}};
-print STDERR "**Environment: $senvironment_name\n";
+print STDERR "**Environment: $senvironment_name";
+print STDERR " (has qsub)" if has_qsub();
+print STDERR "\n";
+
+sub has_qsub {
+ return ($CONFIG{'JobControl'} eq 'qsub');
+}
sub environment_name {
return $senvironment_name;
}
+sub env_default_jobs {
+ return 1 * $CONFIG{'DefaultJobs'};
+}
+
sub qsub_args {
my $mem = shift @_;
die "qsub_args requires a memory amount as a parameter, e.g. 4G" unless $mem;