Commit 809b22c6 authored by Matthieu Muffato's avatar Matthieu Muffato Committed by ens-bwalts
Browse files

Added an example file

parent f248d44b
use strict;
use warnings;
# Transform a Compara resource class into a category name according to the
# memory requirement.
sub get_key_name {
my $resource_class = shift;
my $display_name = $resource_class->display_name;
my $memory_req = $display_name;
# Convert special names to the standard nomenclature
$memory_req = '250Mb_job' if $display_name eq 'default';
$memory_req = '250Mb_job' if $display_name eq 'urgent';
$memory_req = '2Gb_job' if $display_name eq 'msa';
$memory_req = '8Gb_job' if $display_name eq 'msa_himem';
# Remove stuff we don't need
$memory_req =~ s/_(job|mpi|big_tmp)//g;
$memory_req =~ s/_\d+(_hour|min|c$)//g;
# Convert to GBs
$memory_req =~ s/Gb$//;
if ($memory_req =~ /^(\d+)Mb$/) {
$memory_req = $1/1000;
} elsif ($memory_req =~ /^mem(\d+)$/) {
$memory_req = $1/1000;
if ($memory_req < 1) {
return '<1';
} elsif ($memory_req <= 4) {
return '1-4';
} elsif ($memory_req <= 8) {
return '5-8';
} elsif ($memory_req <= 16) {
return '9-16';
} elsif ($memory_req <= 32) {
return '17-32';
} elsif ($memory_req <= 128) {
return '33-128';
} else {
return 'bigmem';
=head1 LICENSE
Copyright [1999-2015] Wellcome Trust Sanger Institute and the EMBL-European Bioinformatics Institute
Copyright [2016-2020] EMBL-European Bioinformatics Institute
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
You may obtain a copy of the License at
Unless required by applicable law or agreed to in writing, software distributed under the License
is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and limitations under the License.
=head1 CONTACT
Please subscribe to the eHive mailing list: to discuss eHive-related questions or to be notified of our updates
......@@ -674,6 +674,7 @@ what should be displayed on the y-axis. Allowed values are "workers" (default),
the path to a Perl script that defines a function named "get_key_name". The function is used to provide custom key names for analyses and
resource classes instead of their own display names. The function must take the object (Analysis or ResourceClass) as a sole argument and
return a (non empty) string.
See scripts/dev/ for an example.
=item --resolution <integer>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment