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>
28 class JobDescriptionParserPluginLoader;
29 class ExecutionTarget;
39 OptIn<T>(
const T& t) : v(t), optIn(
false) {}
40 OptIn<T>(
const T& t,
bool o) : v(t), optIn(o) {}
43 OptIn<T>& operator=(
const OptIn<T>& ot) { v = ot.v; optIn = ot.optIn;
return *
this; }
44 OptIn<T>& operator=(
const T& t) { v = t; optIn =
false;
return *
this; }
46 operator T()
const {
return v; }
60 Range<T>(
const T& t) : min(t), max(t) {}
61 operator T(
void)
const {
return max; }
63 Range<T>& operator=(
const Range<T>& t) { min = t.min; max = t.max;
return *
this; };
64 Range<T>& operator=(
const T& t) { max = t;
return *
this; };
80 std::pair<std::string, double> benchmark;
94 std::pair<std::string, double> benchmark;
97 int scaleMin(
double s)
const {
return (
int)(range.min*benchmark.second/s); }
98 int scaleMax(
double s)
const {
return (
int)(range.max*benchmark.second/s); }
246 std::list<std::string> States;
258 ProcessingStartTime(-1),
294 std::list< std::pair<std::string, std::string> > Environment;
330 Time ProcessingStartTime;
332 std::list<NotificationType> Notification;
333 std::list<URL> CredentialService;
347 ExclusiveExecution(EE_DEFAULT) {}
350 enum ExclusiveExecutionType {
354 } ExclusiveExecution;
387 enum SessionDirectoryAccessMode {
397 enum NodeAccessType {
411 ProcessesPerSlot(-1),
412 ThreadsPerProcess(-1) {}
415 int ProcessesPerSlot;
416 int ThreadsPerProcess;
417 std::multimap<std::string, std::string> Options;
427 IndividualPhysicalMemory(-1),
428 IndividualVirtualMemory(-1),
430 SessionDirectoryAccess(SDAM_NONE),
431 IndividualCPUTime(-1),
433 IndividualWallTime(-1),
434 TotalWallTime(IndividualWallTime),
435 NodeAccess(NAT_NONE) {}
439 std::string Platform;
440 std::string NetworkInfo;
445 SessionDirectoryAccessMode SessionDirectoryAccess;
450 NodeAccessType NodeAccess;
469 SourceType& operator=(
const URL& u) { URL::operator=(u);
return *
this; };
470 SourceType& operator=(
const std::string& s) { URL::operator=(s);
return *
this; };
471 std::string DelegationID;
561 InputFileType() : Name(
""), IsExecutable(
false), FileSize(-1) {};
571 std::list<SourceType> Sources;
613 operator bool(
void) {
return res; };
614 bool operator!(
void) {
return !res; };
615 const std::string& str(
void) {
return desc; };
642 JobDescription() : alternatives(), current(alternatives.begin()) {};
655 bool HasAlternatives()
const {
return !alternatives.empty(); }
656 const std::list<JobDescription>& GetAlternatives()
const {
return alternatives; }
657 std::list<JobDescription>& GetAlternatives() {
return alternatives; }
658 std::list<JobDescription> GetAlternativesCopy()
const {
return alternatives; }
659 bool UseAlternative();
662 void RemoveAlternatives();
684 static JobDescriptionResult Parse(
const std::string& source, std::list<JobDescription>& jobdescs,
const std::string& language =
"",
const std::string& dialect =
"");
686 static JobDescriptionResult ParseFromFile(
const std::string& filename, std::list<JobDescription>& jobdescs,
const std::string& language =
"",
const std::string& dialect =
"");
762 bool Prepare() {
return Prepare(NULL); }
764 static bool GetTestJob(
int testid, JobDescription& jobdescription);
810 std::string sourceLanguage;
812 std::list<JobDescription> alternatives;
813 std::list<JobDescription>::iterator current;
815 static Glib::Mutex jdpl_lock;
823 #endif // __ARC_JOBDESCRIPTION_H__