RemoteClusterAccess
Connect to schedulers when client utilities are not available locally
Constructor
r = parallel.cluster.RemoteClusterAccess(username)
r = parallel.cluster.RemoteClusterAccess(username,P1,V1,...,Pn,Vn)
Description
r = parallel.cluster.RemoteClusterAccess(
creates a username
)RemoteClusterAccess
object with the Username
set to username
.
By default, you are prompted for a password when you connect to the cluster.
Tip
If you have set up a cluster profile for a remote cluster, use parcluster
. For more information, see Discover Clusters and Use Cluster Profiles.
You only need to use RemoteClusterAccess
directly if you need to modify
plugin scripts for third-party schedulers that do not have a built-in
cluster type. You use plugin scripts when you connect to a cluster using the
Generic scheduler interface. For more information, see Configure Using the Generic Scheduler Interface (MATLAB Parallel Server).
Use RemoteClusterAccess
when you need to modify settings
for remote cluster connection, submission, or data transfer.
r = parallel.cluster.RemoteClusterAccess(___,
creates a Name,Value
)RemoteClusterAccess
object using one or more name-value arguments. For example, specify 'Port',31415
to connect to a cluster using port number 31415
. Specify name-value arguments after all other input arguments.
The accepted name-value arguments are:
'AuthenticationMode'
— Authentication mode you use when you connect to the cluster, specified as a string scalar, character vector, string array or cell array.If you specify the argument
'IdentityFilename'
, the default value is'IdentityFile'
. Otherwise, the default value is'Password'
. Valid values for'AuthenticationMode'
are:'Agent'
– the client interfaces with an SSH agent running on the client machine.'IdentityFile'
– the client uses an identity file to authenticate when you connect to the cluster. If you specify a file using theIdentityFilename
option, you use that file. Otherwise, MATLAB® prompts you to specify the full path to an identity file when you connect.'Multifactor'
– the client prompts you for input one or more times. For example, if two-factor authentication (2FA) is enabled on the client, the client requests your password and a response for the second authentication factor.'Password'
– the client prompts you for your SSH password. Your user name is specified by theUsername
property.
Alternatively, to connect to a client with multiple authentication requirements, specify
AuthenticationMode
as a string array or cell array containing a combination of'Agent'
,'IdentityFile'
,'Multifactor'
and'Password'
.'IdentityFileHasPassphrase'
— Flag indicating if the identity file requires a passphrase, specified astrue
orfalse
. Iftrue
, you are prompted for a password when you connect. If an identity file is not supplied, this name-value argument is not used.'IdentityFilename'
— Full path to the identity file to use whenRemoteClusterAccess
connects to a remote host, specified as'IdentityFilename'
and a string scalar or character vector.'Port'
— Port number on the cluster you connect to, specified as an integer scalar between1
and65535
.The default value is
22
.
For more information and detailed examples, see Submit from a Remote Host (MATLAB Parallel Server) and Submit Without a Shared File System (MATLAB Parallel Server).
Methods
Method Name | Description |
---|---|
connect |
|
disconnect | disconnect(r) disconnects the existing remote connection. The connect method must have already been called. |
doLastMirrorForJob |
|
getRemoteJobLocation |
|
isJobUsingConnection |
|
reconnect | reconnect(r) recreates the existing SSH
connections to the remote host. |
resumeMirrorForJob |
|
runCommand |
|
startMirrorForJob |
|
stopMirrorForJob |
|
getConnectedAccess |
|
getConnectedAccessWithMirror |
|
Properties
A RemoteClusterAccess
object has the following read-only properties. Their values are set when you construct the object or call its connect
method.
Property Name | Description |
---|---|
AuthenticationMode | Option indicating how you are authenticated when you connect to the cluster, returned as one of the following:
If the To set this property, specify the |
AutoReconnect | Flag indicating if MATLAB automatically recreates the SSH connection to the
remote host after a remote command errors, specified as
The default value is
|
Hostname | Name of the remote host to access, returned as a character vector. The default value is an empty character vector. |
IdentityFileHasPassphrase | Flag indicating if the identity file requires a passphrase, specified as the comma-separated pair consisting of The default value is If this property is set to To set this property, specify the |
IdentityFilename | Full path to the identity file to use when the The default value is an empty character vector. If this property is empty, you are prompted for a password when you connect. To set this property, specify the |
IsConnected | Flag indicating if the The default value is |
IsFileMirrorSupported | Flag indicating if file mirroring is supported for the The default value is The |
JobStorageLocation | Location on the remote host for files that are being mirrored, returned as a character vector. The default value is an empty character vector. To set this property, use any of the following syntaxes to connect to the cluster:
|
Port | Port number you use to connect to the cluster, returned as an integer scalar between The default value is To set this property, specify the |
UseIdentityFile | Flag indicating if the The default value is |
Username | User name you use to connect to the cluster, returned as a character vector. |
Examples
Mirror files from the remote data location. Assume the object job
represents a job on your generic scheduler.
remoteConnection = parallel.cluster.RemoteClusterAccess('testname'); connect(remoteConnection,'headnode1','/tmp/filemirror'); startMirrorForJob(remoteConnection,job); submit(job) % Wait for the job to finish wait(job); % Ensure that all the local files are up to date, and remove the % remote files doLastMirrorForJob(remoteConnection,job); % Get the output arguments for the job results = fetchOutputs(job)
For more information and examples, see Submit from a Remote Host (MATLAB Parallel Server) and Submit Without a Shared File System (MATLAB Parallel Server).
Version History
Introduced in R2011a
See Also
Topics
- Plugin Scripts for Generic Schedulers (MATLAB Parallel Server)