| Parallel Computing Toolbox™ | ![]() |
pmode start
pmode start numlabs
pmode start conf numlabs
pmode quit
pmode exit
pmode client2lab clientvar
labs labvar
pmode lab2client labvar
lab clientvar
pmode cleanup conf
pmode allows the interactive parallel execution of MATLAB® commands. pmode achieves this by defining and submitting a parallel job, and opening a Parallel Command Window connected to the labs running the job. The labs then receive commands entered in the Parallel Command Window, process them, and send the command output back to the Parallel Command Window. Variables can be transferred between the MATLAB client and the labs.
pmode start starts pmode, using the default configuration to define the scheduler and number of labs. (The initial default configuration is local; you can change it by using the function defaultParallelConfig.) You can also specify the number of labs using pmode start numlabs, but note that the local scheduler allows for only up to four labs.
pmode start conf numlabs starts pmode using the Parallel Computing Toolbox™ configuration conf to locate the scheduler, submits a parallel job with the number of labs identified by numlabs, and connects the Parallel Command Window with the labs. If the number of labs is specified, it overrides the minimum and maximum number of workers specified in the configuration.
pmode quit or pmode exit stops the parallel job, destroys it, and closes the Parallel Command Window. You can enter this command at the MATLAB prompt or the pmode prompt.
pmode client2lab clientvar labs labvar copies the variable clientvar from the MATLAB client to the variable labvar on the labs identified by labs. If labvar is omitted, the copy is named clientvar. labs can be either a single lab index or a vector of lab indices. You can enter this command at the MATLAB prompt or the pmode prompt.
pmode lab2client labvar lab clientvar copies the variable labvar from the lab identified by lab, to the variable clientvar on the MATLAB client. If clientvar is omitted, the copy is named labvar. You can enter this command at the MATLAB prompt or the pmode prompt. Note: If you use this command in an attempt to transfer a distributed array to the client, you get a warning, and only the local portion of the array on the specified lab is transferred. To transfer an entire distributed array, first use the gather function to assemble the whole array into the labs' workspaces.
pmode cleanup conf destroys all parallel jobs created by pmode for the current user running under the scheduler specified in the configuration conf, including jobs that are currently running. The configuration is optional; the default configuration is used if none is specified. You can enter this command at the MATLAB prompt or the pmode prompt.
You can invoke pmode as either a command or a function, so the following are equivalent.
pmode start conf 4
pmode('start', 'conf', 4)In the following examples, the pmode prompt (P>>) indicates commands entered in the Parallel Command Window. Other commands are entered in the MATLAB Command Window.
Start pmode using the default configuration to identify the scheduler and number of labs.
pmode start
Start pmode using the local configuration with four local labs.
pmode start local 4
Start pmode using the configuration myconfig and eight labs on the cluster.
pmode start myconfig 8
Execute a command on all labs.
P>> x = 2*labindex;
Copy the variable x from lab 7 to the MATLAB client.
pmode lab2client x 7
Copy the variable y from the MATLAB client to labs 1 to 8.
pmode client2lab y 1:8
Display the current working directory of each lab.
P>> pwd
createParallelJob, defaultParallelConfig, findResource
![]() | pload | promote | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |