pmode
(Removed) Interactive Parallel Command Window
pmode
has been removed. Use spmd
instead. For more
information, see Version
History.
Syntax
pmode start
pmode start numworkers
pmode start prof numworkers
pmode quit
pmode exit
pmode client2lab clientvar
workers workervar
pmode lab2client workervar
worker clientvar
pmode cleanup prof
Description
pmode
allows the interactive parallel execution of MATLAB® commands. pmode
achieves this by defining and
submitting a communicating job, and opening a Parallel Command Window connected to
the workers running the job. The workers 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 workers.
pmode start
starts pmode, using the default profile to define
the cluster and number of workers. (The initial default profile is
Processes
; you can change it by using the function
parallel.defaultProfile
.) You can also specify the number
of workers using pmode start numworkers
.
pmode start prof numworkers
starts pmode using the Parallel Computing Toolbox™ profile prof
to locate the cluster, submits a
communicating job with the number of workers identified by
numworkers
, and connects the Parallel Command Window with the
workers. If the number of workers is specified, it overrides the minimum and maximum
number of workers specified in the profile.
pmode quit
or pmode exit
stops the pmode
job, deletes it, and closes the Parallel Command Window. You can enter this command
at the MATLAB prompt or the pmode
prompt.
pmode client2lab clientvar
workers workervar
copies the variable clientvar
from the
MATLAB client to the variable workervar
on the workers
identified by workers
. If workervar
is
omitted, the copy is named clientvar
. workers
can be either a single index or a vector of indices. You can enter this command at
the MATLAB prompt or the pmode
prompt.
pmode lab2client workervar
worker clientvar
copies the variable workervar
from the
worker identified by worker
, to the variable
clientvar
on the MATLAB client. If clientvar
is omitted, the copy is named
workervar
. 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 codistributed array to the client, you get a
warning, and only the local portion of the array on the specified worker is
transferred. To transfer an entire codistributed array, first use the gather
function to assemble the
whole array into the worker workspaces.
pmode cleanup prof
deletes all communicating jobs created by
pmode
for the current user running on the cluster specified
in the profile prof
, including jobs that are currently running.
The profile is optional; the default profile 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 prof 4 pmode('start','prof',4)
Examples
In this example, 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 profile to identify the cluster
and number of workers.
pmode start