NBI-Slurm

 view release on metacpan or  search on metacpan

README.md  view on Meta::CPAN

# Set options for the job
$job->set_opts($opts);

# Submit the job to SLURM
my $jobid = $job->run;
```

For more detailed information on the available methods and options, please refer to the individual documentation of the NBI::Job and NBI::Opts classes.

Automatic tests check the functionality of the classes and methods even when Slurm is not available. From the cluster where NBI::Slurm
will be used, it's possible to run `prove -lv xt/hpc-*.t` to test the ability to submit jobs (but some tests might fail for busy partitions, drain, etc).

## Author

[NBI::Slurm](https://metacpan.org/dist/NBI-Slurm) is written by [Andrea Telatin](https://telatin.github.io)

## License

This module is released under the [MIT License](https://mit-license.org/).

bin/slurm-load  view on Meta::CPAN


    return \@rows;
}

sub load_pct {
    my ($row) = @_;
    my $total = $row->{total} || 0;
    my $down  = $row->{down} || 0;
    my $up    = $total - $down;
    return 0 if $up <= 0;
    my $busy = ($row->{mix} || 0) + ($row->{alloc} || 0);
    return ($busy / $up) * 100;
}

sub normalise_node_state {
    my ($state) = @_;
    $state = lc($state // '');
    $state =~ s/[^a-z].*$//;

    return 'idle'  if $state =~ /^idle/;
    return 'mix'   if $state =~ /^mix/;
    return 'alloc' if $state =~ /^alloc/;



( run in 3.116 seconds using v1.01-cache-2.11-cpan-5837b0d9d2c )