enable embrionic DAG registration (under LB_DAG_EMBRIONIC ifdef)
authorMiloš Mulač <mulac@civ.zcu.cz>
Sun, 9 Jul 2006 10:32:34 +0000 (10:32 +0000)
committerMiloš Mulač <mulac@civ.zcu.cz>
Sun, 9 Jul 2006 10:32:34 +0000 (10:32 +0000)
org.glite.lb.server/Makefile
org.glite.lb.server/src/jobstat.c
org.glite.lb.server/src/store.c.T

index b2812d8..a641d9f 100644 (file)
@@ -41,6 +41,10 @@ else
        STATIC_LIB_BK:=libglite_lb_bkserver.a
 endif
 
+ifdef LB_DAG_EMBRIONIC
+       LB_DAG_FLAGS:=-DLB_DAG_EMBRIONIC
+endif
+
 ifeq ($(GLITE_LB_SERVER_WITH_WS),yes)
        WS_CFLAGS=-DGLITE_LB_SERVER_WITH_WS 
        NSMAP=LoggingAndBookkeeping.nsmap
@@ -81,7 +85,7 @@ CFLAGS:= \
        -I${mysql_prefix}/include -I${mysql_prefix}/include/mysql \
        -I${globus_prefix}/include/${nothrflavour} \
        $(GRIDSITE_CFLAGS) \
-       -D_GNU_SOURCE ${LB_STANDALONE_FLAGS} ${LB_PERF_FLAGS}
+       -D_GNU_SOURCE ${LB_STANDALONE_FLAGS} ${LB_PERF_FLAGS} ${LB_DAG_FLAGS}
 
 ifdef LB_PROF
        SRVBONES_LIB:= ${stagedir}/lib/libglite_lb_server_bones.la
index fc91a86..6ff978e 100644 (file)
@@ -582,7 +582,7 @@ static edg_wll_ErrorCode states_values_embryonic(
        jobid_md5 = edg_wlc_JobIdGetUnique(jobid);
        parent_md5 = edg_wlc_JobIdGetUnique(parent_job);
        stat_enc = enc_intJobStat(strdup(""), stat);
-       if (jobid_md5 || parent_md5 == NULL || stat_enc == NULL) goto err;
+       if (jobid_md5 == NULL || parent_md5 == NULL || stat_enc == NULL) goto err;
 
 
        if (edg_wll_IColumnsSQLPart(ctx, ctx->job_index_cols, stat, 1, icnames, &icvalues)) goto err;
@@ -594,7 +594,8 @@ static edg_wll_ErrorCode states_values_embryonic(
 
 err:
        destroy_intJobStat(stat);
-       free(jobid_md5); free(stat_enc);
+       free(jobid_md5);
+       free(stat_enc);
        free(parent_md5);
        *values = stmt;
        return edg_wll_Error(ctx,NULL,NULL);
@@ -605,8 +606,8 @@ edg_wll_ErrorCode edg_wll_StoreIntStateEmbryonic(edg_wll_Context ctx,
         edg_wlc_JobId parent_job)
 {
        char *values = NULL;
-       char *stmt;
-       char *icnames, *icvalues;
+       char *stmt = NULL;
+       char *icnames = NULL;
 
        if (states_values_embryonic(ctx, jobid, parent_job, &icnames, &values))
                goto cleanup;
@@ -621,14 +622,15 @@ edg_wll_ErrorCode edg_wll_StoreIntStateEmbryonic(edg_wll_Context ctx,
                        ",parent_job%s) "
                "values %s",
                icnames, values);
-       free(icnames); free(icvalues);
 
        if (edg_wll_ExecStmt(ctx,stmt,NULL) < 0) goto cleanup;
 
 
 cleanup:
-       free(stmt); 
+       free(icnames);
        free(values);
+       free(stmt); 
+
        return edg_wll_Error(ctx,NULL,NULL);
 }
 
index 1894ce8..47c7c94 100644 (file)
@@ -40,7 +40,7 @@ static int store_seq(edg_wll_Context,edg_wll_Event *,int);
 static int check_dup(edg_wll_Context,edg_wll_Event *);
 static int check_auth(edg_wll_Context,edg_wll_Event *e); 
 static int register_subjobs(edg_wll_Context,const edg_wll_RegJobEvent *);
-static int register_subjobs_embriotic(edg_wll_Context,const edg_wll_RegJobEvent *);
+static int register_subjobs_embrionic(edg_wll_Context,const edg_wll_RegJobEvent *);
 
 void edg_wll_StoreAnonymous(edg_wll_Context ctx,int anon) {
        ctx->allowAnonymous = anon;
@@ -198,7 +198,13 @@ int edg_wll_StoreEvent(edg_wll_Context ctx,edg_wll_Event *e,int *seq)
                e->any.type == EDG_WLL_EVENT_REGJOB &&
                (e->regJob.jobtype == EDG_WLL_REGJOB_DAG ||
                 e->regJob.jobtype == EDG_WLL_REGJOB_PARTITIONED) &&
-               e->regJob.nsubjobs > 0) err = register_subjobs(ctx,&e->regJob);
+               e->regJob.nsubjobs > 0)  
+
+#ifdef LB_DAG_EMBRIONIC
+                       err = register_subjobs_embrionic(ctx,&e->regJob);
+#else
+                       err = register_subjobs(ctx,&e->regJob);
+#endif
 
 
 clean:
@@ -562,7 +568,7 @@ static int register_subjobs(edg_wll_Context ctx,const edg_wll_RegJobEvent *e)
        return edg_wll_Error(ctx,NULL,NULL);
 }
 
-static int register_subjobs_embriotic(edg_wll_Context ctx,const edg_wll_RegJobEvent *e)
+static int register_subjobs_embrionic(edg_wll_Context ctx,const edg_wll_RegJobEvent *e)
 {
        int     i,err;
        edg_wlc_JobId   *subjobs;