connect to schedulers when client utilities are not available locally -pg电子麻将胡了
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 . 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 mathworks® 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 .
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 (matlab parallel server).
use
remoteclusteraccesswhen 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 theidentityfilenameoption, 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 theusernameproperty.
alternatively, to connect to a client with multiple authentication requirements, specify
authenticationmodeas 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 astrueorfalse. 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 whenremoteclusteraccessconnects 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 between1and65535.the default value is
22.
for more information and detailed examples, see and .
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 and .
version history
introduced in r2011a