org.objectweb.proactive.core.process.lsf
Class LSFBSubProcess

java.lang.Object
  |
  +--org.objectweb.proactive.core.process.AbstractUniversalProcess
        |
        +--org.objectweb.proactive.core.process.AbstractExternalProcess
              |
              +--org.objectweb.proactive.core.process.AbstractExternalProcessDecorator
                    |
                    +--org.objectweb.proactive.core.process.lsf.LSFBSubProcess
All Implemented Interfaces:
ExternalProcess, ExternalProcessDecorator, java.io.Serializable, UniversalProcess

public class LSFBSubProcess
extends AbstractExternalProcessDecorator

The LSFBSubProcess class is able to start any class, of the ProActive library, on a cluster managed by LSF prtocol. An istance of this class can be coupled for instance with RlLoginProcess or SSHProcess classes in order to log into the cluster's front end with rlogin or ssh and then to run a job with LSFBSubProcess.

For instance:

 ..............
 LSFBSubProcess lsf = new LSFBSubProcess(new SimpleExternalProcess("ls -lsa"));
 RLoginProcess p = new RLoginProcess(lsf, false);
 p.setHostname("cluster_front_end_name");
 p.startProcess();
 ...............
 

Since:
ProActive 0.9.4
Version:
1.0, 2002/09/20
Author:
ProActive Team
See Also:
Serialized Form

Nested Class Summary
 class LSFBSubProcess.ParserMessageLogger
          Implementation of a MessageLogger that look for the jobID of the launched job
 
Nested classes inherited from class org.objectweb.proactive.core.process.AbstractExternalProcessDecorator
AbstractExternalProcessDecorator.CompositeMessageLogger, AbstractExternalProcessDecorator.CompositeMessageSink
 
Nested classes inherited from class org.objectweb.proactive.core.process.AbstractExternalProcess
AbstractExternalProcess.NullMessageLogger, AbstractExternalProcess.ProcessInputHandler, AbstractExternalProcess.ProcessOutputHandler, AbstractExternalProcess.SimpleMessageSink, AbstractExternalProcess.StandardOutputMessageLogger
 
Field Summary
static java.lang.String DEFAULT_BJOBPATH
           
static java.lang.String DEFAULT_BSUBPATH
           
static java.lang.String DEFAULT_LSFPATH
           
protected static java.lang.String DEFAULT_PROCESSOR_NUMBER
           
static java.lang.String DEFAULT_QUEUE_NAME
           
protected  java.lang.String hostList
           
protected  java.lang.String interactive
           
protected  int jobID
           
protected  java.lang.String processor
           
protected  java.lang.String queueName
           
protected  java.lang.String res_requirement
           
protected  java.lang.String scriptLocation
           
 
Fields inherited from class org.objectweb.proactive.core.process.AbstractExternalProcessDecorator
targetProcess
 
Fields inherited from class org.objectweb.proactive.core.process.AbstractExternalProcess
clogger, errorMessageLogger, externalProcess, inputMessageLogger, IS_WINDOWS_SYSTEM, outputMessageSink
 
Fields inherited from class org.objectweb.proactive.core.process.AbstractUniversalProcess
certificateLocation, command, DEFAULT_HOSTNAME, DEFAULT_USERNAME, environment, hostname, isFinished, isStarted, LOCALHOST, privateKeyLocation, securityFile, username
 
Fields inherited from interface org.objectweb.proactive.core.process.ExternalProcessDecorator
APPEND_TO_COMMAND_COMPOSITION, GIVE_COMMAND_AS_PARAMETER, SEND_TO_OUTPUT_STREAM_COMPOSITION
 
Fields inherited from interface org.objectweb.proactive.core.process.UniversalProcess
logger
 
Constructor Summary
LSFBSubProcess()
          Creates a new LSFBsubProcess Used with XML Descriptors
LSFBSubProcess(ExternalProcess targetProcess)
          Creates a new LSFBsubProcess
 
Method Summary
protected  java.lang.String buildBJobsCommand()
           
static ExternalProcess buildBKillProcess(int jobID)
          Builds bkill command and encapsulates it in a process
