failed_subjob.l \
aborted.l \
cancelled.l \
+ cream_registered.l \
+ cream_pending.l
# TODO: missing resubmission_deep
# shallow_resub_complex.l shallow_resub_simple.l shallow_resub_simple2.l \
--- /dev/null
+# macro definition for WAITING state
+
+:cream_registered:
+
+-s CreamCore,-e CREAMStart
+-s CreamCore,-e CREAMStore,--command=CMDSTART,--result=START
--- /dev/null
+# only job registration needed for submitted state
+
/-e ReallyRunning/ { if (checkNOP(3) == 0) logit();
next;}
+/-e CREAMStart/ { logit(); next;}
+/-e CREAMStore/ { logit(); next;}
+/-e CREAMPurge/ { logit(); next;}
+/-e CREAMCall/ { logit(); next;}
+/-e CREAMRunning/ { logit(); next;}
+/-e CREAMReallyRunning/ { logit(); next;}
+/-e CREAMDone/ { logit(); next;}
+/-e CREAMCancel/ { logit(); next;}
+/-e CREAMAbort/ { logit(); next;}
+
# shell escape (for sequence number branching)
/^!/ { print substr($0,2,(length($0) - 1)); }
{
char *src = NULL,*job = NULL,*server = NULL,*seq,*jdl = NULL, *seed = NULL;
int lbproxy = 0;
- int done = 0,num_subjobs = 0,reg_subjobs = 0,i, collection = 0, pbs=0;
+ int done = 0,num_subjobs = 0,reg_subjobs = 0,i, collection = 0, pbs=0, cream=0, type;
edg_wll_Context ctx;
edg_wlc_JobId jobid,*subjobs;
opterr = 0;
do {
- switch (getopt(argc,argv,"xX:s:j:m:n:SCl:e:P")) {
+ switch (getopt(argc,argv,"xX:s:j:m:n:SCl:e:Pc")) {
case 'x': lbproxy = 1; break;
case 'X': lbproxy = 1;
edg_wll_SetParam(ctx, EDG_WLL_PARAM_LBPROXY_STORE_SOCK, optarg);
case 'S': reg_subjobs = 1; break;
case 'C': collection = 1; break;
case 'P': pbs = 1; break;
+ case 'c': cream = 1; break;
case 'l': jdl = (char *) strdup(optarg); break;
case 'e': seed = strdup(optarg); break;
case '?': usage(argv[0]); exit(EINVAL);
}
edg_wll_SetParam(ctx,EDG_WLL_PARAM_SOURCE,edg_wll_StringToSource(src));
- if (lbproxy) {
- if (edg_wll_RegisterJobProxy(ctx,jobid,
- pbs ? EDG_WLL_REGJOB_PBS
- : (num_subjobs ?
- (collection?EDG_WLL_REGJOB_COLLECTION:EDG_WLL_REGJOB_DAG)
+
+ type = pbs ? EDG_WLL_REGJOB_PBS
+ : (cream ? EDG_WLL_REGJOB_CREAM
+ : (num_subjobs ?
+ (collection?EDG_WLL_REGJOB_COLLECTION:EDG_WLL_REGJOB_DAG)
:EDG_WLL_REGJOB_SIMPLE
- ),
+ )
+ );
+
+ if (lbproxy) {
+ if (edg_wll_RegisterJobProxy(ctx,jobid,type,
jdl ? jdl : "blabla", "NS",
num_subjobs,seed,&subjobs))
{
exit(1);
}
} else {
- if (edg_wll_RegisterJobSync(ctx,jobid,
- pbs ? EDG_WLL_REGJOB_PBS
- : (num_subjobs ?
- (collection?EDG_WLL_REGJOB_COLLECTION:EDG_WLL_REGJOB_DAG)
- :EDG_WLL_REGJOB_SIMPLE
- ),
+ if (edg_wll_RegisterJobSync(ctx,jobid,type,
jdl ? jdl : "blabla", "NS",
num_subjobs,seed,&subjobs))
{
// undefine to disable support for -l option
#define ENABLE_REASON_LENGTH
+static int flesh_seq(int);
+
int main(int argc, char *argv[])
{
char /* *fmt,*fname = NULL,*/ *fmt_arg=NULL;
edg_wll_Source src;
edg_wll_EventCode event = EDG_WLL_EVENT_UNDEF;
edg_wlc_JobId jobid = 0;
+ int seq = EDG_WLL_SEQ_NORMAL;
int (*logev)(edg_wll_Context context,
edg_wll_EventCode event,
char *fmt, ...);
edg_wll_SetParam(ctx, EDG_WLL_PARAM_LEVEL,
(deb) ? EDG_WLL_LEVEL_DEBUG : EDG_WLL_LEVEL_SYSTEM);
+ seq = flesh_seq(event);
+
if ( use_lbproxy ) {
if ( !lbproxy_user ) {
edg_wll_GssCred gss_cred = NULL;
}
if ( lbproxy_store_sock )
edg_wll_SetParam(ctx, EDG_WLL_PARAM_LBPROXY_STORE_SOCK, lbproxy_store_sock);
- if (edg_wll_SetLoggingJobProxy(ctx,jobid,code,lbproxy_user,EDG_WLL_SEQ_NORMAL)) {
+ if (edg_wll_SetLoggingJobProxy(ctx,jobid,code,lbproxy_user,seq)) {
char *et,*ed;
edg_wll_Error(ctx,&et,&ed);
fprintf(stderr,"SetLoggingJobProxy(%s,%s,%s): %s (%s)\n",jobid_s,code,lbproxy_user,et,ed);
exit(1);
}
} else {
- if (edg_wll_SetLoggingJob(ctx,jobid,code,EDG_WLL_SEQ_NORMAL)) {
+ if (edg_wll_SetLoggingJob(ctx,jobid,code,seq)) {
char *et,*ed;
edg_wll_Error(ctx,&et,&ed);
fprintf(stderr,"SetLoggingJob(%s,%s): %s (%s)\n",jobid_s,code,et,ed);
}
}
- if (noinc) edg_wll_SetSequenceCode(ctx,code,EDG_WLL_SEQ_NORMAL);
+ if (noinc) edg_wll_SetSequenceCode(ctx,code,seq);
#ifdef ENABLE_REASON_LENGTH
if (elength > 200000000) {
return err;
}
+
+static int flesh_seq(int event)
+{
+ switch (event) {
+@@@{
+ %seq = ( CREAM => 'CREAM', 'PBS' => 'PBS', 'gLite' => 'NORMAL', Condor=>'CONDOR' );
+ for my $t (sort { $event->{order}->{$a} <=> $event->{order}->{$b} }
+ $event->getTypes)
+ {
+ selectType $event $t;
+
+ my $type = uc $t;
+ my $sf = $seq{$event->{flesh}->{$t}};
+
+ print "\t\tcase EDG_WLL_EVENT_$type: return EDG_WLL_SEQ_$sf;\n";
+ }
+@@@}
+ default: return -1;
+ }
+}
#define EDG_WLL_SEQ_DUPLICATE 11
#define EDG_WLL_SEQ_PBS 2
#define EDG_WLL_SEQ_CONDOR 3
+#define EDG_WLL_SEQ_CREAM 4
/**
* initial sequence code for BigHelper
"LRMS",
"Application",
"LBServer",
+ "CreamCore",
+ "BLAH",
};
edg_wll_Source edg_wll_StringToSource(const char *name)
case EDG_WLL_SEQ_CONDOR:
ret = strdup(ctx->p_seqcode.condor);
break;
+ case EDG_WLL_SEQ_CREAM:
+ ret = strdup(""); /* XXX: not yet */
+ break;
default:
edg_wll_SetError(ctx,EINVAL,"edg_wll_GetSequenceCode(): sequence code type");
return NULL;
&c[EDG_WLL_SOURCE_APPLICATION],
&c[EDG_WLL_SOURCE_LB_SERVER]);
- assert(EDG_WLL_SOURCE__LAST == 10);
+ /* XXX: can't be true anymore. What was the reason for assert()?
+ assert(EDG_WLL_SOURCE__LAST == 10); */
if (res == EDG_WLL_SOURCE_LB_SERVER-1) {
/* pre-collections compatibility */
c[EDG_WLL_SOURCE_LB_SERVER] = 0;
else
strncpy(ctx->p_seqcode.condor, seqcode_str, sizeof(ctx->p_seqcode.condor));
break;
+ case EDG_WLL_SEQ_CREAM:
+ break; /* XXX: not yet */
default:
return edg_wll_SetError(ctx, EINVAL,
"edg_wll_SetSequenceCode(): unrecognized value of seq_type parameter");
ctx->p_seqcode.c[ctx->p_source]++;
break;
case EDG_WLL_SEQ_PBS:
+ case EDG_WLL_SEQ_CREAM:
/* no action */
break;
default:
case EDG_WLL_REGJOB_CONDOR:
js->pub.jobtype = EDG_WLL_STAT_CONDOR;
break;
+ case EDG_WLL_REGJOB_CREAM:
+ js->pub.jobtype = EDG_WLL_STAT_CREAM;
+ break;
default:
trio_asprintf(errstring,"unknown job type %d in registration",e->regJob.jobtype);
return RET_FAIL;
return processEvent_PBS(js,e,ev_seq,strict,errstring);
case EDG_WLL_STAT_CONDOR:
return processEvent_Condor(js,e,ev_seq,strict,errstring);
+ case EDG_WLL_STAT_CREAM:
+ return RET_OK; /* TODO: mulac */
case -1: return RET_UNREG;
default:
trio_asprintf(errstring,"undefined job type %d",js->pub.jobtype);