NBI-Slurm
view release on metacpan or search on metacpan
And two classes to manage the output of the jobs:
* `NBI::Queue`, which represents the content of the SLURM queue, and
* `NBI::QueuedJob`, which represents a single job in the queue.
Features
* Easily create and configure SLURM jobs using the NBI::Job class (for the Perl enthusiasts).
* Comes with **binaries** to submit jobs, list jobs, wait for jobs, etc. (for anyone else)
## Installation
To use [NBI::Slurm](https://metacpan.org/dist/NBI-Slurm), you need Perl 5.12 or higher installed on your system.
You can install the package using CPAN or manually by copying the NBI/Slurm.pm file to your Perl library directory.
cpanm is a command line utility for installing Perl modules from CPAN.
To install cpanm, run the following command:
```bash
# If you dont have cpanm installed:
curl -L https://cpanmin.us | perl - --sudo App::cpanminus
# Install with cpanm
cpanm NBI::Slurm
```
## Library Usage
Here's a simple example demonstrating how to use NBI::Slurm to submit a job to SLURM:
```perl
use NBI::Job;
use NBI::Opts;
# Create a job
my $job = NBI::Job->new(
-name => "job-name",
-command => "ls -l",
);
# Create options
my $opts = NBI::Opts->new(
-queue => "short",
-threads => 4,
-memory => 8,
-opts => ["-m afterok:1234"],
);
# 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/).
( run in 1.592 second using v1.01-cache-2.11-cpan-5735350b133 )