1 #ifndef __ARC_JOBDESCRIPTION_H__
2 #define __ARC_JOBDESCRIPTION_H__
12 #include <arc/DateTime.h>
13 #include <arc/XMLNode.h>
15 #include <arc/compute/Software.h>
35 class JobDescriptionParserPluginLoader;
36 class ExecutionTarget;
45 OptIn<T>() : optIn(
false) {}
46 OptIn<T>(
const T& t) : v(t), optIn(
false) {}
47 OptIn<T>(
const T& t,
bool o) : v(t), optIn(o) {}
48 OptIn<T>(
const OptIn<T>& ot) : v(ot.v), optIn(ot.optIn) {}
50 OptIn<T>& operator=(
const OptIn<T>& ot) { v = ot.v; optIn = ot.optIn;
return *
this; }
51 OptIn<T>& operator=(
const T& t) { v = t; optIn =
false;
return *
this; }
53 operator T()
const {
return v; }
66 Range<T>() : min(0), max(0) {}
67 Range<T>(
const T& t) : min(t), max(t) {}
68 operator T(
void)
const {
return max; }
70 Range<T>& operator=(
const Range<T>& t) { min = t.min; max = t.max;
return *
this; };
71 Range<T>& operator=(
const T& t) { max = t;
return *
this; };
84 ScalableTime<T>() : benchmark(
"", -1.) {}
85 ScalableTime<T>(
const T& t) : range(t) {}
87 std::pair<std::string, double> benchmark;
96 class ScalableTime<int> {
98 ScalableTime<int>() : benchmark(
"", -1.) {}
99 ScalableTime<int>(
const int& t) : range(t) {}
101 std::pair<std::string, double> benchmark;
104 int scaleMin(
double s)
const {
return (
int)(range.min*benchmark.second/s); }
105 int scaleMax(
double s)
const {
return (
int)(range.max*benchmark.second/s); }
119 class JobIdentificationType {
121 JobIdentificationType() :
186 class ExecutableType {
232 class RemoteLoggingType {
234 RemoteLoggingType() :
optional(false) {}
271 class NotificationType {
273 NotificationType() {}
283 std::list<std::string>
States;
299 ApplicationType& operator=(
const ApplicationType&);
340 std::list< std::pair<std::string, std::string> >
Environment;
400 std::list<NotificationType> Notification;
427 ExclusiveExecution(EE_DEFAULT) {}
445 } ExclusiveExecution;
452 class DiskSpaceRequirementType {
454 DiskSpaceRequirementType() :
484 enum SessionDirectoryAccessMode {
494 enum NodeAccessType {
505 class ParallelEnvironmentType {
507 ParallelEnvironmentType() :
534 std::multimap<std::string, std::string>
Options;
555 ResourcesType& operator=(
const ResourcesType&);
656 SourceType(
const URL& u):
URL(u) {};
657 SourceType(
const std::string& s):
URL(s) {};
658 SourceType& operator=(
const URL& u) { URL::operator=(u);
return *
this; };
659 SourceType& operator=(
const std::string& s) { URL::operator=(s);
return *
this; };
660 std::string DelegationID;
766 std::list<SourceType> Sources;
814 operator bool(
void) {
return res; };
818 const std::string&
str(
void) {
return desc; };
842 class JobDescription {
844 friend class JobDescriptionParserPlugin;
845 JobDescription() : alternatives(), current(alternatives.begin()) {};
847 JobDescription(
const JobDescription& j,
bool withAlternatives =
true);
850 JobDescription(
const long int& ptraddr);
855 JobDescription&
operator=(
const JobDescription& j);
873 const std::list<JobDescription>&
GetAlternatives()
const {
return alternatives; }
895 void RemoveAlternatives();
917 static JobDescriptionResult
Parse(
const std::string& source, std::list<JobDescription>& jobdescs,
const std::string& language =
"",
const std::string& dialect =
"");
919 static JobDescriptionResult ParseFromFile(
const std::string& filename, std::list<JobDescription>& jobdescs,
const std::string& language =
"",
const std::string& dialect =
"");
929 JobDescriptionResult
UnParse(std::string& product, std::string language,
const std::string& dialect =
"")
const;
959 JobDescriptionResult
SaveToStream(std::ostream& out,
const std::string& format)
const;
997 static bool GetTestJob(
int testid, JobDescription& jobdescription);
1045 std::string sourceLanguage;
1047 std::list<JobDescription> alternatives;
1048 std::list<JobDescription>::iterator current;
1050 static Glib::Mutex jdpl_lock;
1058 #endif // __ARC_JOBDESCRIPTION_H__