getjobs

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Auxiliary function
Introduced first in SolidGeometry 5.3, Creation date: 2023-01-09, Last change: 2025-08-19

returns the jobs running on the local cluster

Description

Can be used to test a Toolbox wirhout user interaction
VLFL_Toolbox_test(38:100)

See Also: , VLFL_Toolbox_test

Example Illustration

 missing image of getjobs

Syntax

[jobs,names]=getjobs

Output Parameter

jobs: array of jobs
names: cell list of job names

Examples


batch spindumpkill
getjobs; jobs=ans;
delete(jobs(end))
getjobs




Copyright 2023-2025 Tim C. Lueth. All rights reserved. The code is the property of Tim C. Lueth and may not be redistributed or modified without explicit written permission. This software may be used free of charge for academic research and teaching purposes only. Commercial use, redistribution, modification, or reverse engineering is strictly prohibited. Access to source code is restricted and granted only under specific agreements. For licensing inquiries or commercial use, please contact: Tim C. Lueth

Algorithm (Workflow)

This function, getjobs, retrieves and manages jobs running on the local MATLAB cluster. It is part of the SolidGeometry library and is used to test a toolbox without user interaction.

Input Parameters

The function does not take any input parameters.

Output Results

Algorithm Steps

  1. Suppress warnings related to the inability to cancel or destroy jobs on the local cluster using warning('off','parallel:cluster:LocalCannotCancelOrDestroyJob');.
  2. Create a cluster object for the local cluster with myCluster = parcluster('local');.
  3. Find and delete jobs with the state 'failed' using findJob(myCluster,'State','failed'); delete(failed);.
  4. Find and delete jobs with the state 'finished' using findJob(myCluster,'State','finished'); delete(finish);.
  5. Retrieve all jobs from the local cluster with jobs=get(myCluster,'Jobs');.
  6. Initialize an empty cell array names to store job names.
  7. Iterate over each job to retrieve its name, ID, and state:
  8. If no output arguments are specified, convert the names array to a string and print it to the command window, indicating the running local jobs.
Algorithm explaination created using ChatGPT on 2025-08-19 07:34. (Please note: No guarantee for the correctness of this explanation)

Last html export of this page out of FM database by TL: 2025-09-21