Main Content

getCurrentJob

Get job object from a worker running a job

    Description

    example

    j = getCurrentJob returns the parallel.Job object that the current worker is associated with. Use getCurrentJob to get information from the job during a computation, such as the running duration or attached files.

    If getCurrentJob is evaluated on a worker, j is a parallel.Job object. Otherwise, j is an empty double.

    Examples

    collapse all

    Use getCurrentJob and RunningDuration property to find the running duration of the job that a worker is associated with.

    On a worker, use getCurrentJob to get the current job object j from a worker running the job j.

    j = getCurrentJob;

    Then, use the RunningDuration property to get the running duration of the job.

    howLong = j.RunningDuration;

    Output Arguments

    collapse all

    Job object, specified as a parallel.Job or empty double. When you use getCurrentJob on a worker, j is the parallel.Job object that the current worker is associated with. When you use getCurrentJob on the client, j is an empty double.

    Data Types: parallel.Job

    Version History

    Introduced before R2006a