|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.griphyn.cPlanner.code.generator.Abstract
org.griphyn.cPlanner.code.generator.condor.CondorGenerator
public class CondorGenerator
This class generates the condor submit files for the DAG which has to be submitted to the Condor DagMan.
| Field Summary | |
|---|---|
protected ADag |
mConcreteWorkflow
The workflow for which the code has to be generated. |
protected PrintWriter |
mDagWriter
The file handle to the .dag file. |
protected boolean |
mDone
A boolean indicating whether the files have been generated or not. |
protected GridStartFactory |
mGridStartFactory
The handle to the GridStart Factory. |
protected boolean |
mInitializeGridStart
A boolean indicating whether grid start has been initialized or not. |
protected LogManager |
mLogger
The LogManager object which is used to log all the messages. |
protected String |
mPoolClass
Specifies the implementing class for the pool interface. |
private PoolInfoProvider |
mPoolHandle
Handle to the pool provider. |
private Map |
mProjectMap
Maps pool handles to project names. |
private Map |
mQueueMap
Maps pool handles to queue names. |
static String |
mSeparator
The nice separator, define once, use often. |
protected CondorStyleFactory |
mStyleFactory
Handle to the Style factory, that is used for this workflow. |
protected TransformationCatalog |
mTCHandle
Handle to the Transformation Catalog. |
protected String |
mTempLogFile
The name of the log file in the /tmp directory |
private Map |
mWalltimeMap
Maps pool handles to walltimes for that pool. |
| Fields inherited from class org.griphyn.cPlanner.code.generator.Abstract |
|---|
mBag, mPOptions, mProps, mSubmitFileDir |
| Fields inherited from interface org.griphyn.cPlanner.code.CodeGenerator |
|---|
VERSION |
| Constructor Summary | |
|---|---|
CondorGenerator()
The default constructor. |
|
| Method Summary | |
|---|---|
protected void |
applyStyle(SubInfo job,
PrintWriter writer)
Applies a submit file style to the job, according to the fact whether the job has to be submitted directly to condor or to a remote jobmanager via CondorG and GRAM. |
protected void |
concreteDagEmpty(String filename,
ADag dag)
A callout method that dictates what needs to be done in case the concrete plan that is generated is empty. |
private Map |
constructMap(String propValue)
Constructs a map with the numbers/values to be passed in the RSL handle for certain pools. |
void |
generateCode(ADag dag)
Generates the code for the concrete workflow in Condor DAGMAN and CondorG input format. |
void |
generateCode(ADag dag,
SubInfo job)
Generates the code (condor submit file) for a single job. |
protected boolean |
generateLogFileSymlink(String logFile,
String symlink)
This method generates a symlink to the actual log file written in the local temp directory. |
protected String |
getDAGFilename(ADag dag,
String suffix)
Returns the name of the file on the basis of the metadata associated with the DAG. |
protected String |
getDAGMANOutFilename(ADag dag)
Returns the basename of the file, that contains the output of the dagman while running the dag generated for the workflow. |
protected String |
getLogFileName()
The name of the condor log file that is used for the dag that is being written into the condor formal. |
protected String |
getLogFileSymlinkName(ADag dag)
Returns the path to the symlink that is created to the original log file in the temporary directory. |
private String |
gridstart(PrintWriter writer,
SubInfo job,
boolean isGlobusJob)
This function creates the stdio handling with and without gridstart. |
protected void |
handleCondorVarForJob(SubInfo sinfo)
It updates/adds the condor variables that are got through the Dax with the values specified in the properties file, pool config file or adds some variables internally. |
protected void |
handleEnvVarForJob(SubInfo sinfo)
It updates/adds the environment variables that are got through the Dax with the values specified in the properties file, pool config file or adds some variables internally. |
protected void |
handleGlobusRSLForJob(SubInfo sinfo)
It updates/adds the the Globus RSL parameters got through the dax that are in SubInfo object. |
protected void |
handleTransferOfExecutable(SubInfo sinfo)
It changes the paths to the executable depending on whether we want to transfer the executable or not. |
void |
initialize(PegasusBag bag)
Initializes the Code Generator implementation. |
protected void |
initializeDagFileWriter(String filename,
DagInfo dinfo)
Initializes the file handler to the dag file and writes the header to it. |
protected void |
printDagString(String str)
Writes a string to the dag file. |
void |
reset()
Resets the Code Generator implementation. |
boolean |
startMonitoring()
Starts monitoring of the workflow by invoking a workflow monitor daemon tailstatd. |
protected void |
writeDagFileTail(DagInfo dinfo)
It writes the relations making up the DAG in the dag file and and closes the file handle to it. |
protected void |
writeDOTFile(String filename,
ADag dag)
Writes out the DOT file in the submit directory. |
protected String |
writeOutBraindump(File directory,
ADag workflow,
String dax,
String dagFile)
Writes out the braindump.txt file for a partition in the partition submit directory. |
| Methods inherited from class org.griphyn.cPlanner.code.generator.Abstract |
|---|
getFileBaseName, getWriter |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String mSeparator
protected LogManager mLogger
protected TransformationCatalog mTCHandle
private PoolInfoProvider mPoolHandle
protected String mPoolClass
private Map mProjectMap
private Map mQueueMap
private Map mWalltimeMap
protected PrintWriter mDagWriter
protected String mTempLogFile
protected boolean mDone
protected ADag mConcreteWorkflow
protected CondorStyleFactory mStyleFactory
protected GridStartFactory mGridStartFactory
protected boolean mInitializeGridStart
| Constructor Detail |
|---|
public CondorGenerator()
| Method Detail |
|---|
public void initialize(PegasusBag bag)
throws CodeGeneratorException
initialize in interface CodeGeneratorinitialize in class Abstractbag - the bag of initialization objects.
CodeGeneratorException - in case of any error occuring code generation.
public void generateCode(ADag dag)
throws CodeGeneratorException
dag - the concrete workflow.
CodeGeneratorException - in case of any error occuring code generation.
public void generateCode(ADag dag,
SubInfo job)
throws CodeGeneratorException
dag - the dag of which the job is a part of.job - the SubInfo object holding the information about
that particular job.
CodeGeneratorException - in case of any error occuring code generation.
public boolean startMonitoring()
throws VTorInUseException
startMonitoring in interface CodeGeneratorstartMonitoring in class AbstractVTorInUseException - in case the method is called before the
submit files have been generated.
public void reset()
throws CodeGeneratorException
reset in interface CodeGeneratorreset in class AbstractCodeGeneratorException - in case of any error occuring code generation.private Map constructMap(String propValue)
propValue - the value of the property got from the properties file.
protected void initializeDagFileWriter(String filename,
DagInfo dinfo)
throws CodeGeneratorException
filename - basename of dag file to be written.dinfo - object containing daginfo of type DagInfo .
CodeGeneratorException - in case of any error occuring code generation.
protected void writeDOTFile(String filename,
ADag dag)
throws CodeGeneratorException
filename - basename of dot file to be written .dag - the ADag object.
CodeGeneratorException - in case of any error occuring code generation.
protected void writeDagFileTail(DagInfo dinfo)
throws CodeGeneratorException
dinfo - object containing daginfo of type DagInfo.
CodeGeneratorException
protected void printDagString(String str)
throws CodeGeneratorException
str - The String to be printed to the dag file.
CodeGeneratorExceptionprotected String getLogFileName()
protected String getLogFileSymlinkName(ADag dag)
dag - the concrete workflow.
protected String writeOutBraindump(File directory,
ADag workflow,
String dax,
String dagFile)
throws IOException
directory - the directory in which the braindump file needs to
be written to.workflow - the concerte workflow.dax - the corresponding DAX file containing the abstract workflow.dagFile - the basename of the .dag file that is written out while
generating output.
IOException - in case of error while writing out file.
protected boolean generateLogFileSymlink(String logFile,
String symlink)
logFile - the full path to the log file.symlink - the full path to the symlink.
protected String getDAGFilename(ADag dag,
String suffix)
dag - the dag for which the .dag file has to be created.suffix - the suffix to be applied at the end.
protected String getDAGMANOutFilename(ADag dag)
dag - the DAG containing the concrete workflow
protected void concreteDagEmpty(String filename,
ADag dag)
throws CodeGeneratorException
filename - Filename of the dag to be written of type String.dag - the concrete dag that is empty.
CodeGeneratorException - in case of any error occuring code generation.
protected void handleCondorVarForJob(SubInfo sinfo)
throws CodeGeneratorException
sinfo - The SubInfo object containing the information about the job.
CodeGeneratorException
protected void handleTransferOfExecutable(SubInfo sinfo)
throws CodeGeneratorException
sinfo - the SubInfo containing the job description.
CodeGeneratorException
protected void applyStyle(SubInfo job,
PrintWriter writer)
throws CodeGeneratorException
job - the job on which the style needs to be applied.writer - the PrintWriter stream to the submit file for the job.
CodeGeneratorException - in case of any error occuring code generation.protected void handleEnvVarForJob(SubInfo sinfo)
sinfo - The SubInfo object containing the information about the job.protected void handleGlobusRSLForJob(SubInfo sinfo)
sinfo - The SubInfo object containing the information about the job.
private String gridstart(PrintWriter writer,
SubInfo job,
boolean isGlobusJob)
throws CodeGeneratorException
writer - is an open stream for the Condor submit file.job - is the job information structure.isGlobusJob - is true, if the job generated a
line universe = globus, and thus runs remotely.
Set to false, if the job runs on the submit
host in any way.
CodeGeneratorException - in case of any error occuring code generation.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||