Skip to Main Content Skip to Search
Product Documentation

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

parallel.cluster.RemoteClusterAccess allows you to establish a connection and run commands on a remote host. This class is intended for use with the generic scheduler interface when using remote submission of jobs or on nonshared file systems.

r = parallel.cluster.RemoteClusterAccess(username) uses the supplied username when connecting to the remote host. You will be prompted for a password when establishing the connection.

r = parallel.cluster.RemoteClusterAccess(username, P1, V1, ..., Pn, Vn) allows additional parameter-value pairs that modify the behavior of the connection. The accepted parameters are:

For more information and detailed examples, see the integration scripts provided in matlabroot/toolbox/distcomp/examples/integration. For example, the scripts for PBS in a nonshared file system are in

matlabroot/toolbox/distcomp/examples/integration/pbs/nonshared

Methods

Method NameDescription
connect

RemoteClusterAccess.connect(clusterHost) establishes a connection to the specified host using the user credential options supplied in the constructor. File mirroring is not supported.

RemoteClusterAccess.connect(clusterHost, remoteDataLocation) establishes a connection to the specified host using the user credential options supplied in the constructor. remoteDataLocation identifies a folder on the clusterHost that is used for file mirroring. The user credentials supplied in the constructor must have write access to this folder.

disconnectRemoteClusterAccess.disconnect() disconnects the existing remote connection. The connect method must have already been called.
doLastMirrorForJob

RemoteClusterAccess.doLastMirrorForJob(job) performs a final copy of changed files from the remote DataLocation to the local DataLocation for the supplied job. Any running mirrors for the job also stop and the job files are removed from the remote DataLocation. The startMirrorForJob or resumeMirrorForJob method must have already been called.

getRemoteJobLocation

RemoteClusterAccess.getRemoteJobLocation(jobID, remoteOS) returns the full path to the remote job location for the supplied jobID. Valid values for remoteOS are 'pc' and 'unix'.

isJobUsingConnection

RemoteClusterAccess.isJobUsingConnection(jobID) returns true if the job is currently being mirrored.

resumeMirrorForJob

RemoteClusterAccess.resumeMirrorForJob(job) resumes the mirroring of files from the remote DataLocation to the local DataLocation for the supplied job. This is similar to the startMirrorForJob method, but does not first copy the files from the local DataLocation to the remote DataLocation. The connect method must have already been called. This is useful if the original client MATLAB session has ended, and you are accessing the same files from a new client session.

runCommand

[status, result] = RemoteClusterAccess.runCommand(command) runs the supplied command on the remote host and returns the resulting status and standard output. The connect method must have already been called.

startMirrorForJob

RemoteClusterAccess.startMirrorForJob(job) copies all the job files from the local DataLocation to the remote DataLocation, and starts mirroring files so that any changes to the files in the remote DataLocation are copied back to the local DataLocation. The connect method must have already been called.

stopMirrorForJob

RemoteClusterAccess.stopMirrorForJob(job) immediately stops the mirroring of files from the remote DataLocation to the local DataLocation for the specified job. The startMirrorForJob or resumeMirrorForJob method must have already been called. This cancels the running mirror and removes the files for the job from the remote location. This is similar to doLastMirrorForJob, except that stopMirrorForJob makes no attempt to ensure that the local job files are up to date. For normal mirror stoppage, use doLastMirrorForJob.

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 NameDescription
DataLocationLocation on the remote host for files that are being mirrored.
HostnameName of the remote host to access.
IdentityFileHasPassphraseIndicates if the identity file requires a passphrase.
IdentityFilenameFull path to the identity file used when connecting to the remote host.
IsConnectedIndicates if there is an active connection to the remote host.
IsFileMirrorSupportedIndicates if file mirroring is supported for this connection. This is false if no remote DataLocation is supplied to the connect() method.
UseIdentityFileIndicates if an identity file should be used when connecting to the remote host.
UsernameUser name for connecting to the remote host.

Examples

Mirror files from the remote data location. Assume the object job represents a job on your generic scheduler.

remoteConnection = parallel.cluster.RemoteClusterAccess('testname');
remoteConnection.connect('headnode1','/tmp/filemirror');
remoteConnection.startMirrorForJob(job);
submit(job)
% Wait for the job to finish
job.wait();

% Ensure that all the local files are up to date, and remove the 
% remote files
remoteConnection.doLastMirrorForJob(job);

% Get the output arguments for the job
results = job.getAllOutputArguments()

For more detailed examples, see the integration scripts provided in matlabroot/toolbox/distcomp/examples/integration. For example, the scripts for PBS in a nonshared file system are in

matlabroot/toolbox/distcomp/examples/integration/pbs/nonshared
  


Free Parallel Computing Interactive Kit

See how to solve large problems with minimal effort and reduce simulation time.

Get free kit

Trials Available

Try the latest versions of parallel computing products.

Get trial software
 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS