#define EDG_WLL_SEQ_NORMAL 1
#define EDG_WLL_SEQ_DUPLICATE 11
#define EDG_WLL_SEQ_PBS 2
+#define EDG_WLL_SEQ_CONDOR 3
/**
* initial sequence code for BigHelper
$event->getTypes) {
my $tl = lcfirst $t;
if ($tl =~ m/^pBS/) { $tl = ucfirst $tl; }
+ if ($tl =~ m/^condor/) { $tl = ucfirst $tl; }
gen $indent."edg_wll_${t}Event\t${tl};\n";
}
@@@}
if($ctype{$f->{type}}) {
my $cstr = $ftype eq '_common_' ? 'any' : lcfirst $ftype;
if ($cstr =~ m/^pBS/) { $cstr = ucfirst $cstr; }
+ if ($cstr =~ m/^condor/) { $cstr = ucfirst $cstr; }
my $cname = getName $f 'C';
gen "$indent\tcase Event::".uc($f->{name}).": return(cev->$cstr.$cname);\n";
} elsif (($f->{type} eq "int") &&
# conversion from int to string (well, enum to string)
my $cstr = $ftype eq '_common_' ? 'any' : lcfirst $ftype;
if ($cstr =~ m/^pBS/) { $cstr = ucfirst $cstr; }
+ if ($cstr =~ m/^condor/) { $cstr = ucfirst $cstr; }
my $cname = getName $f 'C';
my $fn = $ftype eq '_common_' ? "" : ucfirst $ftype;
my $c = $fn . ucfirst $f->{name};
#define EDG_WLL_SEQ_NULL "UI=000000:NS=0000000000:WM=000000:BH=0000000000:JSS=000000:LM=000000:LRMS=000000:APP=000000:LBS=000000"
#define EDG_WLL_SEQ_PBS_NULL "TIMESTAMP=00000000000000:POS=0000000000:EV.CODE=000:SRC=?"
+#define EDG_WLL_SEQ_CONDOR_NULL EDG_WLL_SEQ_PBS_NULL
#define EDG_WLL_SEQ_SIZE 103 /* strlen(EDG_WLL_SEQ_NULL)+1 */
#define EDG_WLL_SEQ_PBS_SIZE 57 /* strlen(EDG_WLL_SEQ_PBS_NULL)+1 */
+#define EDG_WLL_SEQ_CONDOR_SIZE EDG_WLL_SEQ_PBS_SIZE
typedef struct _edg_wll_SeqCode {
unsigned int type; /* seq code type */
/* 25-39 POS=%010u: */
/* 40-51 EV.CODE=%03d: */
/* 53-56 SRC=%c */
-
+ char condor[EDG_WLL_SEQ_CONDOR_SIZE];
} edg_wll_SeqCode;
/* non-gsi one-element analogy of connPool for L&B Proxy server */
case EDG_WLL_SEQ_PBS:
ret = strdup(ctx->p_seqcode.pbs);
break;
+ case EDG_WLL_SEQ_CONDOR:
+ ret = strdup(ctx->p_seqcode.condor);
+ break;
default:
edg_wll_SetError(ctx,EINVAL,"edg_wll_GetSequenceCode(): sequence code type");
return NULL;
else
strncpy(ctx->p_seqcode.pbs, seqcode_str, sizeof(ctx->p_seqcode.pbs));
break;
+ case EDG_WLL_SEQ_CONDOR:
+ if (!seqcode_str)
+ memset(&ctx->p_seqcode.condor, 0, sizeof ctx->p_seqcode.condor);
+ else
+ strncpy(ctx->p_seqcode.condor, seqcode_str, sizeof(ctx->p_seqcode.condor));
+ break;
default:
return edg_wll_SetError(ctx, EINVAL,
"edg_wll_SetSequenceCode(): unrecognized value of seq_type parameter");
my $tu = uc $t;
my $tl = lcfirst $t;
if ($tl =~ m/^pBS/) { $tl = ucfirst $tl; }
+ if ($tl =~ m/^condor/) { $tl = ucfirst $tl; }
gen $indent."case EDG_WLL_EVENT_$tu : \n";
selectType $event $t;
for ($event->getFieldsOrdered) {
my $tu = uc $t;
my $tl = lcfirst $t;
if ($tl =~ m/^pBS/) { $tl = ucfirst $tl; }
+ if ($tl =~ m/^condor/) { $tl = ucfirst $tl; }
gen $indent."case EDG_WLL_EVENT_$tu :\n";
selectType $event $t;
for ($event->getFieldsOrdered) {
my $tu = uc $t;
my $tl = lcfirst $t;
if ($tl =~ m/^pBS/) { $tl = ucfirst $tl; }
+ if ($tl =~ m/^condor/) { $tl = ucfirst $tl; }
my $misuse = "if (eventcode != EDG_WLL_EVENT_$tu ) MISUSE";
selectType $event $t;
for ($event->getFieldsOrdered) {
my $tu = uc $t;
my $tl = lcfirst $t;
if ($tl =~ m/^pBS/) { $tl = ucfirst $tl; }
+ if ($tl =~ m/^condor/) { $tl = ucfirst $tl; }
my $free = "";
gen $indent."case EDG_WLL_EVENT_$tu :\n";
gen "\t\{";
my $tu = uc $t;
my $tl = lcfirst $t;
if ($tl =~ m/^pBS/) { $tl = ucfirst $tl; }
+ if ($tl =~ m/^condor/) { $tl = ucfirst $tl; }
gen $indent."case EDG_WLL_EVENT_$tu :\n";
selectType $event $t;
for ($event->getFieldsOrdered) {
my $tu = uc $t;
my $tl = lcfirst $t;
if ($tl =~ m/^pBS/) { $tl = ucfirst $tl; }
+ if ($tl =~ m/^condor/) { $tl = ucfirst $tl; }
selectType $event $t;
gen "\t\tcase EDG_WLL_EVENT\_$tu :\n";
my $tu = uc $t;
my $tl = lcfirst $t;
if ($tl =~ m/^pBS/) { $tl = ucfirst $tl; }
+ if ($tl =~ m/^condor/) { $tl = ucfirst $tl; }
my $misuse = "if (eventcode != EDG_WLL_EVENT_$tu ) MISUSE";
selectType $event $t;
for ($event->getFieldsOrdered) {
my $tu = uc $t;
my $tl = lcfirst $t;
if ($tl =~ m/^pBS/) { $tl = ucfirst $tl; }
+ if ($tl =~ m/^condor/) { $tl = ucfirst $tl; }
my $free = "";
## gen $indent."case EDG_WLL_EVENT_$tu :\n";
gen "\t\{";
* Internal variables
*/
-static const char null[] = "(nil)";
+static const char null[] = "";
#if defined(USE_LOCALE)
static struct lconv *internalLocaleValues = NULL;
my $ft = $f->{type};
$fo[0] = $fo[0] eq '_common_' ? 'any' : lcfirst $fo[0];
if ($fo[0] =~ m/^pBS/) { $fo[0] = ucfirst $fo[0]; }
+ if ($fo[0] =~ m/^condor/) { $fo[0] = ucfirst $fo[0]; }
gen "$bi XMLCtx->eventsOutGlobal[XMLCtx->position].$fo[0].$t =\n";
gen "$bi \tedg_wll_from_string_to_$ft(XMLCtx);\n";
}
my $u = uc $_;
$_ = lcfirst $_;
if ($_ =~ m/^pBS/) { $_ = ucfirst $_; }
+ if ($_ =~ m/^condor/) { $_ = ucfirst $_; }
gen "$bi case EDG_WLL_EVENT_$u :\n";
gen "$bi \t XMLCtx->eventsOutGlobal[XMLCtx->position].$_.$t =\n";
gen "$bi \t edg_wll_from_string_to_$ft(XMLCtx);\n";
for my $e ($event->getTypesOrdered) {
my $u = lcfirst $e;
if ($u =~ m/^pBS/) { $u = ucfirst $u; }
+ if ($u =~ m/^condor/) { $u = ucfirst $u; }
my $c = getTypeComment $event $e;
gen "\tCPPUNIT_TEST($u);\n";
}
for my $e ($event->getTypesOrdered) {
my $u = lcfirst $e;
if ($u =~ m/^pBS/) { $u = ucfirst $u; }
+ if ($u =~ m/^condor/) { $u = ucfirst $u; }
my $c = getTypeComment $event $e;
gen "\tvoid $u();\n";
}
for my $e ($event->getTypesOrdered) {
my $l = lcfirst $e;
if ($l =~ m/^pBS/) { $l = ucfirst $l; }
+ if ($l =~ m/^condor/) { $l = ucfirst $l; }
my $u = uc $e;
my $c = getTypeComment $event $e;
gen "
PLUGIN_LIBS:= -L${stagedir}/lib -lglite_lb_common_${nothrflavour}\
${classadslib} -lstdc++ ${expatlib} -lexpat\
-PLUGIN_LOBJS:= lb_plugin.lo jobstat_supp.lo process_event.lo lbs_db_supp.lo process_event_pbs.lo
+PLUGIN_LOBJS:= lb_plugin.lo jobstat_supp.lo process_event.lo lbs_db_supp.lo process_event_pbs.lo process_event_condor.lo
BKSERVER_BASE_OBJS:= \
- bkserverd.o il_lbproxy.o get_events.o index.o jobstat.o jobstat_supp.o process_event.o process_event_pbs.o \
+ bkserverd.o il_lbproxy.o get_events.o index.o jobstat.o jobstat_supp.o process_event.o process_event_pbs.o process_event_condor.o \
seqcode.o write2rgma.o lbs_db.o lbs_db_supp.o lb_html.o lb_http.o lb_proto.o lb_xml_parse.o \
lb_xml_parse_V21.o \
lock.o openserver.o query.o userjobs.o db_store.o request.o store.o \
endif
INDEX_OBJS:= index.o index_parse.o jobstat_supp.o lbs_db.o lbs_db_supp.o openserver.o \
- jobstat.o process_event.o process_event_pbs.o query.o lock.o get_events.o write2rgma.o index_lex.o \
+ jobstat.o process_event.o process_event_pbs.o process_event_condor.o query.o lock.o get_events.o write2rgma.o index_lex.o \
lb_authz.o store.o bkindex.o stats.o\
request.o db_store.o srv_purge.o notif_match.o il_lbproxy.o dump.o lb_xml_parse.o il_notification.o lb_proto.o server_state.o lb_xml_parse_V21.o lb_html.o notification.o seqcode.o userjobs.o load.o
HDRS=index.h lb_authz.h lbs_db.h store.h
LIB_OBJS_BK:= \
- il_lbproxy.o get_events.o index.o jobstat.o jobstat_supp.o process_event.o process_event_pbs.o \
+ il_lbproxy.o get_events.o index.o jobstat.o jobstat_supp.o process_event.o process_event_pbs.o process_event_condor.o \
seqcode.o lbs_db.o lbs_db_supp.o lb_html.o lb_http.o lb_proto.o lb_xml_parse.o \
lb_xml_parse_V21.o \
lock.o openserver.o query.o userjobs.o db_store.o request.o store.o \
my $uctype = uc $_;
my $flctype = lcfirst $_;
if ($flctype =~ m/^pBS/) { $flctype = ucfirst $flctype; }
+ if ($flctype =~ m/^condor/) { $flctype = ucfirst $flctype; }
my $frs = $f->{codes} ?
"event->$flctype.$name = edg_wll_StringTo$_${fucname}(value);" :
fromString $f 'value',"event->$flctype.$name";
EDG_WLL_PBS_EVENT_SOURCE__LAST
} edg_wll_PBSEventSource;
+typedef enum _edg_wll_CondorEventSource {
+ EDG_WLL_CONDOR_EVENT_SOURCE_UNDEF = 0,
+ EDG_WLL_CONDOR_EVENT_SOURCE_COLLECTOR,
+ EDG_WLL_CONDOR_EVENT_SOURCE_MASTER,
+ EDG_WLL_CONDOR_EVENT_SOURCE_MATCH,
+ EDG_WLL_CONDOR_EVENT_SOURCE_NEGOTIATOR,
+ EDG_WLL_CONDOR_EVENT_SOURCE_SCHED,
+ EDG_WLL_CONDOR_EVENT_SOURCE_SHADOW,
+ EDG_WLL_CONDOR_EVENT_SOURCE_STARTER,
+ EDG_WLL_CONDOR_EVENT_SOURCE_START,
+ EDG_WLL_CONDOR_EVENT_SOURCE_JOBQUEUE,
+ EDG_WLL_CONDOR_EVENT_SOURCE__LAST
+} edg_wll_CondorEventSource;
+
void destroy_intJobStat(intJobStat *);
void destroy_intJobStat_extension(intJobStat *p);
char * set_component_seqcode(char *s,edg_wll_Source index,int val);
int processEvent(intJobStat *, edg_wll_Event *, int, int, char **);
int processEvent_PBS(intJobStat *, edg_wll_Event *, int, int, char **);
+int processEvent_Condor(intJobStat *, edg_wll_Event *, int, int, char **);
int add_stringlist(char ***, const char *);
int edg_wll_compare_seq(const char *, const char *);
int edg_wll_compare_pbs_seq(const char *,const char *);
+#define edg_wll_compare_condor_seq edg_wll_compare_pbs_seq
edg_wll_PBSEventSource get_pbs_event_source(const char *pbs_seq_num);
+edg_wll_CondorEventSource get_condor_event_source(const char *pbs_seq_num);
void init_intJobStat(intJobStat *p);
}
}
+edg_wll_CondorEventSource get_condor_event_source(const char *condor_seq_num) {
+ switch (condor_seq_num[EDG_WLL_SEQ_CONDOR_SIZE-1]) {
+ case 'L': return(EDG_WLL_CONDOR_EVENT_SOURCE_COLLECTOR);
+ case 'M': return(EDG_WLL_CONDOR_EVENT_SOURCE_MASTER);
+ case 'm': return(EDG_WLL_CONDOR_EVENT_SOURCE_MATCH);
+ case 'N': return(EDG_WLL_CONDOR_EVENT_SOURCE_NEGOTIATOR);
+ case 'C': return(EDG_WLL_CONDOR_EVENT_SOURCE_SCHED);
+ case 'H': return(EDG_WLL_CONDOR_EVENT_SOURCE_SHADOW);
+ case 's': return(EDG_WLL_CONDOR_EVENT_SOURCE_STARTER);
+ case 'S': return(EDG_WLL_CONDOR_EVENT_SOURCE_START);
+ case 'j': return(EDG_WLL_CONDOR_EVENT_SOURCE_JOBQUEUE);
+ default: return(EDG_WLL_CONDOR_EVENT_SOURCE_UNDEF);
+ }
+}
+
int edg_wll_compare_seq(const char *a, const char *b)
{
unsigned int c[EDG_WLL_SOURCE__LAST];
my $n = $f->{null};
$t = lcfirst $t;
if ($t =~ m/^pBS/) { $t = ucfirst $t; }
+ if ($t =~ m/^condor/) { $t = ucfirst $t; }
gen "\t\tedg_wll_add_$ft\_to_XMLBody(&pomB, eventsOut[i].$t.$_, \"$_\", $n);\n";
}
gen "\t\tbreak;\n";
my $n = $f->{null};
$t = lcfirst $t;
if ($t =~ m/^pBS/) { $t = ucfirst $t; }
+ if ($t =~ m/^condor/) { $t = ucfirst $t; }
gen "\t\tedg_wll_add_$ft\_to_XMLBody(&pomB, eventsOut[i].$t.$_, \"$_\", $n);\n";
}
gen "\t\tbreak;\n";
case EDG_WLL_REGJOB_PBS:
js->pub.jobtype = EDG_WLL_STAT_PBS;
break;
+ case EDG_WLL_REGJOB_CONDOR:
+ js->pub.jobtype = EDG_WLL_STAT_CONDOR;
+ break;
default:
asprintf(errstring,"unknown job type %d in registration",e->regJob.jobtype);
return RET_FAIL;
return processEvent_glite(js,e,ev_seq,strict,errstring);
case EDG_WLL_STAT_PBS:
return processEvent_PBS(js,e,ev_seq,strict,errstring);
+ case EDG_WLL_STAT_CONDOR:
+ return processEvent_Condor(js,e,ev_seq,strict,errstring);
case -1: return RET_UNREG;
default:
asprintf(errstring,"undefined job type %d",js->pub.jobtype);
my $uctype = uc $type;
my $flctype = lcfirst $type;
if ($flctype =~ m/^pBS/) { $flctype = ucfirst $flctype; }
+ if ($flctype =~ m/^condor/) { $flctype = ucfirst $flctype; }
gen qq{
! case EDG_WLL_EVENT_$uctype:
};
$tn = $f->{type};
$native_en = lcfirst $e;
if ($native_en =~ m/^pBS/) { $native_en = ucfirst $native_en; }
+ if ($native_en =~ m/^condor/) { $native_en = ucfirst $native_en; }
$native_fn = $f->{name};
$soap_en = $e;
while ($soap_en =~ /([[:alpha:]]*)_([[:alpha:]_]*)/) {
} else {
$act = lcfirst $name;
if ($act =~ m/^pBS/) { $act = ucfirst $act; }
+ if ($act =~ m/^condor/) { $act = ucfirst $act; }
}
my $usuc = $fn;
$usuc = $1.uc($2).$3 while ($usuc =~ /([^_]*)_([a-z])(.*)/);
my $tu = uc $t;
my $tl = lcfirst $t;
if ($tl =~ m/^pBS/) { $tl = ucfirst $tl; }
+ if ($tl =~ m/^condor/) { $tl = ucfirst $tl; }
selectType $event $t;
gen "\t\tcase EDG_WLL_EVENT\_$tu :\n";
@type CondorMatch Job MATCHed
string owner Owner
- string matched_host Matched host
+ string dest_host Matched host
string preempting Preempting
_optional_
_code_ NOMATCH No match found
_code_ OTHER Other reason
-@type CondorRun Condor EXECUTEed
- string condor_id Condor ID
- string universe Condor Universe
- string scheduler Scheduler ID
- _optional_
- string dest_host Where to run the job
+@type CondorShadowStarted Condor Shadow Started
+ string shadow_host Shadow host
+ port shadow_port Shadow port
+ int shadow_pid PID of shadow process
+ string shadow_status Shadow status
_optional_
- int pid Actual process ID
- _optional_
-
-@type CondorChkpt
- string info Some useful info
-
-@type CondorEvict
- int shadow_exit_status Condor shadow exit status
- string reason reason
-@type CondorTerminate
- int shadow_exit_status Condor shadow exit status
- string reason reason
+@type CondorShadowExited Condor Shadow Exited
+ int shadow_pid PID of shadow process
+ int shadow_exit_status Exit status of shadow process
-@type CondorAbort
- int shadow_exit_status Condor shadow exit status
- string reason reason
-
-@type CondorSuspend
- int shadow_exit_status Condor shadow exit status
- string reason reason
-
-@type CondorUnsuspend
- int shadow_exit_status Condor shadow exit status
- string reason reason
-
-@type CondorHold
- int shadow_exit_status Condor shadow exit status
- string reason reason
-
-@type CondorRelease
- int shadow_exit_status Condor shadow exit status
- string reason reason
-
-@type CondorNodeExecute
- string info Some useful info
+@type CondorStarterStarted Condor Starter Started
+ int starter_pid PID of starter process
+ _optional_
+ string universe Condor Universe
+ _optional_
-@type CondorNodeTerminate
- string info Some useful info
+@type CondorStarterExited Condor Starter Exited
+ int starter_pid PID of starter process
+ _optional_
+ int starter_exit_status Exit status of starter process
+ _optional_
+ int job_pid PID of running job
+ _optional_
+ int job_exit_status Job exit status
+ _optional_
-@type CondorPostSctiptTerminate
- string info Some useful info
+@type CondorResourceUsage Resources requested/consumed
+ int usage Type of record
+ _code_ REQUESTED Requested value
+ _code_ USED Consumed quantity
+ string name Name of resource
+ double quantity The quantity
+ _optional_ Bypass need of 'null value'
+ string unit Units (sec, kB, etc.)
-@type CondorGlobusSubmit
- int status_code
- _code_ OK The job was submitted successfully
- _code_ FAIL Job submission failed
- string info Some useful info
+@type CondorError Any Error occured
+ string error_desc Error reason
-@type CondorGlobusResource
- int status_code Status code
- _code_ UP Resource UP
- _code_ DOWN Resource DOWM
- string info Some useful info
string condor_status Condor job status
string condor_universe Condor job Universe (in job ClassAds)
string condor_owner Job owner
-string condor_pid PID of running job
-int condor_notification Condor notification
-int condor_job_exit_status Job exit status
-int condor_starter_exit_status Condor starter exit status
+int condor_shadow_pid PID of Shadow
int condor_shadow_exit_status Condor shadow exit status (see h/exit.h)
+int condor_starter_pid PID of Starter
+int condor_starter_exit_status Condor starter exit status
+int condor_job_pid PID of running job
+int condor_job_exit_status Job exit status
+string condor_dest_host Hostname of node where job is running
+string condor_reason Glued reasons/errors leading to pending events
+string condor_error_desc Glued error descriptions from error events
@type Submitted Entered by the user to the User Interface or registered by Job Partitioner.