The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

NBI::QueuedJob - NBI::QueuedJob, to describe a job from the SLURM queue (squeue)

VERSION

version 0.8.2

SYNOPSIS

  use NBI::QueuedJob;  

  # Create a new QueuedJob object  
  my $job = NBI::QueuedJob->new(  
      -user   => 'username',  
      -jobid  => 12345,  
      -queue  => 'queue_name',  
      -status => 'RUNNING',  
      -name   => 'job_name',  
      -attr1  => 'value1',  
      -attr2  => 'value2',  
  );  

  # Access and modify object attributes  
  $job->username = 'new_username';  
  $job->status   = 'COMPLETED';  

  # Get attribute values  
  my $jobid  = $job->jobid;  
  my $status = $job->status;

DESCRIPTION

The NBI::QueuedJob module provides a representation of a job from the SLURM queue (squeue). It allows you to create job objects and access their attributes.

It is used by NBI::Queue to describe the jobs in the queue.

METHODS

new

  my $job = NBI::QueuedJob->new(%options);

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

-user

The username associated with the job.

-jobid

The job ID.

-queue

The name of the queue in which the job is running.

-status

The status of the job.

-name

The name of the job (pattern)

username

  $job->username = 'new_username';
  my $username = $job->username;

Accessor for the username attribute of the job.

jobid

  $job->jobid = 54321;
  my $jobid = $job->jobid;

Accessor for the jobid attribute of the job.

queue

  $job->queue = 'new_queue';
  my $queue = $job->queue;

Accessor for the queue attribute of the job.

status

  $job->status = 'COMPLETED';
  my $status = $job->status;

Accessor for the status attribute of the job.

name

  $job->name = 'new_name';
  my $name = $job->name;

Accessor for the name attribute of the job.

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