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
if you need
to modify plugin scripts for third-party schedulers that you connect to
in nonshared or remote submission mode. You use plugin scripts when you
connect to a cluster using the Generic scheduler interface.
If the client is not able to submit directly to the third-party scheduler, or the client does not share a file system with the cluster, consider the following:
If the third-party scheduler has a bat365® add-on, install it. When you use an add-on, you can set up your cluster profile using the set-up wizard or the Cluster Profile Manager to set many settings. For more information, see Plugin Scripts for Generic Schedulers.
If you need to use a third-party scheduler that does not have an add-on, or if you need to customize an add-on, 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 Submitting from a Remote Host and Submitting without a Shared File System.
Methods
Method Name | Description |
---|---|
connect |
|
disconnect | disconnect(r) disconnects the existing remote
connection. The connect method must have already
been called. |
doLastMirrorForJob |
|
getRemoteJobLocation |
|
isJobUsingConnection |
|
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
|
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 Submitting from a Remote Host and Submitting without a Shared File System.
Version History
Introduced in R2011a