Main Content

getCurrentJob

Get job object from a worker running a job

    Description

    example

    j= getCurrentJobreturns theparallel.Jobobject that the current worker is associated with. UsegetCurrentJobto get information from the job during a computation, such as the running duration or attached files.

    IfgetCurrentJobis evaluated on a worker,jis aparallel.Jobobject. Otherwise,jis an empty double.

    Examples

    collapse all

    UsegetCurrentJobandRunningDurationproperty to find the running duration of the job that a worker is associated with.

    On a worker, usegetCurrentJobto get the current job objectjfrom a worker running the jobj.

    j = getCurrentJob;

    Then, use theRunningDurationproperty to get the running duration of the job.

    howLong = j.RunningDuration;

    Output Arguments

    collapse all

    Job object, specified as aparallel.Job或空的两倍。当你使用getCurrentJobon a worker,jis theparallel.Jobobject that the current worker is associated with. When you usegetCurrentJobon the client,jis an empty double.

    Data Types:parallel.Job

    Version History

    Introduced before R2006a