How can I start the MDCE in MATLAB 7.5 (R2007b) or later versions?

2 views (last 30 days)
Where can I find the documentation for starting workers using the MATLAB Distributed Computing Engine?

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 28 Nov 2019
Edited: MathWorks Support Team on 27 Nov 2019
Below is a sample M-script for starting up 4 workers on a local machine with the MATLAB Distributed Computing Engine installed.
%%This document assumes you have successfully installed the MDCE Toolbox
%%Install the MDCE
cd([matlabroot '\toolbox\distcomp\bin'] or (matlabroot '\toolbox\parallel\bin')(R2019b & later)
!mdce install
%%Start the MDCE
!mdce start
%%Start the MDCE and prepare for Distributed processing
% If you would like to see the status of the workers as they run, please
% set this to true
STATUS = true;
% Start a Job Manager
% -name the name of the Job Manager
!startjobmanager -name my_jobmanager
% Start 4 workers using the previously defined Job Manager
% -name name of the worker
% -jobmanager name of the Job Manager
% -jobmanagerhost name of the machine the manager is running on
!startworker -name worker_1 -jobmanager my_jobmanager -jobmanagerhost localhost
!startworker -name worker_2 -jobmanager my_jobmanager -jobmanagerhost localhost
!startworker -name worker_3 -jobmanager my_jobmanager -jobmanagerhost localhost
!startworker -name worker_4 -jobmanager my_jobmanager -jobmanagerhost localhost
if STATUS
% Output the status of the workers as they are running
!nodestatus
end
%%Run your code
% After the above has been started, you can run your code
% When you are done running your code execute the below cells of code
% to cleanly shut down the Workers, Job Manager and MDCE
%%Stop all the Workers, Job Manager and the MDCE
cd([matlabroot '\toolbox\distcomp\bin'])
% Stop the 4 workers previously started
!stopworker -name worker_1 -jobmanager my_jobmanager
!stopworker -name worker_2 -jobmanager my_jobmanager
!stopworker -name worker_3 -jobmanager my_jobmanager
!stopworker -name worker_4 -jobmanager my_jobmanager
% Stop the Job Manager
!stopjobmanager -name my_jobmanager
%%Stop the MDCE
!mdce stop
%%Uninstall the MDCE
!mdce uninstall

More Answers (0)

Categories

Find more on Downloads in Help Center and File Exchange

Products


Release

R2007b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!