Commit f1c17c2d authored by Matthieu Muffato's avatar Matthieu Muffato Committed by ens-bwalts

Make sure this is a real LSF (or openlava) and exclude Slurm clusters that ship "lsid"

parent 5f942cd7
......@@ -54,12 +54,16 @@ our $VERSION = '3.1'; # Semantic version of the Meadow interface:
=cut
sub name {
my $mcni = 'My cluster name is';
my $re_lsf_names = qr/(IBM Spectrum LSF|Platform LSF|openlava project)/;
my $re_cluster_name = qr/^My cluster name is\s+(\S+)/;
my @lsid_out = `lsid 2>/dev/null`;
my $is_lsf = 0;
foreach my $lsid_line (@lsid_out) {
if ($lsid_line =~ /^$mcni\s+(\S+)/) {
return $1;
if ($lsid_line =~ $re_lsf_names) {
$is_lsf = 1;
} elsif ($lsid_line =~ $re_cluster_name) {
return $1 if $is_lsf;
}
}
}
......
#!/bin/bash
echo "Platform LSF"
echo 'My cluster name is test_clUster'
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