Attention

This project is still in an early phase of development.

The python API is not yet stable, and some aspects of the schema for the blueprint and workplan will likely evolve. Therefore whilst you are welcome to try out using the package, we cannot yet guarantee backwards compatibility. We expect to reach a more stable version in 2026.

PBSJob#

class cstar.execution.scheduler_job.PBSJob(scheduler: Scheduler, commands: str, account_key: str, cpus: int, nodes: int | None = None, cpus_per_node: int | None = None, script_path: str | Path | None = None, run_path: str | Path | None = None, job_name: str | None = None, output_file: str | Path | None = None, queue_name: str | None = None, send_email: bool | None = True, walltime: str | None = None, depends_on: Iterable[str] = ())#

Bases: SchedulerJob

Represents a job submitted to the PBS (Portable Batch System) scheduler.

This class extends SchedulerJob to handle PBS-specific functionality for job submission, status retrieval, and script generation.

scheduler#

The PBS scheduler managing this job.

Type:

PBSScheduler

commands#

The commands to execute within the job script.

Type:

str

account_key#

The account key associated with the job for resource tracking.

Type:

str

cpus#

The total number of CPUs required for the job.

Type:

int

nodes#

The number of nodes to request. If not provided and a specific nodes x CPUs distribution is required, C-Star will attempt to calculate an appropriate number of nodes.

Type:

int or None

cpus_per_node#

The number of CPUs per node to request. If not provided and a specific nodes x CPUs distribution is required, C-Star will attempt to calculate an appropriate number of CPUs per node.

Type:

int or None

script_path#

The file path where the job script will be saved.

Type:

Path

run_path#

The directory where the job will be executed.

Type:

Path

job_name#

The name of the job.

Type:

str

output_file#

The file path for job output.

Type:

Path

queue_name#

The name of the PBS queue to which the job will be submitted.

Type:

str

walltime#

The maximum walltime for the job, in the format “HH:MM:SS”.

Type:

str

id#

The unique job ID assigned by the PBS scheduler. None if the job has not been submitted.

Type:

int or None

status#

The current status of the job, retrieved from PBS.

Type:

ExecutionStatus

script#

The PBS-specific job script, including directives and commands.

Type:

str

submit()#

Submit the job to the PBS scheduler.

cancel()#

Cancel the job using the PBS qdel command.

Methods

PBSJob.cancel()

Cancel the job in the PBS scheduler.

PBSJob.save_script()

Save the job script to a file.

PBSJob.submit()

Submit the job to the PBS scheduler.

PBSJob.updates([seconds])

Stream live updates from the task's output file.

Attributes

PBSJob.account_key

The account key associated with the job for resource tracking.

PBSJob.commands

The commands to execute within the job script.

PBSJob.cpus

The total number of CPUs required for the job.

PBSJob.cpus_per_node

The number of CPUs per node to request.

PBSJob.id

Retrieve the unique job ID assigned by the scheduler.

PBSJob.job_name

The name of the job.

PBSJob.log

Return the logger instance for this class.

PBSJob.nodes

The number of nodes to request.

PBSJob.output_file

The file in which to write this job's STDOUT and STDERR.

PBSJob.queue

The queue to which the job will be submitted.

PBSJob.queue_name

The name of the queue to which the job will be submitted.

PBSJob.scheduler

The scheduler managing this job (e.g., a SlurmScheduler or PBSScheduler instance)

PBSJob.script

Generate the PBS-specific job script to be submitted to the scheduler.

PBSJob.status

Retrieve the current status of the job from the PBS scheduler.

PBSJob.walltime

SS`.