From: Miloš Mulač Date: Thu, 19 Oct 2006 13:19:30 +0000 (+0000) Subject: enable to register, process and print out job collections X-Git-Tag: mergeto_glite-lb-client_branch_2_3_0_0243_generic_23Nov06~6 X-Git-Url: http://scientific.zcu.cz/git/?a=commitdiff_plain;h=d33ca4323d6539c7bb7f0c45260afea859ab9510;p=jra1mw.git enable to register, process and print out job collections --- diff --git a/org.glite.lb.client/examples/job_reg.c b/org.glite.lb.client/examples/job_reg.c index 4d5277f..4f67829 100644 --- a/org.glite.lb.client/examples/job_reg.c +++ b/org.glite.lb.client/examples/job_reg.c @@ -14,14 +14,14 @@ extern int opterr,optind; static void usage(char *me) { - fprintf(stderr,"usage: %s [-m bkserver] [-x] [-j dg_jobid] [-s source_id] [-n num_subjobs [-S]] [-l jdl_file] [-e seed]\n", me); + fprintf(stderr,"usage: %s [-m bkserver] [-x] [-j dg_jobid] [-s source_id] [-n num_subjobs [-S][-C]] [-l jdl_file] [-e seed]\n", me); } int main(int argc, char *argv[]) { 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; + int done = 0,num_subjobs = 0,reg_subjobs = 0,i, collection = 0; edg_wll_Context ctx; edg_wlc_JobId jobid,*subjobs; @@ -30,13 +30,14 @@ int main(int argc, char *argv[]) opterr = 0; do { - switch (getopt(argc,argv,"xs:j:m:n:Sl:e:")) { + switch (getopt(argc,argv,"xs:j:m:n:SCl:e:")) { case 'x': lbproxy = 1; break; case 's': src = (char *) strdup(optarg); break; case 'j': job = (char *) strdup(optarg); break; case 'm': server = strdup(optarg); break; case 'n': num_subjobs = atoi(optarg); break; case 'S': if (num_subjobs>0) { reg_subjobs = 1; break; } + case 'C': if (num_subjobs>0) { collection = 1; break; } case 'l': jdl = (char *) strdup(optarg); break; case 'e': seed = strdup(optarg); break; case '?': usage(argv[0]); exit(EINVAL); @@ -87,7 +88,7 @@ int main(int argc, char *argv[]) edg_wll_SetParam(ctx,EDG_WLL_PARAM_SOURCE,edg_wll_StringToSource(src)); if (lbproxy) { if (edg_wll_RegisterJobProxy(ctx,jobid, - num_subjobs?EDG_WLL_REGJOB_DAG:EDG_WLL_REGJOB_SIMPLE, + num_subjobs?(collection?EDG_WLL_REGJOB_COLLECTION:EDG_WLL_REGJOB_DAG):EDG_WLL_REGJOB_SIMPLE, jdl ? jdl : "blabla", "NNNSSSS", num_subjobs,seed,&subjobs)) { @@ -98,7 +99,7 @@ int main(int argc, char *argv[]) } } else { if (edg_wll_RegisterJobSync(ctx,jobid, - num_subjobs?EDG_WLL_REGJOB_DAG:EDG_WLL_REGJOB_SIMPLE, + num_subjobs?(collection?EDG_WLL_REGJOB_COLLECTION:EDG_WLL_REGJOB_DAG):EDG_WLL_REGJOB_SIMPLE, jdl ? jdl : "blabla", "NNNSSSS", num_subjobs,seed,&subjobs)) { diff --git a/org.glite.lb.client/examples/user_jobs.c b/org.glite.lb.client/examples/user_jobs.c index 8d96ed3..151e8e5 100644 --- a/org.glite.lb.client/examples/user_jobs.c +++ b/org.glite.lb.client/examples/user_jobs.c @@ -57,8 +57,9 @@ int main(int argc,char **argv) if (states[i].jobtype == EDG_WLL_STAT_SIMPLE) { printf(" %s .... %s %s\n", id, st, (states[i].state==EDG_WLL_JOB_DONE) ? edg_wll_done_codeToString(states[i].done_code) : "" ); } - else if (states[i].jobtype == EDG_WLL_STAT_DAG) { - printf("DAG %s .... %s %s\n", id, st, (states[i].state==EDG_WLL_JOB_DONE) ? edg_wll_done_codeToString(states[i].done_code) : ""); + else if ((states[i].jobtype == EDG_WLL_STAT_DAG) || + (states[i].jobtype == EDG_WLL_STAT_COLLECTION)) { + printf("%s %s .... %s %s\n", (states[i].jobtype==EDG_WLL_STAT_DAG)?"DAG ":"COLL",id, st, (states[i].state==EDG_WLL_JOB_DONE) ? edg_wll_done_codeToString(states[i].done_code) : ""); for (j=0; states[j].state != EDG_WLL_JOB_UNDEF; j++) { if (states[j].parent_job) { char *par_id = edg_wlc_JobIdUnparse(states[j].parent_job); diff --git a/org.glite.lb.server/src/process_event.c b/org.glite.lb.server/src/process_event.c index be043ea..485fa7e 100644 --- a/org.glite.lb.server/src/process_event.c +++ b/org.glite.lb.server/src/process_event.c @@ -903,9 +903,16 @@ int processEvent(intJobStat *js, edg_wll_Event *e, int ev_seq, int strict, char &js->pub.parent_job); rep(js->pub.network_server, e->regJob.ns); js->pub.children_num = e->regJob.nsubjobs; - if (e->regJob.jobtype == EDG_WLL_REGJOB_DAG - || e->regJob.jobtype == EDG_WLL_REGJOB_PARTITIONED) { - js->pub.jobtype = EDG_WLL_STAT_DAG; + switch (e->regJob.jobtype) { + case EDG_WLL_REGJOB_DAG: + case EDG_WLL_REGJOB_PARTITIONED: + js->pub.jobtype = EDG_WLL_STAT_DAG; + break; + case EDG_WLL_REGJOB_COLLECTION: + js->pub.jobtype = EDG_WLL_STAT_COLLECTION; + break; + default: + break; } rep(js->pub.seed, e->regJob.seed); } diff --git a/org.glite.lb.server/src/store.c.T b/org.glite.lb.server/src/store.c.T index ce6733a..7574b02 100644 --- a/org.glite.lb.server/src/store.c.T +++ b/org.glite.lb.server/src/store.c.T @@ -199,7 +199,8 @@ int edg_wll_StoreEvent(edg_wll_Context ctx,edg_wll_Event *e,int *seq) if (err == 0 && e->any.type == EDG_WLL_EVENT_REGJOB && (e->regJob.jobtype == EDG_WLL_REGJOB_DAG || - e->regJob.jobtype == EDG_WLL_REGJOB_PARTITIONED) && + e->regJob.jobtype == EDG_WLL_REGJOB_PARTITIONED || + e->regJob.jobtype == EDG_WLL_REGJOB_COLLECTION) && e->regJob.nsubjobs > 0) #ifdef LB_DAG_EMBRIONIC