glite::jdl::AdConverter Class Reference

#include <src/requestad/adconverter.h>


Detailed Description

AdConverter deifines a series of utiliteis as separate static methods that allow the user to convert a Jdl into several different classad representation.utilities for converting classad expression into requestad known classes and to create JobAd/ExpDagAd templates instances.

it manages partitioner, collection and parametric jdls converting internally into an ExpDagAd clas instance. It also provide a set of utilities to easily create valid jdl template for simple Jobs (even with jobtype different from "normal") Dags or Collection of jobs; just by specifing a few parameters.

Version:
0.1
Date:
2004
Author:
Alessandro Maraschini <alessandro.maraschini@datamat.it>


Public Types

 ADCONV_JOBTYPE_NORMAL = 1
 ADCONV_JOBTYPE_PARAMETRIC = 2
 ADCONV_JOBTYPE_INTERACTIVE = 4
 ADCONV_JOBTYPE_MPICH = 8
 ADCONV_JOBTYPE_PARTITIONABLE = 16
 ADCONV_JOBTYPE_CHECKPOINTABLE = 32
 ADCONV_ATTR_INPUTSB = 1
 ADCONV_ATTR_INPUTDATA = 2
 ADCONV_ATTR_ARGUMENTS = 4
enum  jobtype {
  ADCONV_JOBTYPE_NORMAL = 1, ADCONV_JOBTYPE_PARAMETRIC = 2, ADCONV_JOBTYPE_INTERACTIVE = 4, ADCONV_JOBTYPE_MPICH = 8,
  ADCONV_JOBTYPE_PARTITIONABLE = 16, ADCONV_JOBTYPE_CHECKPOINTABLE = 32
}
 Enum used to specify the Jobtype of a job Notice: muliple job type can be obtained by bitwise '|' operator. More...
enum  attribute { ADCONV_ATTR_INPUTSB = 1, ADCONV_ATTR_INPUTDATA = 2, ADCONV_ATTR_ARGUMENTS = 4 }
 Enum used to specify which attribute(s) are to be parametrised Notice: muliple attributes can be obtained by bitwise '|' operator. More...

Static Public Member Functions

Template creation:
static JobAdcreateJobTemplate (int type, const std::string &executable, const std::string &arguments, const std::string &requirements, const std::string &rank, const std::string &vo="")
 Create a valid JDL ready for submission.
static JobAdcreateStringParametricTemplate (std::vector< std::string > parametrised, std::vector< std::string > parameters, const std::string &requirements, const std::string &rank, const std::string &vo="")
 Create a valid Parametric.
static JobAdcreateStringParametricTemplate (int parametrised, std::vector< std::string > parameters, const std::string &requirements, const std::string &rank, const std::string &vo="")
static JobAdcreateIntParametricTemplate (std::vector< std::string > parametrised, int param_number, int param_start, int param_step, const std::string &requirements, const std::string &rank, const std::string &vo="")
 Create a valid Parametric.
static JobAdcreateIntParametricTemplate (int parametrised, int param_number, int param_start, int param_step, const std::string &requirements, const std::string &rank, const std::string &vo="")
static ExpDagAdcreateDAGTemplate (NodeStruct dependencies, const std::string &requirements, const std::string &rank, const std::string &vo="")
 Create a valid template JDL for a Dag.
static CollectionAdcreateCollectionTemplate (unsigned int jobNumber, const std::string &requirements, const std::string &rank, const std::string &vo="")
 Create a valid template JDL for a Collection of jobs.
static CollectionAdcreateCollectionFromPath (const std::string &path, const std::string &vo="")
 Load all the JDL files stored in a specified path and put them all inside a collection of jobs.
static AdcreateDagAdFromPath (const std::string &path, const std::string &vo="")
 Load all the JDL files stored in a specified path and create an Ad instance that represents a DagAd with enmpty dependencies.
static ExpDagAdcreateDagAdFromPath (NodeStruct dependencies, const std::string &path, const std::string &vo="")
 Load all the JDL files stored in a specified path and create an ExpDagAd instance.
Ad conversion:
static ExpDagAdpart2dag (const std::string &jdl)
 utility that converts the jdl of a partitioner job into a DagAd
static ExpDagAdpart2dag (Ad *ad)
 utility that converts the jdl of a partitioner job into a DagAd
static ExpDagAdcollection2dag (const std::string &jdl)
 utility that converts the jdl of a collection into a DagAd
static ExpDagAdcollection2dag (Ad *ad)
 utility that converts the jdl of a collection into a DagAd
static ExpDagAdbulk2dag (const std::string &jdl, unsigned int maxCycles=0)
 utility that converts the jdl of a parametric job into a DagAd
static ExpDagAdbulk2dag (Ad *ad, unsigned int maxCycles_i=0)
 utility that converts the jdl of a parametric job into a DagAd

Static Public Attributes

Static Const String Values:
static const std::string VALUES
static const std::string VALUE
static const std::string NODE
static const std::string SIMPLE_NODE_TYPE
static const std::string PARAMETRIC_PARAMETERS
static const std::string PARAMETRIC_START
static const std::string PARAMETRIC_STEP
static const std::string PARAMETER_VALUE


Member Enumeration Documentation

enum glite::jdl::AdConverter::attribute

Enum used to specify which attribute(s) are to be parametrised Notice: muliple attributes can be obtained by bitwise '|' operator.

See also:
createStringParametricTemplate

createIntParametricTemplate

Enumerator:
ADCONV_ATTR_INPUTSB 
ADCONV_ATTR_INPUTDATA 
ADCONV_ATTR_ARGUMENTS 

enum glite::jdl::AdConverter::jobtype

Enum used to specify the Jobtype of a job Notice: muliple job type can be obtained by bitwise '|' operator.

See also:
createJobTemplate
Enumerator:
ADCONV_JOBTYPE_NORMAL 
ADCONV_JOBTYPE_PARAMETRIC 
ADCONV_JOBTYPE_INTERACTIVE 
ADCONV_JOBTYPE_MPICH 
ADCONV_JOBTYPE_PARTITIONABLE 
ADCONV_JOBTYPE_CHECKPOINTABLE 


Member Function Documentation

static ExpDagAd* glite::jdl::AdConverter::bulk2dag ( Ad ad,
unsigned int  maxCycles_i = 0 
) [static]

utility that converts the jdl of a parametric job into a DagAd

Parameters:
ad the ClassAd representing the JDL of a parametric job
maxCycles_i the max number of cycles over parameters to be done (0 means all)
Returns:
the converted ExpDagAd instance

static ExpDagAd* glite::jdl::AdConverter::bulk2dag ( const std::string &  jdl,
unsigned int  maxCycles = 0 
) [static]

utility that converts the jdl of a parametric job into a DagAd

Parameters:
jdl string representing the classad of a parametric job
maxCycles the max number of cycles over parameters to be done (0 means all)
Returns:
the converted ExpDagAd instance

static ExpDagAd* glite::jdl::AdConverter::collection2dag ( Ad ad  )  [static]

utility that converts the jdl of a collection into a DagAd

Parameters:
ad the ClassAd representing the JDL of a collection of jobs
Returns:
the converted ExpDagAd instance

static ExpDagAd* glite::jdl::AdConverter::collection2dag ( const std::string &  jdl  )  [static]

utility that converts the jdl of a collection into a DagAd

Parameters:
jdl string representing the classad of a collection of jobs
Returns:
the converted ExpDagAd instance

static CollectionAd* glite::jdl::AdConverter::createCollectionFromPath ( const std::string &  path,
const std::string &  vo = "" 
) [static]

Load all the JDL files stored in a specified path and put them all inside a collection of jobs.

Parameters:
path the path (including wildcards) where to look for JDL files to be added to the collection
vo the VirtualOrganisation name to be used by all the jobs in the collection
Returns:
the Collection created

static CollectionAd* glite::jdl::AdConverter::createCollectionTemplate ( unsigned int  jobNumber,
const std::string &  requirements,
const std::string &  rank,
const std::string &  vo = "" 
) [static]

Create a valid template JDL for a Collection of jobs.

Parameters:
jobNumber the number of jobs to be created for the collection
requirements a string representing the expression describing the requirements (which is an attribute of boolean type) for all the jobs in the collection
rank a string representing the expression for the rank (which is an attribute of double type) for all the jobs in the collection
vo the VirtualOrganisation name to be used by all the jobs in the collection
Returns:
the Collection created

static ExpDagAd* glite::jdl::AdConverter::createDagAdFromPath ( NodeStruct  dependencies,
const std::string &  path,
const std::string &  vo = "" 
) [static]

Load all the JDL files stored in a specified path and create an ExpDagAd instance.

Parameters:
dependencies the dependency structure of the dag: each node must list all the nodes that depends on it.
path the path (including wildcards) where to look for JDL files to be added to the DagAd
vo the VirtualOrganisation name to be used by all the jobs in the collection
Returns:
the ExpDagAd created

static Ad* glite::jdl::AdConverter::createDagAdFromPath ( const std::string &  path,
const std::string &  vo = "" 
) [static]

Load all the JDL files stored in a specified path and create an Ad instance that represents a DagAd with enmpty dependencies.

Parameters:
path the path (including wildcards) where to look for JDL files to be added to the DagAd
vo the VirtualOrganisation name to be used by all the jobs in the collection
Returns:
the Ad created

static ExpDagAd* glite::jdl::AdConverter::createDAGTemplate ( NodeStruct  dependencies,
const std::string &  requirements,
const std::string &  rank,
const std::string &  vo = "" 
) [static]

Create a valid template JDL for a Dag.

Parameters:
dependencies the dependency structure of the dag: each node must list all the nodes that depends on it.
requirements a string representing the expression describing the requirements (which is an attribute of boolean type) for all the nodes of the dag
rank a string representing the expression for the rank (which is an attribute of double type) for all the nodes of the dag
vo the VirtualOrganisation name to be used for all the nodes of the dag
Returns:
the ExpDagAd template istance

static JobAd* glite::jdl::AdConverter::createIntParametricTemplate ( int  parametrised,
int  param_number,
int  param_start,
int  param_step,
const std::string &  requirements,
const std::string &  rank,
const std::string &  vo = "" 
) [static]

static JobAd* glite::jdl::AdConverter::createIntParametricTemplate ( std::vector< std::string >  parametrised,
int  param_number,
int  param_start,
int  param_step,
const std::string &  requirements,
const std::string &  rank,
const std::string &  vo = "" 
) [static]

Create a valid Parametric.

Parameters:
parametrised all the attributes that contains reference to a parameter.
param_number the number of different parameters to be created
param_start (default value is 0) the starting point where to begin to parametrise
param_step (default value is 1) the step between one parameter and the next one among param_start
requirements a string representing the expression describing all the Job requirements (which is an attribute of boolean type)
rank a string representing the expression for the rank (which is an attribute of double type) of the resource
vo the VirtualOrganisation name to be used
Returns:
the JobAd of a parametric job

static JobAd* glite::jdl::AdConverter::createJobTemplate ( int  type,
const std::string &  executable,
const std::string &  arguments,
const std::string &  requirements,
const std::string &  rank,
const std::string &  vo = "" 
) [static]

Create a valid JDL ready for submission.

Parameters:
type the jobtype of the job. Multiple jobtype can be specified toghether through the bitwise '|' operator ( as specified in jobtype)
executable the simple file name to be executed (if local) or the full path if stored in the remote machine. In the former case the full path of the file must be specified in the inputsandbox attribute
arguments a string representing the arguments (if needed) of the executable file (empty "" string if not needed)
requirements a string representing the expression describing all the Job requirements (which is an attribute of boolean type)
rank a string representing the expression for the rank (which is an attribute of double type) of the resource
vo the VirtualOrganisation name to be used
Returns:
the JobAd template instance

static JobAd* glite::jdl::AdConverter::createStringParametricTemplate ( int  parametrised,
std::vector< std::string >  parameters,
const std::string &  requirements,
const std::string &  rank,
const std::string &  vo = "" 
) [static]

static JobAd* glite::jdl::AdConverter::createStringParametricTemplate ( std::vector< std::string >  parametrised,
std::vector< std::string >  parameters,
const std::string &  requirements,
const std::string &  rank,
const std::string &  vo = "" 
) [static]

Create a valid Parametric.

Parameters:
parametrised all the attributes that contains reference to a parameter.
parameters a vector containing all the parameters
requirements a string representing the expression describing all the Job requirements (which is an attribute of boolean type)
rank a string representing the expression for the rank (which is an attribute of double type) of the resource
vo the VirtualOrganisation name to be used
Returns:
the JobAd of a parametric job

static ExpDagAd* glite::jdl::AdConverter::part2dag ( Ad ad  )  [static]

utility that converts the jdl of a partitioner job into a DagAd

Parameters:
ad the ClassAd representing the JDL of a partitioner job
Returns:
the converted ExpDagAd instance

static ExpDagAd* glite::jdl::AdConverter::part2dag ( const std::string &  jdl  )  [static]

utility that converts the jdl of a partitioner job into a DagAd

Parameters:
jdl string representing the classad of a partitioner job
Returns:
the converted ExpDagAd instance


Field Documentation

const std::string glite::jdl::AdConverter::NODE [static]

const std::string glite::jdl::AdConverter::PARAMETER_VALUE [static]

const std::string glite::jdl::AdConverter::PARAMETRIC_PARAMETERS [static]

const std::string glite::jdl::AdConverter::PARAMETRIC_START [static]

const std::string glite::jdl::AdConverter::PARAMETRIC_STEP [static]

const std::string glite::jdl::AdConverter::SIMPLE_NODE_TYPE [static]

const std::string glite::jdl::AdConverter::VALUE [static]

const std::string glite::jdl::AdConverter::VALUES [static]


The documentation for this class was generated from the following file:
Generated on Wed May 16 15:17:09 2012 for glite-jdl-api-cpp-3.2.5 by  doxygen 1.4.7