Page MenuHomec4science

hpc_check
No OneTemporary

File Metadata

Created
Mon, Nov 25, 11:35

hpc_check

#!/usr/bin/perl -w
use strict;
use FindBin;
use lib "$FindBin::RealBin/../lib/blib";
use ParseAccounts;
use Slurm;
use Cwd 'abs_path';
my $accounts_file = "accounts.yaml";
my $verbose = 0;
# -----------------------------------------------------------------------------
# Command line options
#
my %opt;
sub print_usage() {
print STDERR << "EOF";
Check account definition file $accounts_file
usage: $0 [-hv]
OPTIONS
-v : verbose, print internal hash data structures
-h : this (help) message
example: $0
EOF
exit;
}
sub init()
{
use Getopt::Std;
my $opt_string = 'hv';
getopts("$opt_string", \%opt) or print_usage();
# pathname of logfile
$accounts_file = abs_path("$FindBin::RealBin/../etc/" . $accounts_file);
print_usage() if $opt{h};
print_usage() if (scalar @ARGV > 1);
$verbose = 1 if $opt{v};
}
&init();
ParseAccounts::init(Slurm::get_cluster_name(),$accounts_file);
if ($verbose) {
print "Group:accounts\n";
print "--------------\n";
ParseAccounts::print_groups();
print "Accounts\n";
print "--------\n";
ParseAccounts::print_accounts();
}

Event Timeline