Package repast.simphony.batch.ssh
Class RemoteSession
java.lang.Object
repast.simphony.batch.ssh.RemoteSession
- All Implemented Interfaces:
Session
Encapsulates info about a Remote ssh reachable host that simphony models can
be run on.
- Author:
- Nick Collier
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcopyCompletionStatus(String outDirectory) Copies the completion status from the host and directory where the model was run to the specified directory.createDonePoller(long frequency) Create a callable that returns with the model run by this Session is finished.findOutput(List<OutputPattern> patterns) Finds the model output of that is the result of running this Session and returns that those files.getHost()Gets the name or ip address of the remote host.getId()Gets the id (user@host) of this Remote.getInput()Gets the file that contains parameter input for this Session.intGets the number of model instances to run on this Remote.getStatus(int instance) Gets the status of the specified instance.getUser()Gets the user account used to log into the remote host.voidinitModelArchive(Configuration config, String directory) Initializes the model for running.voidRetrieves the run completion status (e.g.voidrunModel()Runs the model for this Session.voidSets the file that contains the parameter input for this Session.voidsetRunStatus(int instance, RunningStatus status) Sets the run status for the specified instance on this Remote.
-
Constructor Details
-
RemoteSession
public RemoteSession()
-
-
Method Details
-
getInstances
public int getInstances()Description copied from interface:SessionGets the number of model instances to run on this Remote.- Specified by:
getInstancesin interfaceSession- Returns:
- the number of model instances to run on this Remote.
-
getId
Description copied from interface:SessionGets the id (user@host) of this Remote. -
getHost
Description copied from interface:SessionGets the name or ip address of the remote host. -
getUser
Description copied from interface:SessionGets the user account used to log into the remote host. -
getInput
Description copied from interface:SessionGets the file that contains parameter input for this Session. -
getKeyFile
-
setInput
Description copied from interface:SessionSets the file that contains the parameter input for this Session. -
setRunStatus
Description copied from interface:SessionSets the run status for the specified instance on this Remote.- Specified by:
setRunStatusin interfaceSession- Parameters:
instance- the instance idstatus- the status
-
getStatus
Description copied from interface:SessionGets the status of the specified instance. -
initModelArchive
public void initModelArchive(Configuration config, String directory) throws ModelArchiveConfiguratorException, SessionException Initializes the model for running. This configures the model archive for this Session and copies it over to the remote host.- Specified by:
initModelArchivein interfaceSessiondirectory- the directory to copy the model archive into- Throws:
ModelArchiveConfiguratorExceptionSessionException
-
runModel
Runs the model for this Session.- Specified by:
runModelin interfaceSession- Throws:
SessionException
-
retrieveRunCompletionStatus
Retrieves the run completion status (e.g. FAILURE) and sets it for this Session.- Specified by:
retrieveRunCompletionStatusin interfaceSession- Throws:
StatusException
-
findOutput
Finds the model output of that is the result of running this Session and returns that those files. In the case of remote output the output may be copied to local temporary location. The patterns used to identify output is specified in the filePatterns parameters.- Specified by:
findOutputin interfaceSession- Parameters:
patterns- the patterns used to match potential output- Returns:
- the location of the output in a list of MatchedFiles. Each MatchedFiles object holds one or more files for a specific match.
- Throws:
StatusException
-
copyCompletionStatus
Copies the completion status from the host and directory where the model was run to the specified directory.- Specified by:
copyCompletionStatusin interfaceSession- Parameters:
outDirectory-- Throws:
StatusException
-
createDonePoller
Create a callable that returns with the model run by this Session is finished.- Specified by:
createDonePollerin interfaceSession- Returns:
- a callable that returns with the model run by this Session is finished.
-