jdl-api-cpp-3.4.4
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
glite::jdl::AdConverter Class Reference

utilities for converting classad expression into requestad known classes and to create JobAd/ExpDagAd templates instances More...

#include <glite/jdl/adconverter.h>

Public Types

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  attribute { ADCONV_ATTR_INPUTSB =1, ADCONV_ATTR_INPUTDATA =2, ADCONV_ATTR_ARGUMENTS =4 }
 

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="")
 
static JobAdcreateStringParametricTemplate (std::vector< std::string > parametrised, std::vector< std::string > parameters, const std::string &requirements, const std::string &rank, const std::string &vo="")
 
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="")
 
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="")
 
static CollectionAdcreateCollectionTemplate (unsigned int jobNumber, const std::string &requirements, const std::string &rank, const std::string &vo="")
 
static CollectionAdcreateCollectionFromPath (const std::string &path, const std::string &vo="")
 
static AdcreateDagAdFromPath (const std::string &path, const std::string &vo="")
 
static ExpDagAdcreateDagAdFromPath (NodeStruct dependencies, const std::string &path, const std::string &vo="")
 
Ad conversion:
static ExpDagAdpart2dag (const std::string &jdl)
 
static ExpDagAdpart2dag (Ad *ad)
 
static ExpDagAdcollection2dag (const std::string &jdl)
 
static ExpDagAdcollection2dag (Ad *ad)
 
static ExpDagAdbulk2dag (const std::string &jdl, unsigned int maxCycles=0)
 
static ExpDagAdbulk2dag (Ad *ad, unsigned int maxCycles_i=0)
 

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
 

Detailed Description

utilities for converting classad expression into requestad known classes and to create JobAd/ExpDagAd templates instances

AdConverter deifines a series of utiliteis as separate static methods that allow the user to convert a Jdl into several different classad representation. 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 aless.nosp@m.andr.nosp@m.o.mar.nosp@m.asch.nosp@m.ini@d.nosp@m.atam.nosp@m.at.it

Member Enumeration Documentation

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 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 ( const std::string &  jdl,
unsigned int  maxCycles = 0 
)
static

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

Parameters
jdlstring representing the classad of a parametric job
maxCyclesthe max number of cycles over parameters to be done (0 means all)
Returns
the converted ExpDagAd instance
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
adthe ClassAd representing the JDL of a parametric job
maxCycles_ithe max number of cycles over parameters to be done (0 means all)
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
jdlstring representing the classad of a collection of jobs
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
adthe ClassAd representing the JDL 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
paththe path (including wildcards) where to look for JDL files to be added to the collection
vothe 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
jobNumberthe number of jobs to be created for the collection
requirementsa string representing the expression describing the requirements (which is an attribute of boolean type) for all the jobs in the collection
ranka string representing the expression for the rank (which is an attribute of double type) for all the jobs in the collection
vothe VirtualOrganisation name to be used by all the jobs in the collection
Returns
the Collection 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
paththe path (including wildcards) where to look for JDL files to be added to the DagAd
vothe VirtualOrganisation name to be used by all the jobs in the collection
Returns
the Ad 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
dependenciesthe dependency structure of the dag: each node must list all the nodes that depends on it.
paththe path (including wildcards) where to look for JDL files to be added to the DagAd
vothe VirtualOrganisation name to be used by all the jobs in the collection
Returns
the ExpDagAd 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
dependenciesthe dependency structure of the dag: each node must list all the nodes that depends on it.
requirementsa string representing the expression describing the requirements (which is an attribute of boolean type) for all the nodes of the dag
ranka string representing the expression for the rank (which is an attribute of double type) for all the nodes of the dag
vothe VirtualOrganisation name to be used for all the nodes of the dag
Returns
the ExpDagAd template istance
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
parametrisedall the attributes that contains reference to a parameter.
param_numberthe 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
requirementsa string representing the expression describing all the Job requirements (which is an attribute of boolean type)
ranka string representing the expression for the rank (which is an attribute of double type) of the resource
vothe VirtualOrganisation name to be used
Returns
the JobAd of a parametric job
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::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
typethe jobtype of the job. Multiple jobtype can be specified toghether through the bitwise '|' operator ( as specified in jobtype)
executablethe 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
argumentsa string representing the arguments (if needed) of the executable file (empty "" string if not needed)
requirementsa string representing the expression describing all the Job requirements (which is an attribute of boolean type)
ranka string representing the expression for the rank (which is an attribute of double type) of the resource
vothe VirtualOrganisation name to be used
Returns
the JobAd template instance
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
parametrisedall the attributes that contains reference to a parameter.
parametersa vector containing all the parameters
requirementsa string representing the expression describing all the Job requirements (which is an attribute of boolean type)
ranka string representing the expression for the rank (which is an attribute of double type) of the resource
vothe VirtualOrganisation name to be used
Returns
the JobAd of a parametric job
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 ExpDagAd* glite::jdl::AdConverter::part2dag ( const std::string &  jdl)
static

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

Parameters
jdlstring representing the classad of a partitioner job
Returns
the converted ExpDagAd instance
static ExpDagAd* glite::jdl::AdConverter::part2dag ( Ad ad)
static

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

Parameters
adthe ClassAd representing the JDL 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: