From: František Dvořák Date: Mon, 15 Nov 2004 12:55:06 +0000 (+0000) Subject: producer API fake implementation and according examples X-Git-Tag: glite-lb_R_0_1_0~12 X-Git-Url: http://scientific.zcu.cz/git/?a=commitdiff_plain;h=6ff07f7176cb437e8d4b21f9af13e691cc0f37e8;p=jra1mw.git producer API fake implementation and according examples polising of the fake consumer API code --- diff --git a/org.glite.lb.client-interface/Makefile b/org.glite.lb.client-interface/Makefile index a4e2c69..9e315b7 100644 --- a/org.glite.lb.client-interface/Makefile +++ b/org.glite.lb.client-interface/Makefile @@ -20,7 +20,7 @@ AT3=perl -I${top_srcdir}/project ${top_srcdir}/project/at3 STAGETO=include/${globalprefix}/${lbprefix} STATIC_H=consumer.h context.h dump.h load.h notification.h notifid.h purge.h \ Notification.h CountRef.h Job.h LoggingExceptions.h ServerConnection.h \ - consumer_fake.h + consumer_fake.h producer_fake.h GEN_H=events.h jobstat.h producer.h Event.h JobStatus.h diff --git a/org.glite.lb.client-interface/interface/consumer_fake.h b/org.glite.lb.client-interface/interface/consumer_fake.h index aaee26d..50105f3 100644 --- a/org.glite.lb.client-interface/interface/consumer_fake.h +++ b/org.glite.lb.client-interface/interface/consumer_fake.h @@ -1,4 +1,6 @@ -/* $Id: */ +/* + * fake implementation of the consumer API + */ #ifndef WORKLOAD_LOGGING_CLIENT_CONSUMER_FAKE_H #define WORKLOAD_LOGGING_CLIENT_CONSUMER_FAKE_H @@ -8,9 +10,9 @@ typedef int (edg_wll_QueryEvents_cb_f)(edg_wll_Context context, edg_wll_Event **events); typedef int (edg_wll_QueryListener_cb_f)(edg_wll_Context context, char **host, uint16_t *port); -int egd_wll_RegisterTestQueryEvents(edg_wll_QueryEvents_cb_f *cb); -int egd_wll_RegisterTestQueryListener(edg_wll_QueryListener_cb_f *cb); -void egd_wll_UnregisterTestQueryEvents(); -void egd_wll_UnregisterTestQueryListener(); +int edg_wll_RegisterTestQueryEvents(edg_wll_QueryEvents_cb_f *cb); +int edg_wll_RegisterTestQueryListener(edg_wll_QueryListener_cb_f *cb); +void edg_wll_UnregisterTestQueryEvents(); +void edg_wll_UnregisterTestQueryListener(); #endif /* WORKLOAD_LOGGING_CLIENT_CONSUMER_FAKE_H */ diff --git a/org.glite.lb.client-interface/interface/producer_fake.h b/org.glite.lb.client-interface/interface/producer_fake.h new file mode 100644 index 0000000..f5dfcff --- /dev/null +++ b/org.glite.lb.client-interface/interface/producer_fake.h @@ -0,0 +1,15 @@ +/* + * fake implementation of the producer API + */ + +#ifndef WORKLOAD_LOGGING_CLIENT_PRODUCER_FAKE_H +#define WORKLOAD_LOGGING_CLIENT_PRODUCER_FAKE_H + +typedef int (edg_wll_Logging_cb_f)(edg_wll_Context context); + +int edg_wll_RegisterTestLogging(edg_wll_Logging_cb_f *cb); +int edg_wll_RegisterTestLoggingProxy(edg_wll_Logging_cb_f *cb); +void edg_wll_UnregisterTestLogging(); +void edg_wll_UnregisterTestLoggingProxy(); + +#endif /* WORKLOAD_LOGGING_CLIENT_PRODUCER_FAKE_H */ diff --git a/org.glite.lb.client/Makefile b/org.glite.lb.client/Makefile index bedea8f..b72b7a1 100644 --- a/org.glite.lb.client/Makefile +++ b/org.glite.lb.client/Makefile @@ -21,8 +21,38 @@ ares_prefix=/opt/ares VPATH=${top_srcdir}/src:${top_srcdir}/test:${top_srcdir}/examples AT3=perl -I${top_srcdir}/project ${top_srcdir}/project/at3 +GENSAM=${top_srcdir}/examples/gen_sample_job + +SUFFIXES = .T .l + +l_SRC = \ + chkpt.l \ + cleared.l \ + done.l \ + done_dag.l \ + done_subjob.l \ + ready.l \ + ready_dag.l \ + ready_subjob.l \ + running.l \ + running_dag.l \ + running_subjob.l \ + scheduled.l \ + scheduled_dag.l \ + scheduled_subjob.l \ + submitted.l \ + submitted_dag.l \ + submitted_subjob.l \ + waiting.l \ + waiting_dag.l \ + waiting_subjob.l \ + failed_dag.l \ + failed_subjob.l \ + aborted.l \ + cancelled.l + +sh_PROGS = $(l_SRC:.l=.sh) -SUFFIXES = .T DEBUG:=-g -O0 -Wall @@ -71,7 +101,7 @@ INSTALL:=libtool --mode=install install LIBOBJS:=connection.o consumer.o notification.o prod_proto.o \ producer.o uiwrap.o -TESTLIBOBJS:=consumer_fake.o +TESTLIBOBJS:=consumer_fake.o producer_fake.o PLUSOBJS:=Event.o Job.o JobStatus.o Notification.o ServerConnection.o PUB_HDRS:=CountRef.h Event.h JobJobStatus.h Notification.h ServerConnection.h \ @@ -100,7 +130,8 @@ THRPLUSLIB:=libglite_lb_clientpp_${thrflavour}.la TOOLS:=dump load purge #EXAMPLES:=log_usertag_proxy job_reg feed_shark notify EXAMPLES:=job_reg feed_shark notify -FAKE_EXAMPLES:=jog_log_fake +FAKE_EXAMPLES:=job_log_fake job_reg_fake +FAKE_EXAMPLES_SOURCES:=job_log.c job_reg.c ${LIB}: ${LIBOBJS} ${LINK} -o $@ ${LIBLOBJS} -rpath ${glite_location}/lib -lglite_lb_common_${nothrflavour} @@ -123,16 +154,19 @@ ${THRPLUSLIB}: ${PLUSTHROBJS} logevent: logevent.o args.o ${LINK} -o $@ logevent.o args.o ${LIB} ${EXT_LIB} ${GLOBUS_LIBS} +logevent_fake: logevent_fake.o args.o + ${LINK} -o $@ logevent_fake.o args.o ${TESTLIB} ${EXT_LIB} ${GLOBUS_LIBS} + ${TOOLS} ${EXAMPLES}: %: %.o ${LINK} -o $@ $< ${LIB} ${EXT_LIB} ${GLOBUS_LIBS} -${FAKE_EXAMPLES}: job_log_fake.o ${TESTLIB} +${FAKE_EXAMPLES}: %: %.o ${TESTLIB} ${LINK} -o $@ $< ${TESTLIB} ${EXT_LIB} ${GLOBUS_LIBS} ${TOOLS}: ${LIB} -job_log_fake.o: job_log.c - ${COMPILE} ${GLOBUSINC} -c $< -o $@ +${FAKE_EXAMPLES:=.o}: ${FAKE_EXAMPLES_SOURCES} + ${COMPILE} ${GLOBUSINC} -DUSE_CALLBACKS -c $< -o $@ ${PLUSOBJS}: %.o: %.cpp ${CXXCOMPILE} ${GLOBUSINC} -c $< @@ -146,6 +180,9 @@ ${LIBOBJS} ${TESTLIBOBJS}: %.o: %.c ${LIBTHROBJS} ${TESTLIBTHROBJS}: %.thr.o: %.c ${COMPILE} ${GLOBUSTHRINC} -o $@ -c $< +logevent_fake.o: logevent.c + ${COMPILE} ${GLOBUSINC} -DFAKE -c $< -o $@ + # catches $TOOLS and logevent compilation %.o: %.c ${CC} ${CFLAGS} ${GLOBUSINC} -c $< @@ -160,12 +197,17 @@ ${LIBTHROBJS} ${TESTLIBTHROBJS}: %.thr.o: %.c ${AT3} $< >$@ || rm -f $@ chmod -w $@ >/dev/null +%.sh: %.l gen_begin gen_sample_job + rm -f $@ + $(GENSAM) $< >$@ || rm -f $@ + chmod -w,+x $@ > /dev/null + default: all -compile all: ${LIB} ${THRLIB} ${TOOLS} logevent ${EXAMPLES} ${PLUSLIB} ${THRPLUSLIB} ${TESTLIB} ${TESTTHRLIB} ${FAKE_EXAMPLES} +compile all: ${LIB} ${THRLIB} ${TOOLS} logevent ${PLUSLIB} ${THRPLUSLIB} ${TESTLIB} ${TESTTHRLIB} examples -examples: ${EXAMPLES} +examples: ${EXAMPLES} ${FAKE_EXAMPLES} ${sh_PROGS} logevent_fake check: compile check.producer @@ -199,7 +241,7 @@ install: mkdir -p ${PREFIX}/share/doc/${package}-${version} ${INSTALL} -m 644 ${LIB} ${THRLIB} ${PLUSLIB} ${THRPLUSLIB} ${TESTLIB} ${TESTTHRLIB} ${PREFIX}/lib ${INSTALL} -m 644 ${top_srcdir}/LICENSE ${PREFIX}/share/doc/${package}-${version} - for p in ${TOOLS} logevent ${FAKE_EXAMPLES}; do \ + for p in ${TOOLS} logevent ${EXAMPLES} ${FAKE_EXAMPLES} logevent_fake ${sh_PROGS}; do \ ${INSTALL} -m 755 "$$p" "${PREFIX}/bin/glite-lb-$$p"; \ done diff --git a/org.glite.lb.client/examples/aborted.l b/org.glite.lb.client/examples/aborted.l new file mode 100644 index 0000000..0f639c8 --- /dev/null +++ b/org.glite.lb.client/examples/aborted.l @@ -0,0 +1,2 @@ +:ready: +-s JobController,-e Abort,--reason "just to test" diff --git a/org.glite.lb.client/examples/cancelled.l b/org.glite.lb.client/examples/cancelled.l new file mode 100644 index 0000000..1e0cc96 --- /dev/null +++ b/org.glite.lb.client/examples/cancelled.l @@ -0,0 +1,2 @@ +:running: +-s LogMonitor, -e Done, --status_code=CANCELLED, --reason="reason for the change", --exit_code=0 diff --git a/org.glite.lb.client/examples/chkpt.l b/org.glite.lb.client/examples/chkpt.l new file mode 100644 index 0000000..dbd7f23 --- /dev/null +++ b/org.glite.lb.client/examples/chkpt.l @@ -0,0 +1,6 @@ +# macro definition for DONE state + +:running: +-s LRMS, -e Chkpt, --tag=chkpt1, --classad="" +-s LRMS, -e Chkpt, --tag=chkpt2, --classad="" +-s LogMonitor, -e Done, --status_code=OK, --reason="reason for the change", --exit_code=0 diff --git a/org.glite.lb.client/examples/cleared.l b/org.glite.lb.client/examples/cleared.l new file mode 100644 index 0000000..8b9f86c --- /dev/null +++ b/org.glite.lb.client/examples/cleared.l @@ -0,0 +1,4 @@ +# macro definition for DONE state + +:done: +-s LogMonitor, -e Clear, --reason=USER diff --git a/org.glite.lb.client/examples/consumer_fake.c b/org.glite.lb.client/examples/consumer_fake.c index fabda90..1eaeb45 100644 --- a/org.glite.lb.client/examples/consumer_fake.c +++ b/org.glite.lb.client/examples/consumer_fake.c @@ -1,4 +1,6 @@ -/* $Id: */ +/* + * fake implementation of the consumer API + */ #include #include diff --git a/org.glite.lb.client/examples/done.l b/org.glite.lb.client/examples/done.l new file mode 100644 index 0000000..def8f34 --- /dev/null +++ b/org.glite.lb.client/examples/done.l @@ -0,0 +1,4 @@ +# macro definition for DONE state + +:running: +-s LogMonitor, -e Done, --status_code=OK, --reason="reason for the change", --exit_code=0 diff --git a/org.glite.lb.client/examples/done_dag.l b/org.glite.lb.client/examples/done_dag.l new file mode 100644 index 0000000..5ac9033 --- /dev/null +++ b/org.glite.lb.client/examples/done_dag.l @@ -0,0 +1,4 @@ +# macro definition for DONE state + +:running_dag: +-s LogMonitor, -e Done, --status_code=OK, --reason="reason for the change", --exit_code=0 diff --git a/org.glite.lb.client/examples/done_subjob.l b/org.glite.lb.client/examples/done_subjob.l new file mode 100644 index 0000000..883a367 --- /dev/null +++ b/org.glite.lb.client/examples/done_subjob.l @@ -0,0 +1,4 @@ +# macro definition for DONE state + +:running_subjob: +-s LogMonitor, -e Done, --status_code=OK, --reason="reason for the change", --exit_code=0 diff --git a/org.glite.lb.client/examples/failed_dag.l b/org.glite.lb.client/examples/failed_dag.l new file mode 100644 index 0000000..023d5af --- /dev/null +++ b/org.glite.lb.client/examples/failed_dag.l @@ -0,0 +1,3 @@ +:running_dag: + +-s LogMonitor, -e Done, --status_code=Failed, --exit_code=1, --reason=shit diff --git a/org.glite.lb.client/examples/failed_subjob.l b/org.glite.lb.client/examples/failed_subjob.l new file mode 100644 index 0000000..9e1b6dc --- /dev/null +++ b/org.glite.lb.client/examples/failed_subjob.l @@ -0,0 +1,3 @@ +:running_subjob: + +-s LogMonitor, -e Done, --status_code=Failed, --exit_code=1, --reason=shit diff --git a/org.glite.lb.client/examples/gen_begin b/org.glite.lb.client/examples/gen_begin new file mode 100755 index 0000000..5b5ef49 --- /dev/null +++ b/org.glite.lb.client/examples/gen_begin @@ -0,0 +1,50 @@ +#!/bin/sh +# script for generating sample jobs + +if test ! -z "$FAKE"; then + SUFFIX="_fake" +fi +LOGFD=${LOGFD:-2} +LOGEV=${LOGEV:-`dirname $0`/glite-lb-logevent}${SUFFIX} +JOB_REG=${JOB_REG:-`dirname $0`/glite-lb-job_reg}${SUFFIX} +EDG_JOBID= + +usage() +{ + echo "Usage : $0 [-m bkserver_machine_name][-j job_id]" + exit 4 +} + +# read parameters +while test -n "$1" +do + case "$1" in + "-m") shift; BKSERVER_HOST="$1" ;; + "-j") shift; EDG_JOBID="$1" ;; + "*") usage ;; + esac + shift +done + +test \( -z "$BKSERVER_HOST" \) -a \( -z "$EDG_JOBID" \) && usage + +if [ -z "$EDG_JOBID" ] +then + # initial sequence code & jobid (normaly returned by job_reg) + EDG_JOBID= + SCRIPT=`$JOB_REG -m $BKSERVER_HOST -s UserInterface | tail -n 2` + eval $SCRIPT + test -z "$EDG_JOBID" && exit 4 + echo EDG_JOBID=$EDG_JOBID +else + test -z "$EDG_WL_SEQUENCE" && EDG_WL_SEQUENCE="UI=000003:NS=0000000000:WM=000000:BH=0000000000:JSS=000000:LM=000000:LRMS=000000:APP=000000" +fi + +send_log_ev() +{ + echo $LOGEV -j "$EDG_JOBID" -c "$EDG_WL_SEQUENCE" "$@" 1>&$LOGFD + EDG_WL_SEQUENCE=`$LOGEV -j $EDG_JOBID -c $EDG_WL_SEQUENCE "$@" 2>/dev/null` + test $? -ne 0 -o -z "$EDG_WL_SEQUENCE" && exit 4 + true +} + diff --git a/org.glite.lb.client/examples/gen_sample_job b/org.glite.lb.client/examples/gen_sample_job new file mode 100755 index 0000000..cc9dfac --- /dev/null +++ b/org.glite.lb.client/examples/gen_sample_job @@ -0,0 +1,119 @@ +#!/bin/sh + +me=$0 +mydir=`dirname $0`; +export me mydir + + +set -- `getopt n $*` +# test whether it is recursive call + +NESTED="-v nested=0" +while [ $1 != '--' ]; do case $1 in + -n) NESTED="-v nested=1"; shift ;; +esac; done +shift + +awk -F, $NESTED \ +'BEGIN { + if (nested==0) system("cat $mydir/gen_begin"); + OFS = ","; + nlines = 0; +} +/^#/ || /^[ ]*$/ { next; } +{ + source = $2; + + event = $1; + + nline++; +} +# events processing + +/-e Transfer/ { logit(); + next;} + +/-e Accepted/ { if (checkNOP(7) == 0) logit(); + next;} + +/-e Refused/ { if (checkNOP(6) == 0) logit(); + next;} + +/-e EnQueued/ { if (checkNOP(6) == 0) logit(); + next;} + +/-e DeQueued/ { if (checkNOP(4) == 0) logit(); + next;} + +/-e HelperCall/ { if (checkNOP(5) == 0) logit(); + next;} + +/-e HelperReturn/ { if (checkNOP(5) == 0) logit(); + next;} + +/-e Running/ { if (checkNOP(3) == 0) logit(); + next;} + +/-e Resubmission/ { if (checkNOP(5) == 0) logit(); + next;} + +/-e Done/ { if (checkNOP(5) == 0) logit(); + next;} + +/-e Cancel/ { if (checkNOP(4) == 0) logit(); + next;} + +/-e Abort/ { if (checkNOP(3) == 0) logit(); + next;} + +/-e Clear/ { if (checkNOP(3) == 0) logit(); + next;} + +/-e Purge/ { if (checkNOP(2) == 0) logit(); + next;} + +/-e Match/ { if (checkNOP(3) == 0) logit(); + next;} + +/-e Pending/ { if (checkNOP(3) == 0) logit(); + next;} + +/-e RegJob/ { if (checkNOP(7) == 0) logit(); + next;} + +/-e Chkpt/ { if (checkNOP(4) == 0) logit(); + next;} + +/-e Listener/ { if (checkNOP(5) == 0) logit(); + next;} + +/-e CurDescr/ { if (checkNOP(3) == 0) logit(); + next;} + +/-e UserTag/ { if (checkNOP(4) == 0) logit(); + next;} + + +# macro processing - macro name starts and ends with ':' +# in a file gen_MACRONAME.txt is the macro describtion + +/^:.*:$/ {system("$me -n $mydir/"substr($1,2,(length($1) - 2))".l" )} + + +function checkNOP(NOP) +{ + if (NF != NOP) { print nline" : "$2": "NOP" args required ("NF" supplied)" > "/dev/stderr"; return 1 } + else return 0; +} + +function logit() +{ + split($0,f); + + ff = ""; + for (i=1; i<=NF; i++) ff = ff " " f[i]; + + print "send_log_ev" ff; +} +' $1 + diff --git a/org.glite.lb.client/examples/producer_fake.c b/org.glite.lb.client/examples/producer_fake.c new file mode 100644 index 0000000..4d2ea58 --- /dev/null +++ b/org.glite.lb.client/examples/producer_fake.c @@ -0,0 +1,63 @@ +/* + * fake implementation of the producer API + */ + +#include "glite/lb/producer.h" +#include "glite/lb/context-int.h" +#include "glite/lb/producer_fake.h" + +#define FAKE_VERSION 1 + +#include "../src/producer.c" + + +static edg_wll_Logging_cb_f *Logging_cb = NULL; +static edg_wll_Logging_cb_f *LoggingProxy_cb = NULL; + + +/* register the logging callback */ +int edg_wll_RegisterTestLogging(edg_wll_Logging_cb_f *cb) { + if (Logging_cb) return 0; + + Logging_cb = cb; + return 1; +} + + +/* register the proxy logging callback */ +int edg_wll_RegisterTestLoggingProxy(edg_wll_Logging_cb_f *cb) { + if (LoggingProxy_cb) return 0; + + LoggingProxy_cb = cb; + return 1; +} + + +/* unregister the logging callback */ +void edg_wll_UnregisterTestLogging() { + Logging_cb = NULL; +} + + +/* unregister the proxy logging callback */ +void edg_wll_UnregisterTestLoggingProxy() { + LoggingProxy_cb = NULL; +} + + +/* "fake" implementation of function sending formated UML string */ +int edg_wll_DoLogEvent(edg_wll_Context context, edg_wll_LogLine logLine) { + if (Logging_cb) + return Logging_cb(context); + else + return edg_wll_Error(context, NULL, NULL); +} + + +/* "fake" implementation of function sending formated ULM string */ +int edg_wll_DoLogEventProxy(edg_wll_Context context, edg_wll_LogLine logline) { + if (Logging_cb) + return Logging_cb(context); + else + return edg_wll_Error(context, NULL, NULL); +} diff --git a/org.glite.lb.client/examples/ready.l b/org.glite.lb.client/examples/ready.l new file mode 100644 index 0000000..e4d9ac7 --- /dev/null +++ b/org.glite.lb.client/examples/ready.l @@ -0,0 +1,18 @@ +# macro definition for WAITING state + +:waiting: +# NetworkServer + +-s NetworkServer,-e EnQueued, --queue="destination queue", --job="job description in receiver language", --result=OK, --reason="detailed description of transfer" +# -s NetworkServer,-e Transfer,--destination="WorkloadManager",--dest_host="destination hostname",--dest_instance="destination instance",--dest_jobid="job description in receiver language",--result=OK,--reason="detailed description of transfer",--dest_jobid="destination internal jobid" + +# WorkloadManager + +-s WorkloadManager,-e DeQueued, --queue="queue name", --local_jobid="new jobId assigned by the receiving component" +-s WorkloadManager,-e HelperCall, --helper_name="name of the called component",--helper_params="parameters of the call", --src_role=CALLING +#-s Helper,-e HelperCall, --helper_name="name of the called component",--helper_params="parameters of the call", --src_role=CALLED +#-s Helper,-e HelperReturn, --helper_name="name of the called component",--retval="returned data", --src_role=CALLED +-s WorkloadManager,-e Match,--dest_id="Id of the destination CE/queue" +-s WorkloadManager,-e HelperReturn, --helper_name="name of the called component",--retval="returned data", --src_role=CALLING +-s WorkloadManager,-e EnQueued, --queue="destination queue", --job="job description in receiver language", --result=OK, --reason="detailed description of transfer" + diff --git a/org.glite.lb.client/examples/ready_dag.l b/org.glite.lb.client/examples/ready_dag.l new file mode 100644 index 0000000..aa7deae --- /dev/null +++ b/org.glite.lb.client/examples/ready_dag.l @@ -0,0 +1,13 @@ +# macro definition for WAITING state + +:waiting_dag: +# NetworkServer + +-s NetworkServer,-e EnQueued, --queue="destination queue", --job="job description in receiver language", --result=OK, --reason="detailed description of transfer" + +# WorkloadManager + +-s WorkloadManager,-e DeQueued, --queue="queue name", --local_jobid="new jobId assigned by the receiving component" + +-s WorkloadManager,-e EnQueued, --queue="destination queue", --job="job description in receiver language", --result=OK, --reason="detailed description of transfer" + diff --git a/org.glite.lb.client/examples/ready_subjob.l b/org.glite.lb.client/examples/ready_subjob.l new file mode 100644 index 0000000..3f40632 --- /dev/null +++ b/org.glite.lb.client/examples/ready_subjob.l @@ -0,0 +1,8 @@ +# macro definition for WAITING state + +:waiting_subjob: +# WorkloadManager + +-s WorkloadManager,-e Match,--dest_id="Id of the destination CE/queue" +-s WorkloadManager,-e HelperReturn, --helper_name="name of the called component",--retval="returned data", --src_role=CALLING + diff --git a/org.glite.lb.client/examples/running.l b/org.glite.lb.client/examples/running.l new file mode 100644 index 0000000..12d411a --- /dev/null +++ b/org.glite.lb.client/examples/running.l @@ -0,0 +1,4 @@ +# macro definition for RUNNING state + +:scheduled: +-s LogMonitor,-e Running,--node"worker node where the executable is run" diff --git a/org.glite.lb.client/examples/running_dag.l b/org.glite.lb.client/examples/running_dag.l new file mode 100644 index 0000000..74e1efa --- /dev/null +++ b/org.glite.lb.client/examples/running_dag.l @@ -0,0 +1,4 @@ +# macro definition for RUNNING state + +:scheduled_dag: +-s LogMonitor,-e Running,--node"DAGMan running on server" diff --git a/org.glite.lb.client/examples/running_subjob.l b/org.glite.lb.client/examples/running_subjob.l new file mode 100644 index 0000000..2069f33 --- /dev/null +++ b/org.glite.lb.client/examples/running_subjob.l @@ -0,0 +1,4 @@ +# macro definition for RUNNING state + +:scheduled_subjob: +-s LogMonitor,-e Running,--node"worker node where the executable is run" diff --git a/org.glite.lb.client/examples/scheduled.l b/org.glite.lb.client/examples/scheduled.l new file mode 100644 index 0000000..3197309 --- /dev/null +++ b/org.glite.lb.client/examples/scheduled.l @@ -0,0 +1,13 @@ +# macro definition for SCHEDULED state + +:ready: +# JobSubmition + +-s JobController,-e DeQueued, --queue="queue name", --local_jobid="new jobId assigned by the receiving component" +-s JobController,-e Transfer,--destination="LRMS",--dest_host="destination hostname",--dest_instance="destination instance",--dest_jobid="job description in receiver language",--result=OK,--reason="detailed description of transfer",--dest_jobid="destination internal jobid" + +# LogMonitor + +-s LogMonitor,-e Accepted, --from="JobController", --from_host="sending component hostname", --from_instance="sending component instance", --local_jobid="new jobId (Condor, Globus ...)" +-s LogMonitor,-e Transfer,--destination="LRMS",--dest_host="destination hostname",--dest_instance="destination instance",--dest_jobid="job description in receiver language",--result=OK,--reason="detailed description of transfer",--dest_jobid="destination internal jobid" + diff --git a/org.glite.lb.client/examples/scheduled_dag.l b/org.glite.lb.client/examples/scheduled_dag.l new file mode 100644 index 0000000..a90b788 --- /dev/null +++ b/org.glite.lb.client/examples/scheduled_dag.l @@ -0,0 +1,12 @@ +# macro definition for SCHEDULED state + +:ready_dag: +# JobSubmition + +-s JobController,-e DeQueued, --queue="queue name", --local_jobid="new jobId assigned by the receiving component" +-s JobController,-e Transfer,--destination="LogMonitor",--dest_host="destination hostname",--dest_instance="destination instance",--dest_jobid="job description in receiver language",--result=START,--reason="detailed description of transfer",--dest_jobid="destination internal jobid" + +# LogMonitor + +-s LogMonitor,-e Accepted, --from="JobController", --from_host="sending component hostname", --from_instance="sending component instance", --local_jobid="new jobId (Condor, Globus ...)" + diff --git a/org.glite.lb.client/examples/scheduled_subjob.l b/org.glite.lb.client/examples/scheduled_subjob.l new file mode 100644 index 0000000..f1d3021 --- /dev/null +++ b/org.glite.lb.client/examples/scheduled_subjob.l @@ -0,0 +1,7 @@ +# macro definition for SCHEDULED state + +:ready_subjob: +# LogMonitor + +-s LogMonitor,-e Transfer,--destination="LRMS",--dest_host="destination hostname",--dest_instance="destination instance",--dest_jobid="job description in receiver language",--result=OK,--reason="detailed description of transfer",--dest_jobid="destination internal jobid" + diff --git a/org.glite.lb.client/examples/submitted.l b/org.glite.lb.client/examples/submitted.l new file mode 100644 index 0000000..932ef55 --- /dev/null +++ b/org.glite.lb.client/examples/submitted.l @@ -0,0 +1,5 @@ +# macro definition for SUBMITTED state + +# only job registration needed for submitted state +#-p,-s UserInterface,-e Transfer,--destination="NetworkServer",--destination_host="destination hostname",--destination_instance="destination instance",--destination_jobid="job description in receiver language",--result=OK,--reason="detailed description of transfer",--destination_jobid="destination internal jobid" + diff --git a/org.glite.lb.client/examples/submitted_dag.l b/org.glite.lb.client/examples/submitted_dag.l new file mode 100644 index 0000000..5bcae2f --- /dev/null +++ b/org.glite.lb.client/examples/submitted_dag.l @@ -0,0 +1,4 @@ +# macro definition for SUBMITTED state + +# only job registration needed for submitted state + diff --git a/org.glite.lb.client/examples/submitted_subjob.l b/org.glite.lb.client/examples/submitted_subjob.l new file mode 100644 index 0000000..5bcae2f --- /dev/null +++ b/org.glite.lb.client/examples/submitted_subjob.l @@ -0,0 +1,4 @@ +# macro definition for SUBMITTED state + +# only job registration needed for submitted state + diff --git a/org.glite.lb.client/examples/waiting.l b/org.glite.lb.client/examples/waiting.l new file mode 100644 index 0000000..439a7da --- /dev/null +++ b/org.glite.lb.client/examples/waiting.l @@ -0,0 +1,6 @@ +# macro definition for WAITING state + +:submitted: +# NetworkServer + +-s NetworkServer,-e Accepted, --from="UserInterface", --from_host="sending component hostname", --from_instance="sending component instance", --local_jobid="new jobId (Condor, Globus ...)" diff --git a/org.glite.lb.client/examples/waiting_dag.l b/org.glite.lb.client/examples/waiting_dag.l new file mode 100644 index 0000000..01c1d11 --- /dev/null +++ b/org.glite.lb.client/examples/waiting_dag.l @@ -0,0 +1,6 @@ +# macro definition for WAITING state + +:submitted_dag: +# NetworkServer + +-s NetworkServer,-e Accepted, --from="UserInterface", --from_host="sending component hostname", --from_instance="sending component instance", --local_jobid="new jobId (Condor, Globus ...)" diff --git a/org.glite.lb.client/examples/waiting_subjob.l b/org.glite.lb.client/examples/waiting_subjob.l new file mode 100644 index 0000000..41a2acc --- /dev/null +++ b/org.glite.lb.client/examples/waiting_subjob.l @@ -0,0 +1,6 @@ +# macro definition for WAITING state + +:submitted_subjob: +# WorkloadManager + +-s WorkloadManager,-e HelperCall, --helper_name="name of the called component",--helper_params="parameters of the call", --src_role=CALLING diff --git a/org.glite.lb.client/src/producer.c b/org.glite.lb.client/src/producer.c index 7ff6772..bfe0eb3 100644 --- a/org.glite.lb.client/src/producer.c +++ b/org.glite.lb.client/src/producer.c @@ -27,6 +27,10 @@ static const char* socket_path="/tmp/lb_proxy_store.sock"; +#ifdef FAKE_VERSION +int edg_wll_DoLogEvent(edg_wll_Context context, edg_wll_LogLine logline); +int edg_wll_DoLogEventProxy(edg_wll_Context context, edg_wll_LogLine logline); +#else /** *---------------------------------------------------------------------- * Connects to local-logger and sends already formatted ULM string @@ -234,6 +238,7 @@ edg_wll_DoLogEventProxy_end: return edg_wll_Error(context, NULL, NULL); } +#endif /* FAKE_VERSION */ /**