MATLAB's distributed computing toolbox is a great tool to fully utilize your multi-core processors. If you have the distributed computing toolbox installed, the setup is quite easy. The steps to start parallel processing on your localhost are given below. To use a cluster of computers through the LAN, the setup is similar.
The steps given are for Windows 7, though the steps for linux are the same.
The steps given are for Windows 7, though the steps for linux are the same.
- First open a command prompt using "Run as Administrator"
- Go to %matlabroot% directory which is usually "C:\Program Files\MATLAB\R2011a"
- Now cd to "toolbox\distcomp\bin"
- Install the mdce service using "mdce install"
- run admincenter
- Add hosts (your computer is localhost)
- start mdce service
- start jobmanager
- start workers
Now open matlab go to "Parallel" menu. Manage Configurations and create a new job manager.
In the properties, in the Jobs tab, job manager hostname should be "localhost". Job manager's name should be the name you used earlier.
In the Jobs tab, input the minimum and maximum number of workers. The number of workers should be less than the number of processors in your computer. Click OK and you are done.
Now that the distributed computing toolbox is set up you can use the "matlabpool" command and the "parfor" loop to speed up code.
If the mdce service, the jobmanager and the workers keep running, the system gets slow. Therefore, to stop the workers, in the command prompt run :
Now that the distributed computing toolbox is set up you can use the "matlabpool" command and the "parfor" loop to speed up code.
If the mdce service, the jobmanager and the workers keep running, the system gets slow. Therefore, to stop the workers, in the command prompt run :
%matlabroot%\toolbox\distcomp\bin\admincenterNow stop the workers and the job manager. To stop the mdce service use the command :
mdce stopNote that you must have the mdce service, the job manager and the workers running to be able to use matlabpool effectively.
Helpful, will implement on my PC...
ReplyDelete