org.objectweb.proactive.core.process.prun
Class PrunSubProcess

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.prun.PrunSubProcess
All Implemented Interfaces:
ExternalProcess, ExternalProcessDecorator, java.io.Serializable, UniversalProcess

public class PrunSubProcess
extends AbstractExternalProcessDecorator

The PrunSubProcess class is able to start any class, of the ProActive library, on a cluster managed by PBS prtocol. An instance 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 PBSBSubProcess.

For instance:

 ..............
 PBSBSubProcess PBS = new PBSBSubProcess(new SimpleExternalProcess("ls -lsa"));
 RLoginProcess p = new RLoginProcess(PBS, 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 PrunSubProcess.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
protected  java.lang.String bookingDuration
           
protected static java.lang.String DEFAULT_BOOKING_DURATION
           
protected static java.lang.String DEFAULT_HOSTS_NUMBER
           
protected static java.lang.String DEFAULT_PROCESSOR_NUMBER
           
static java.lang.String DEFAULT_PRUNPATH
           
protected  java.lang.String hostList
           
protected  java.lang.String hosts
           
protected  java.lang.String interactive
           
protected  int jobID
           
protected  java.lang.String outputFile
           
protected  java.lang.String processorPerNode
           
protected  java.lang.String queueName
           
 
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
PrunSubProcess()
          Creates a new PBSBsubProcess Used with XML Descriptors
PrunSubProcess(ExternalProcess targetProcess)
          Creates a new PBSBsubProcess
 
Method Summary
static ExternalProcess buildBKillProcess(int jobID)
          Builds bdel command and encapsulates it in a process
protected  java.lang.String buildCommand()
           
 java.lang.String getBookingDuration()
          Return the booking duration of the cluster's nodes.
 java.lang.String getHostList()
          Returns the hostList value of this process.
 java.lang.String getHostsNumber()
          Returns the number of nodes requested for the job
 int getJobID()
          Returns the id of the job associated to this process
 java.lang.String getOutputFile()
           
 java.lang.String getProcessorPerNodeNumber()
           
 java.lang.String getQueueName()
          Returns the name of the queue where the job was launched
protected  java.lang.String internalBuildCommand()
           
protected  void internalStartProcess(java.lang.String command)
           
static void main(java.lang.String[] args)
           
protected  java.lang.String parseHostname(java.lang.String message)
          return the list of the hostnames on which the job is running the message should be in the form : host1/processor ... hostn/processor
protected  void sendJobDetailsCommand()
           
protected  java.lang.String[] separateCommandFromOptions(java.lang.String s)
           
 void setBookingDuration(java.lang.String d)
          Set the booking duration of the cluster's nodes.
 void setErrorMessageLogger(MessageLogger errorMessageLogger)
          sets the MessageLogger handling the error stream of the process
 void setHostList(java.lang.String hostList)
          Sets the value of the hostList parameter with the given value
 void setHostsNumber(java.lang.String hosts)
          Sets the number of nodes requested when running the job
 void setInteractive(java.lang.String interactive)
          Allows to launch this BsubProcess with -I (interactive option)
 void setOutputFile(java.lang.String string)
          Set the output file to be passed to prun using the -o option
 void setOutputMessageSink(MessageSink outputMessageSink)
          sets the MessageSink handling the output stream of the process
 void setProcessorPerNodeNumber(java.lang.String processorPerNode)
          Sets the number of nodes requested when running the job
 void setQueueName(java.lang.String queueName)
          Sets the value of the queue where the job will be launched.
 
Methods inherited from class org.objectweb.proactive.core.process.AbstractExternalProcessDecorator
getCompositionType, getTargetProcess, handleOutput, setCompositionType, setTargetProcess, toString
 
Methods inherited from class org.objectweb.proactive.core.process.AbstractExternalProcess
buildEnvironmentCommand, buildUnixEnvironmentCommand, buildWindowsEnvironmentCommand, getErrorMessageLogger, getInputMessageLogger, getOutputMessageSink, handleError, handleInput, handleProcess, internalStopProcess, internalWaitFor, setInputMessageLogger
 
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, setInputMessageLogger
 
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_PRUNPATH

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

DEFAULT_HOSTS_NUMBER

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

DEFAULT_PROCESSOR_NUMBER

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

DEFAULT_BOOKING_DURATION

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

jobID

protected int jobID

queueName

protected java.lang.String queueName

hostList

protected java.lang.String hostList

hosts

protected java.lang.String hosts

processorPerNode

protected java.lang.String processorPerNode

bookingDuration

protected java.lang.String bookingDuration

interactive

protected java.lang.String interactive

outputFile

protected java.lang.String outputFile
Constructor Detail

PrunSubProcess

public PrunSubProcess()
Creates a new PBSBsubProcess Used with XML Descriptors


PrunSubProcess

public PrunSubProcess(ExternalProcess targetProcess)
Creates a new PBSBsubProcess

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

setErrorMessageLogger

public void setErrorMessageLogger(MessageLogger errorMessageLogger)
Description copied from interface: ExternalProcess
sets the MessageLogger handling the error stream of the process

Specified by:
setErrorMessageLogger in interface ExternalProcess
Overrides:
setErrorMessageLogger in class AbstractExternalProcess
Parameters:
errorMessageLogger - the handler of the error 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 bdel 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)

getOutputFile

public java.lang.String getOutputFile()
Returns:
the filename given to prun using -o

setOutputFile

public void setOutputFile(java.lang.String string)
Set the output file to be passed to prun using the -o option

Parameters:
string -

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

setBookingDuration

public void setBookingDuration(java.lang.String d)
Set the booking duration of the cluster's nodes. The default is 00:01:00


getBookingDuration

public java.lang.String getBookingDuration()
Return the booking duration of the cluster's nodes.

Returns:
String

parseHostname

protected java.lang.String parseHostname(java.lang.String message)
return the list of the hostnames on which the job is running the message should be in the form : host1/processor ... hostn/processor

Parameters:
message -
Returns:
the hostname

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

setHostsNumber

public void setHostsNumber(java.lang.String hosts)
Sets the number of nodes requested when running the job


setProcessorPerNodeNumber

public void setProcessorPerNodeNumber(java.lang.String processorPerNode)
Sets the number of nodes requested when running the job


getHostsNumber

public java.lang.String getHostsNumber()
Returns the number of nodes requested for the job

Returns:
String

getProcessorPerNodeNumber

public java.lang.String getProcessorPerNodeNumber()

internalBuildCommand

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

sendJobDetailsCommand

protected void sendJobDetailsCommand()

internalStartProcess

protected void internalStartProcess(java.lang.String command)
                             throws java.io.IOException
Overrides:
internalStartProcess in class AbstractExternalProcessDecorator
java.io.IOException

buildCommand

protected java.lang.String buildCommand()
Overrides:
buildCommand in class AbstractExternalProcessDecorator

separateCommandFromOptions

protected java.lang.String[] separateCommandFromOptions(java.lang.String s)


Copyright © April 2004 INRIA All Rights Reserved.