protected  java.lang.String buildBSubCommand()
           
 java.lang.String getHostList()
          Returns the hostList value of this process.
 int getJobID()
          Returns the id of the job associated to this process
 java.lang.String getProcessorNumber()
          Returns the number of processor requested for the job
 java.lang.String getQueueName()
          Returns the name of the queue where the job was launched
 java.lang.String getRes_requirement()
           
 java.lang.String getScriptLocation()
           
protected  java.lang.String internalBuildCommand()
           
 java.lang.String isInteractive()
          Returns true if this BsubProcess is lauched with -I option false otherwise
static void main(java.lang.String[] args)
           
protected  java.lang.String parseHostname(java.lang.String message)
          parses the hostname from a string.
protected  int parseJobID(java.lang.String message)
          parses a message in order to find the job id of the launched job.
protected  void sendJobDetailsCommand()
           
 void setHostList(java.lang.String hostList)
          Sets the value of the hostList parameter with the given value
 void setInputMessageLogger(MessageLogger inputMessageLogger)
          sets the MessageLogger handling the input stream of the process
 void setInteractive(java.lang.String interactive)
          Allows to launch this BsubProcess with -I (interactive option)
 void setOutputMessageSink(MessageSink outputMessageSink)
          sets the MessageSink handling the output stream of the process
 void setProcessorNumber(java.lang.String processor)
          Sets the number of processor requested when running the job
 void setQueueName(java.lang.String queueName)
          Sets the value of the queue where the job will be launched.
 void setRes_requirement(java.lang.String res_requirement)
           
 void setScriptLocation(java.lang.String location)
           
 
Methods inherited from class org.objectweb.proactive.core.process.AbstractExternalProcessDecorator
buildCommand, getCompositionType, getTargetProcess, handleOutput, internalStartProcess, setCompositionType, setTargetProcess, toString
 
Methods inherited from class org.objectweb.proactive.core.process.AbstractExternalProcess
buildEnvironmentCommand, buildUnixEnvironmentCommand, buildWindowsEnvironmentCommand, getErrorMessageLogger, getInputMessageLogger, getOutputMessageSink, handleError, handleInput, handleProcess, internalStopProcess, internalWaitFor, setErrorMessageLogger
 
Methods inherited from class org.objectweb.proactive.core.process.AbstractUniversalProcess
checkStarted, getCertificateLocation, getCommand, getEnvironment, getHostname, getPrivateKeyLocation, getSecurityFile, getUsername, isFinished, isStarted, setCertificateLocation, setEnvironment, setHostname, setPrivateKeyLocation, setSecurityFile, setUsername, startProcess, stopProcess, toString, waitFor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.objectweb.proactive.core.process.ExternalProcess
getErrorMessageLogger, getInputMessageLogger, getOutputMessageSink, setErrorMessageLogger
 
Methods inherited from interface org.objectweb.proactive.core.process.UniversalProcess
getCertificateLocation, getCommand, getEnvironment, getHostname, getPrivateKeyLocation, getSecurityFile, getUsername, isFinished, isStarted, setCertificateLocation, setEnvironment, setHostname, setPrivateKeyLocation, setSecurityFile, setUsername, startProcess, stopProcess, waitFor
 

Field Detail

DEFAULT_LSFPATH

public static final java.lang.String DEFAULT_LSFPATH

DEFAULT_BSUBPATH

public static final java.lang.String DEFAULT_BSUBPATH

DEFAULT_BJOBPATH

public static final java.lang.String DEFAULT_BJOBPATH

DEFAULT_QUEUE_NAME

public static final java.lang.String DEFAULT_QUEUE_NAME
See Also:
Constant Field Values

DEFAULT_PROCESSOR_NUMBER

protected static final java.lang.String DEFAULT_PROCESSOR_NUMBER
See Also:
Constant Field Values

jobID

protected int jobID

queueName

protected java.lang.String queueName

hostList

protected java.lang.String hostList

scriptLocation

protected java.lang.String scriptLocation

processor

protected java.lang.String processor

interactive

protected java.lang.String interactive

res_requirement

protected java.lang.String res_requirement
Constructor Detail

LSFBSubProcess

public LSFBSubProcess()
Creates a new LSFBsubProcess Used with XML Descriptors


LSFBSubProcess

public LSFBSubProcess(ExternalProcess targetProcess)
Creates a new LSFBsubProcess

Parameters:
targetProcess - The target process associated to this process. The target process represents the process that will be launched with the bsub command
Method Detail

setInputMessageLogger

public void setInputMessageLogger(MessageLogger inputMessageLogger)
Description copied from interface: ExternalProcess
sets the MessageLogger handling the input stream of the process

Specified by:
setInputMessageLogger in interface ExternalProcess
Overrides:
setInputMessageLogger in class AbstractExternalProcess
Parameters:
inputMessageLogger - the handler of the input stream of the process

setOutputMessageSink

public void setOutputMessageSink(MessageSink outputMessageSink)
Description copied from interface: ExternalProcess
sets the MessageSink handling the output stream of the process

Specified by:
setOutputMessageSink in interface ExternalProcess
Overrides:
setOutputMessageSink in class AbstractExternalProcess
Parameters:
outputMessageSink - the handler of the output stream of the process

buildBKillProcess

public static ExternalProcess buildBKillProcess(int jobID)
Builds bkill command and encapsulates it in a process

Parameters:
jobID - The id of the job previously launched
Returns:
ExternalProcess The process encapsulating the bkill command

main

public static void main(java.lang.String[] args)

getJobID

public int getJobID()
Returns the id of the job associated to this process

Returns:
int

getQueueName

public java.lang.String getQueueName()
Returns the name of the queue where the job was launched

Returns:
String

setQueueName

public void setQueueName(java.lang.String queueName)
Sets the value of the queue where the job will be launched. The default is 'normal'

Parameters:
queueName -

setHostList

public void setHostList(java.lang.String hostList)
Sets the value of the hostList parameter with the given value

Parameters:
hostList -

getHostList

public java.lang.String getHostList()
Returns the hostList value of this process.

Returns:
String

isInteractive

public java.lang.String isInteractive()
Returns true if this BsubProcess is lauched with -I option false otherwise

Returns:
boolean

setInteractive

public void setInteractive(java.lang.String interactive)
Allows to launch this BsubProcess with -I (interactive option)

Parameters:
interactive - true for -I option false otherwise

setProcessorNumber

public void setProcessorNumber(java.lang.String processor)
Sets the number of processor requested when running the job

Parameters:
processor -

getProcessorNumber

public java.lang.String getProcessorNumber()
Returns the number of processor requested for the job

Returns:
String

setScriptLocation

public void setScriptLocation(java.lang.String location)

getScriptLocation

public java.lang.String getScriptLocation()

getRes_requirement

public java.lang.String getRes_requirement()

setRes_requirement

public void setRes_requirement(java.lang.String res_requirement)

internalBuildCommand

protected java.lang.String internalBuildCommand()
Specified by:
internalBuildCommand in class AbstractExternalProcessDecorator

buildBSubCommand

protected java.lang.String buildBSubCommand()

buildBJobsCommand

protected java.lang.String buildBJobsCommand()

parseJobID

protected int parseJobID(java.lang.String message)
parses a message in order to find the job id of the launched job. we assume here that the jobid is displayed following this convention : Job <...>


parseHostname

protected java.lang.String parseHostname(java.lang.String message)
parses the hostname from a string. We assume that the line looks like that : 191009 user status queue fromHost targetHost *eep 10000 Jan 25 13:33 Where targetHost is the hostname we are looking for. status could be at least - PEND for pending (means targethost is undetermined - anything else (means targethost is known

Parameters:
message - the string that may contains the hostname
Returns:
null if the message did not contains any hostname, an empty string if the message did contains the target host but was undertermined because the job was still pending. Return the hostname if it is found.

sendJobDetailsCommand

protected void sendJobDetailsCommand()


Copyright © April 2004 INRIA All Rights Reserved.