1 # See the NOTICE file distributed with this work for additional information
2 # regarding copyright ownership.
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
8 # http://www.apache.org/licenses/LICENSE-2.0
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
19 # Transform a Compara resource class into a category name according to the
23 my $resource_class = shift;
25 my $display_name = $resource_class->display_name;
26 my $memory_req = $display_name;
28 # Convert special names to the standard nomenclature
29 $memory_req =
'250Mb_job' if $display_name eq
'default';
30 $memory_req =
'250Mb_job' if $display_name eq
'urgent';
31 $memory_req =
'2Gb_job' if $display_name eq
'msa';
32 $memory_req =
'8Gb_job' if $display_name eq
'msa_himem';
34 # Remove stuff we don't need
35 $memory_req =~ s/_(job|mpi|big_tmp)
36 $memory_req =~ s/_\d+(_hour|min|c$)
40 if ($memory_req =~ /^(\d+)Mb$/) {
41 $memory_req = $1/1000;
42 } elsif ($memory_req =~ /^mem(\d+)$/) {
43 $memory_req = $1/1000;
46 if ($memory_req < 1) {
48 } elsif ($memory_req <= 4) {
50 } elsif ($memory_req <= 8) {
52 } elsif ($memory_req <= 16) {
54 } elsif ($memory_req <= 32) {
56 } elsif ($memory_req <= 128) {
65 See the NOTICE file distributed with
this work
for additional information
66 regarding copyright ownership.
68 Licensed under the Apache License, Version 2.0 (the
"License"); you may not use
this file except in compliance with the License.
69 You may obtain a copy of the License at
73 Unless required by applicable law or agreed to in writing, software distributed under the License
74 is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
75 See the License
for the specific language governing permissions and limitations under the License.
79 Please subscribe to the eHive mailing list: http: