glite/jdl/adconverter.h

Go to the documentation of this file.
00001 /*
00002 Copyright (c) Members of the EGEE Collaboration. 2004.
00003 See http://www.eu-egee.org/partners/ for details on the
00004 copyright holders.
00005 
00006 Licensed under the Apache License, Version 2.0 (the "License");
00007 you may not use this file except in compliance with the License.
00008 You may obtain a copy of the License at
00009 
00010     http://www.apache.org/licenses/LICENSE-2.0
00011 
00012 Unless required by applicable law or agreed to in writing, software
00013 distributed under the License is distributed on an "AS IS" BASIS,
00014 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
00015 either express or implied.
00016 See the License for the specific language governing permissions and
00017 limitations under the License.
00018 */
00019 
00020 #ifndef GLITE_WMS_COMMON_REQUESTAD_ADCONVERTER_H
00021 #define GLITE_WMS_COMMON_REQUESTAD_ADCONVERTER_H
00022 /*
00023  * AdConverter.h
00024  * Copyright (c) 2001 The European Datagrid Project - IST programme, all rights reserved.
00025  * Contributors are mentioned in the code where appropriate.
00026  */
00027 #include "Ad.h"
00028 #include "DAGAd.h"
00029 #include "collectionad.h"
00030 #include "ExpDagAd.h"
00031 #include "JdlAttributeList.h"
00032 #include <classad_distribution.h>
00033 namespace glite {
00034 namespace jdl {
00035 
00041 struct NodeStruct {
00042 
00044         NodeStruct();
00045 
00047         NodeStruct(std::string* name);
00048         
00050         NodeStruct(const NodeStruct& node);
00051         
00053         ~NodeStruct();
00054 
00056         NodeStruct& operator=(const NodeStruct& node);
00057         
00059         std::string* name ;
00060 
00062         std::vector< NodeStruct* > childrenNodes ;
00063         
00064 private:
00065 
00069         void flushMemory(void); 
00070 };
00071 
00072 
00085 class AdConverter {
00086 public:
00091         enum jobtype {
00092                 /*** Normal Jobs */
00093                 ADCONV_JOBTYPE_NORMAL=1,
00094                 /*** Parametric Jobs */
00095                 ADCONV_JOBTYPE_PARAMETRIC =2,
00096                 /***  Interactive Jobs */
00097                 ADCONV_JOBTYPE_INTERACTIVE=4,
00098                 /*** Mpi Jobs */
00099                 ADCONV_JOBTYPE_MPICH=8,
00100                 /*** PArtitionable Jobs */
00101                 ADCONV_JOBTYPE_PARTITIONABLE=16,
00102                 /*** Checkpointable Jobs */
00103                 ADCONV_JOBTYPE_CHECKPOINTABLE =32
00104         };
00111         enum attribute {
00112                 /*** InputSandbox */
00113                 ADCONV_ATTR_INPUTSB=1,
00114                 /*** InputData */
00115                 ADCONV_ATTR_INPUTDATA =2,
00116                 /***  Arguments */
00117                 ADCONV_ATTR_ARGUMENTS=4
00118         };
00119 
00132         static JobAd* createJobTemplate (int type, const std::string &executable, const std::string &arguments,
00133                                         const std::string &requirements, const std::string &rank, const std::string &vo="" ) ;
00142         static JobAd* createStringParametricTemplate(std::vector<std::string> parametrised, std::vector<std::string> parameters,
00143                                                 const std::string &requirements, const std::string &rank, const std::string &vo="");
00144         // DEPRECATED
00145         static JobAd* createStringParametricTemplate(int parametrised ,std::vector<std::string> parameters ,
00146                                                 const std::string &requirements, const std::string &rank , const std::string &vo="" ) ;
00156         static JobAd* createIntParametricTemplate(std::vector<std::string> parametrised, int param_number, int param_start,
00157                                                 int param_step, const std::string &requirements, const std::string &rank,
00158                                                 const std::string &vo="");
00159         // DEPRECATED
00160         static JobAd* createIntParametricTemplate(int parametrised, int param_number, int param_start, int param_step,
00161                                                 const std::string &requirements, const std::string &rank, const std::string &vo="");
00170         static ExpDagAd* createDAGTemplate(NodeStruct dependencies, const std::string &requirements, const std::string &rank,
00171                                                 const std::string &vo="");
00180         static CollectionAd* createCollectionTemplate (unsigned int jobNumber,const std::string &requirements, const std::string &rank,
00181                                         const std::string &vo="") ;
00188         static CollectionAd* createCollectionFromPath ( const std::string &path, const std::string &vo="");
00196         static Ad* createDagAdFromPath (const std::string &path, const std::string &vo="");     
00204         static ExpDagAd* createDagAdFromPath (NodeStruct dependencies, const std::string &path, const std::string &vo="");
00206 
00213         static ExpDagAd* part2dag (  const std::string &jdl ) ;
00219         static ExpDagAd* part2dag ( Ad* ad ) ;
00225         static ExpDagAd* collection2dag ( const std::string &jdl ) ;
00231         static ExpDagAd* collection2dag ( Ad* ad ) ;
00238         static ExpDagAd* bulk2dag (const std::string &jdl, unsigned int maxCycles=0)  ;
00245         static ExpDagAd* bulk2dag (Ad* ad, unsigned int maxCycles_i=0) ;
00247 
00250         static const std::string VALUES ;
00251         static const std::string VALUE ;
00252         static const std::string NODE ;
00253         static const std::string SIMPLE_NODE_TYPE;
00254         static const std::string PARAMETRIC_PARAMETERS ;
00255         static const std::string PARAMETRIC_START;
00256         static const std::string PARAMETRIC_STEP ;
00257         static const std::string PARAMETER_VALUE ;
00258 }; // end AdConverter class
00259 } // jdl namespace
00260 } // glite namespace
00261 
00262 #endif
00263 //EOF

Generated on 7 Mar 2013 for jdl-api-cpp-3.4.1 by  doxygen 1.4.7