org.griphyn.cPlanner.transfer.sls
Class Condor

java.lang.Object
  extended by org.griphyn.cPlanner.transfer.sls.Condor
All Implemented Interfaces:
SLS

public class Condor
extends Object
implements SLS

This uses the Condor File Transfer mechanism for the second level staging. It will work only if the Pegasus Style profile ( pegasus::style ) has a value of condor.

Version:
$Revision: 449 $
Author:
Karan Vahi

Field Summary
static String DESCRIPTION
          A short description of the transfer implementation.
protected  LogManager mLogger
          The handle to the logging manager.
protected  PlannerOptions mPOptions
          The handle to the planner options.
protected  PegasusProperties mProps
          The handle to the properties.
protected  PoolInfoProvider mSiteHandle
          The handle to the site catalog.
 
Fields inherited from interface org.griphyn.cPlanner.transfer.SLS
VERSION
 
Constructor Summary
Condor()
          The default constructor.
 
Method Summary
 boolean doesCondorModifications()
          Returns a boolean whether the SLS implementation does a condor based modification or not.
 File generateSLSInputFile(SubInfo job, String fileName, String submitDir, String headNodeDirectory, String workerNodeDirectory)
          Generates a second level staging file of the input files to the worker node directory.
 File generateSLSOutputFile(SubInfo job, String fileName, String submitDir, String headNodeDirectory, String workerNodeDirectory)
          Generates a second level staging file of the input files to the worker node directory.
 String getSLSInputLFN(SubInfo job)
          Returns the LFN of sls input file.
 String getSLSOutputLFN(SubInfo job)
          Returns the LFN of sls output file.
 void initialize(PegasusBag bag)
          Initializes the SLS implementation.
 String invocationString(SubInfo job, File slsFile)
          Constructs a command line invocation for a job, with a given sls file.
 boolean modifyJobForFirstLevelStaging(SubInfo job, String submitDir, String slsInputLFN, String slsOutputLFN)
          Modifies a job for the first level staging to headnode.This is to add any files that needs to be staged to the head node for a job specific to the SLS implementation.
 boolean modifyJobForWorkerNodeExecution(SubInfo job, String headNodeURLPrefix, String headNodeDirectory, String workerNodeDirectory)
          Modifies a compute job for second level staging.
 boolean needsSLSInput(SubInfo job)
          Returns a boolean indicating whether it will an input file for a job to do the transfers.
 boolean needsSLSOutput(SubInfo job)
          Returns a boolean indicating whether it will an output file for a job to do the transfers.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DESCRIPTION

public static final String DESCRIPTION
A short description of the transfer implementation.

See Also:
Constant Field Values

mSiteHandle

protected PoolInfoProvider mSiteHandle
The handle to the site catalog.


mProps

protected PegasusProperties mProps
The handle to the properties.


mPOptions

protected PlannerOptions mPOptions
The handle to the planner options.


mLogger

protected LogManager mLogger
The handle to the logging manager.

Constructor Detail

Condor

public Condor()
The default constructor.

Method Detail

initialize

public void initialize(PegasusBag bag)
Initializes the SLS implementation.

Specified by:
initialize in interface SLS
Parameters:
bag - the bag of objects. Contains access to catalogs etc.

doesCondorModifications

public boolean doesCondorModifications()
Returns a boolean whether the SLS implementation does a condor based modification or not. By condor based modification we mean whether it uses condor specific classads to achieve the second level staging or not.

Specified by:
doesCondorModifications in interface SLS
Returns:
false

invocationString

public String invocationString(SubInfo job,
                               File slsFile)
Constructs a command line invocation for a job, with a given sls file. The SLS maybe null. In the case where SLS impl does not read from a file, it is advised to create a file in generateSLSXXX methods, and then read the file in this function and put it on the command line.

Specified by:
invocationString in interface SLS
Parameters:
job - the job that is being sls enabled
slsFile - the slsFile can be null
Returns:
invocation string

needsSLSInput

public boolean needsSLSInput(SubInfo job)
Returns a boolean indicating whether it will an input file for a job to do the transfers. Transfer reads from stdin the file transfers that it needs to do. Always returns true, as we need to transfer the proxy always.

Specified by:
needsSLSInput in interface SLS
Parameters:
job - the job being detected.
Returns:
false

needsSLSOutput

public boolean needsSLSOutput(SubInfo job)
Returns a boolean indicating whether it will an output file for a job to do the transfers. Transfer reads from stdin the file transfers that it needs to do.

Specified by:
needsSLSOutput in interface SLS
Parameters:
job - the job being detected.
Returns:
false

getSLSInputLFN

public String getSLSInputLFN(SubInfo job)
Returns the LFN of sls input file.

Specified by:
getSLSInputLFN in interface SLS
Parameters:
job - SubInfo
Returns:
the name of the sls input file.

getSLSOutputLFN

public String getSLSOutputLFN(SubInfo job)
Returns the LFN of sls output file.

Specified by:
getSLSOutputLFN in interface SLS
Parameters:
job - SubInfo
Returns:
the name of the sls input file.

generateSLSInputFile

public File generateSLSInputFile(SubInfo job,
                                 String fileName,
                                 String submitDir,
                                 String headNodeDirectory,
                                 String workerNodeDirectory)
Generates a second level staging file of the input files to the worker node directory.

Specified by:
generateSLSInputFile in interface SLS
Parameters:
job - job for which the file is being created
fileName - name of the file that needs to be written out.
submitDir - submit directory where it has to be written out.
headNodeDirectory - directory on the head node of the compute site.
workerNodeDirectory - worker node directory
Returns:
null as no SLS file is generated.
See Also:
#needsSLSFile( SubInfo )

generateSLSOutputFile

public File generateSLSOutputFile(SubInfo job,
                                  String fileName,
                                  String submitDir,
                                  String headNodeDirectory,
                                  String workerNodeDirectory)
Generates a second level staging file of the input files to the worker node directory.

Specified by:
generateSLSOutputFile in interface SLS
Parameters:
job - the job for which the file is being created
fileName - the name of the file that needs to be written out.
submitDir - the submit directory where it has to be written out.
headNodeDirectory - the directory on the head node of the compute site.
workerNodeDirectory - the worker node directory
Returns:
null as no SLS file is generated.
See Also:
#needsSLSFile( SubInfo )

modifyJobForFirstLevelStaging

public boolean modifyJobForFirstLevelStaging(SubInfo job,
                                             String submitDir,
                                             String slsInputLFN,
                                             String slsOutputLFN)
Modifies a job for the first level staging to headnode.This is to add any files that needs to be staged to the head node for a job specific to the SLS implementation. If any file needs to be added, a FileTransfer object should be created and added as an input or an output file.

Specified by:
modifyJobForFirstLevelStaging in interface SLS
Parameters:
job - the job
submitDir - the submit directory
slsInputLFN - the sls input file if required, that is used for staging in from the head node to worker node directory.
slsOutputLFN - the sls output file if required, that is used for staging in from the head node to worker node directory.
Returns:
boolean

modifyJobForWorkerNodeExecution

public boolean modifyJobForWorkerNodeExecution(SubInfo job,
                                               String headNodeURLPrefix,
                                               String headNodeDirectory,
                                               String workerNodeDirectory)
Modifies a compute job for second level staging. Adds the appropriate condor classads. It assumes that all the files are being moved to and from the submit directory directly. Ignores any headnode parameters passed.

Specified by:
modifyJobForWorkerNodeExecution in interface SLS
Parameters:
job - the job to be modified.
headNodeURLPrefix - the url prefix for the server on the headnode
headNodeDirectory - the directory on the headnode, where the input data is read from and the output data written out.
workerNodeDirectory - the directory in the worker node tmp
Returns:
boolean indicating whether job was successfully modified or not.


Copyright © 2007 The University of Southern California. All Rights Reserved.