Main Content

getTaskSchedulerIDs

Scheduler IDs of tasks in job

Description

schedulerIDs = getTaskSchedulerIDs(job) returns the SchedulerID of each task on the job job. Note that SchedulerID applies only to third-party schedulers.

example

Examples

collapse all

Create a cluster object by using parcluster. In the code below, change MyThirdPartyScheduler to the name of the profile of your third-party scheduler.

c = parcluster('MyThirdPartyScheduler');

Create a job and create some tasks for it. Then, submit the job.

job = createJob(c);
for idx = 1:2
    createTask(job,@ode45,2,{@vdp1,[0,10],[idx,0]});
end
submit(job)

To get the scheduler IDs of the tasks on the job, use getTaskSchedulerIDs. You can use these IDs to refer to the corresponding jobs on the third-party scheduler.

getTaskSchedulerIDs(job)
ans = 1×1 cell array
    {'4933'}

In this case, the scheduler has assigned the ID 4933 to this job.

Wait for the job to finish and fetch its outputs.

wait(job);
out = fetchOutputs(job)
out=2×2 cell array
    {121×1 double}    {121×2 double}
    {129×1 double}    {129×2 double}

When you are done retrieving information from the job, delete it to clean up its data.

delete(job);
clear job

Input Arguments

collapse all

Job object that represents the job on the third-party scheduler, specified as a parallel.Job object.

Example: job = createJob(parcluster);

Data Types: parallel.Job

Output Arguments

collapse all

SchedulerID of each task on job, returned as a cell array of character vectors.

Version History

Introduced in R2019b