function currentCluster = getCurrentCluster
%getCurrentCluster Get cluster object that submitted current task
%    myCluster = getCurrentCluster returns the cluster object that has
%    sent the task currently being evaluated by the worker session.
%
%    If the function is executed in a MATLAB session that is not a worker,
%    you get an empty result.
%
%    Example:
%    % Find the current cluster 
%    myCluster = getCurrentCluster;
%    % Get the host on which the cluster is running
%    host = myCluster.Host;
%
% See also parcluster, getCurrentWorker, getCurrentJob, getCurrentTask.

%  Copyright 2000-2020 The MathWorks, Inc.

currentCluster = getCurrentEntity('CurrentJobmanager', mfilename);
end

