NAME

NBI::Queue - NBI::Queue, to filter jobs in the queue

VERSION

version 0.8.2

SYNOPSIS

  use NBI::Queue;  

  # Create a new Queue object  
  my $queue = NBI::Queue->new(  
      -username => 'username',  
      -jobid    => 12345,  
      -queue    => 'queue_name',  
      -state    => 'PD',  
      -name     => 'job_name',  
  );  

  # Access and modify object attributes  
  $queue->username = 'new_username';  
  $queue->state    = 'R';  

  # Get the length of the queue  
  my $length = $queue->len;  

  # Get the job IDs in the queue  
  my @job_ids = $queue->ids;

DESCRIPTION

The NBI::Queue module provides a mechanism to filter and manage jobs in the SLURM queue. It allows you to create a queue object and retrieve information about the jobs based on various criteria such as username, job ID, queue name, job state, and job name. Each job is represented by a NBI::QueuedJob object, which provides access to the job attributes.

METHODS

new

  my $queue = NBI::Queue->new(%options);

Creates a new NBI::Queue object with the specified options. The options should be provided as a hash, using the following keys:

-username

Filter jobs by username.

-jobid

Filter jobs by job ID.

-queue

Filter jobs by queue name.

-state

Filter jobs by job state (e.g., PD, R, CG, CF).

-name

Filter jobs by job name.

len

  my $length = $queue->len;

Returns the length (number of jobs) in the queue.

ids

  my @job_ids = $queue->ids;

Returns an array or array reference (depending on the context) containing the job IDs in the queue.

remove

  $queue->remove($jobid);

Removes the job with the specified job ID from the queue.

AUTHOR

Andrea Telatin <proch@cpan.org>

COPYRIGHT AND LICENSE

This software is Copyright (c) 2023 by Andrea Telatin.

This is free software, licensed under:

  The MIT (X11) License