www.gusucode.com > mbc 工具箱 matlab 源码程序 > mbc/@mbcfoundation/@DCTManager/createJob.m

    function [job, ok, errmsg] = createJob(manager, varargin)
%CREATEJOB Create a DCT Job.
%
%  [JOB, OK, MSG] = CREATEJOB(MANAGER) creates a DCT job using the current
%  configuration.  If the operation fails for any reason, JOB will be
%  empty, the OK status will be false and MSG will be non-empty.
%
%  [...] = CREATEJOB(MANAGER, PARAM1, VALUE1, ...) also passes on the
%  parameter-value pairs to the createJob function.
%
%  See also DISTCOMP.JOBMANAGER/CREATEJOB.

%  Copyright 2006-2012 The MathWorks, Inc. 

job = [];

[scheduler, ok, errmsg] = manager.getScheduler;
if ~ok
    return
end


try
    job = scheduler.createJob(varargin{:}{:});
catch ME
    ok = false;
    errmsg = sprintf(['An error occurred while creating the distributed ' ...
        'computing job.  The error was:\n\n%s'], ME.message);
    % If we've errored here it may be a scheduler problem that will be
    % sorted out by clearing our cached manager
    pClearScheduler(manager);
end