ifdef LB_STANDALONE
stage: generate
- $(MAKE) install PREFIX=${stagedir} DOSTAGE=yes
else
stage: generate doc
- $(MAKE) install PREFIX=${top_srcdir}/${stagedir} DOSTAGE=yes
endif
+ $(MAKE) install PREFIX=${stagedir} DOSTAGE=yes
dist: distsrc distbin
doxygen C.dox
doxygen CPP.dox
+ifdef LB_STANDALONE
+install: generate
+else
install: generate doc
+endif
-mkdir -p ${PREFIX}/${STAGETO}
-mkdir -p ${PREFIX}/share/doc/${package}-${version}
install -m 644 ${GEN_H} ${PREFIX}/${STAGETO}
LOGSRC_T, /**< Source of the event
(integer). */
JOBID_T, /**< JobId value. */
- NOTIFID_T /**< NotifId value. */
+ NOTIFID_T, /**< NotifId value. */
+ FLOAT_T, /**< Float value. */
+ DOUBLE_T, /**< Double value. */
};
Type type; /**< Type of the event as defined by Type. */
*/
int getValInt(Attr name) const;
+ /** Retrieve float attribute.
+ *
+ * Retrieves value for attributes of float type.
+ * \param[in] name Name of the attribute to retrieve.
+ * \returns Integer value of the attribute.
+ * \throw Exception Invalid event type or attribute not
+ * defined for this event.
+ */
+ float getValFloat(Attr name) const;
+
+ /** Retrieve double attribute.
+ *
+ * Retrieves value for attributes of double type.
+ * \param[in] name Name of the attribute to retrieve.
+ * \returns Integer value of the attribute.
+ * \throw Exception Invalid event type or attribute not
+ * defined for this event.
+ */
+ double getValDouble(Attr name) const;
+
/** Retrieve string attribute.
*
* Retrieves value for attributes of string type.
* Retrieves string representation of the attribute name.
* \param[in] name Symbolic name of the attribute.
* \returns String name of the attribute.
- * \throw Exception Invalid event type or attribute not
- * defined for this event.
+ * \throw Exception Invalid attribute name.
+ *
*/
- const std::string & getAttrName(Attr name) const;
+ static const std::string & getAttrName(Attr name);
/** List of attributes and types valid for this instance.
*
*/
const std::vector<std::pair<Attr,AttrType> > & getAttrs(void) const;
+ /** Event name.
+ *
+ * Retrieves string representation of the event type.
+ * \param[in] type Symbolic name of the event type.
+ * \returns String name of the event.
+ * \throw Exception Invalid event type.
+ *
+ */
+ static const std::string getEventName(Type type);
+
private:
static void destroyFlesh(void *);
CountRef<Event> *flesh;
* \returns Name of attribute.
* \throws LoggingException Invalid attribute name.
*/
- const std::string& getAttrName(Attr name) const;
+ static const std::string& getAttrName(Attr name);
/** List of attributes and their types valid for this
* instance.
* \returns List of attributes.
*/
const std::vector<std::pair<Attr,AttrType> >& getAttrs(void) const;
+
+ /** Get name of state.
+ *
+ * Retrieve string representation of symbolic job state.
+ * \param[in] state Symbolic state name.
+ * \returns String state name.
+ * \throw Exception Invalid state.
+ *
+ */
+ static const std::string &getStateName(Code state);
/** Default constructor.
*
#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
*/
-#define EDG_WLL_SEQ_BIGHELPER_INITIAL "UI=2:NS=0:WM=0:BH=1:JSS=0:LM=0:LRMS=0:APP=0"
+#define EDG_WLL_SEQ_BIGHELPER_INITIAL "UI=000002:NS=0000000000:WM=000000:BH=0000000001:JSS=000000:LM=000000:LRMS=000000:APP=000000:LBS=000000"
+
+/**
+ * the wms purger uses this sequence code while logging the cleared event
+ * agreed with Salvatore Monforte
+ */
+#define EDG_WLL_SEQ_CLEAR "UI=000009:NS=0000096669:WM=000000:BH=0000000000:JSS=000000:LM=000000:LRMS=000000:APP=000000:LBS=000000"
+
+/**
+ * used for logging abort event by wms components
+ * agreed with Francesco Giacomini
+ */
+#define EDG_WLL_SEQ_ABORT "UI=000000:NS=0000096660:WM=000000:BH=0000000000:JSS=000000:LM=000000:LRMS=000000:APP=000000:LBS=000000"
+
/** Retrieve current sequence code from the context */
char * edg_wll_GetSequenceCode(
$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";
}
@@@}
Revision history:
$Log$
+ Revision 1.6.2.1 2007/04/29 15:54:38 jpospi
+ cleanup: fix wrong staging, skip make doc in LB_STANDALONE
+
+ Revision 1.6 2007/02/03 19:27:15 jpospi
+ first step to remove the ant dependency
+
Revision 1.5 2005/08/03 09:30:10 akrenek
Merged the release 1.0 branch
<echo file="${module.build.dir}/Makefile.inc">
top_srcdir=..
builddir=build
-stagedir=${stage.dir}
+stagedir=${stage.abs.dir}
distdir=${dist.dir}
package=${module.package.name}
globalprefix=${global.prefix}
PREFIX=${install.dir}
version=${module.version}
</echo>
- <copy file="${component.dir}/doc/C.dox"
- tofile="${module.build.dir}/C.dox"
- preservelastmodified="true"
- overwrite="true" />
- <copy file="${component.dir}/doc/CPP.dox"
- tofile="${module.build.dir}/CPP.dox"
- preservelastmodified="true"
- overwrite="true" />
- <echo file="${module.build.dir}/C.dox" append="true" >
-PROJECT_NUMBER = ${module.version}
- </echo>
- <echo file="${module.build.dir}/CPP.dox" append="true" >
-PROJECT_NUMBER = ${module.version}
- </echo>
</target>
</project>
-#Fri Sep 02 14:16:31 CEST 2005
-# glite-lb-client-interface_branch_3_0_0_RC15 tag is taken!
-module.version=2.3.0
+# $Id$
+# $Name$
+module.version=2.3.2
module.age=1
THRPLUSLIB:=libglite_lb_clientpp_${thrflavour}.la
TOOLS:=dump load purge lb_dump_exporter ${LB_PERF_TOOLS}
-EXAMPLES:=log_usertag_proxy job_log job_reg feed_shark notify query_ext query_seq_code stats abort_job change_acl stresslog
-EXAMPLES:=log_usertag_proxy job_log job_reg feed_shark notify query_ext query_seq_code stats abort_job change_acl stresslog lbmon flood_proxy dagids stress_context
+EXAMPLES:=log_usertag_proxy job_log job_reg feed_shark notify query_ext query_seq_code stats abort_job change_acl stresslog flood_proxy dagids stress_context parse_eventsfile
EXAMPLES_CL=user_jobs job_status
EXAMPLES_CL_THR=user_jobs_threaded
version_info:=-version-info ${shell \
perl -e '$$,=":"; @F=split "\\.","${version}"; print $$F[0]+$$F[1]+${offset},$$F[2],$$F[1]' }
+default: all
+
${LIB}: ${LIBOBJS}
${LINK} ${version_info} -o $@ ${LIBLOBJS} -rpath ${PREFIX}/lib \
${COMMON_LIB} \
${INSTALL} -m 644 ${MAN_GZ} ${PREFIX}/share/man/man1
clean:
+ rm -rf *.o *.lo .libs lib* *.c *.cpp producer_test
+ rm -rf ${LIB} ${THRLIB} ${TOOLS} logevent ${PLUSLIB} ${THRPLUSLIB} ${MAN_GZ}
+ rm -rf ${EXAMPLES} ${EXAMPLES_CL} ${EXAMPLES_CL_THR} ${sh_PROGS}
+
check_version:
${CHECK_VERSION} ${stagedir}/include/glite/lb/interface_version.h
+++ /dev/null
-#ident "$Header$"
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-#include <getopt.h>
-#include <time.h>
-
-#include "glite/lb/consumer.h"
-
-static void usage(char *);
-static int query_all(edg_wll_Context, int, struct timeval, edg_wll_JobStat **, edg_wlc_JobId **);
-static void dgerr(edg_wll_Context,char *);
-
-static char *myname = NULL;
-static int debug = 0, verbose = 0, lbproxy =0;
-static const char rcsid[] = "@(#)$Id$";
-
-static struct option const long_options[] = {
- { "help", no_argument, 0, 'h' },
- { "version", no_argument, 0, 'V' },
- { "verbose", no_argument, 0, 'v' },
- { "debug", no_argument, 0, 'd' },
- { "lbproxy", required_argument, 0, 'x' },
- { NULL, 0, NULL, 0}
-};
-
-int main(int argc,char *argv[]) {
- edg_wll_Context ctx;
- edg_wll_JobStat *statesOut = NULL;
- edg_wlc_JobId *jobsOut = NULL;
- struct timeval time_now;
-
- int i, result, opt, nJobs;
- i = result = opt = 0;
- gettimeofday(&time_now,0);
-
- myname = argv[0];
- fprintf(stdout,"\n");
- /* get arguments */
- while ((opt = getopt_long(argc,argv,
- "h" /* help */
- "V" /* version */
- "v" /* verbose */
- "d" /* debug */
- "x", /* lbproxy */
- long_options, (int *) 0)) != EOF) {
-
- switch (opt) {
- case 'V': fprintf(stdout,"%s:\t%s\n",argv[0],rcsid); exit(0);
- case 'v': verbose = 1; break;
- case 'd': debug = 1; break;
- case 'x': lbproxy = 1; break;
- case 'h':
- default:
- usage(argv[0]); exit(0);
- }
- }
- if ( edg_wll_InitContext(&ctx) ) {
- fprintf(stderr,"%s: cannot initialize edg_wll_Context\n ",myname);
- exit(1);
- }
-
- if ( (result = query_all(ctx, EDG_WLL_JOB_CLEARED, time_now, &statesOut, &jobsOut)) ) {
- dgerr(ctx, "edg_wll_QueryJobs");
- } else {
- fprintf(stdout,"Number of jobs... ");
- }
-
- nJobs = 0;
- if ( jobsOut ) {
- for (i=0; jobsOut[i]; i++) edg_wlc_JobIdFree(jobsOut[i]); {
- nJobs++;
- free(jobsOut);
- }
- }
- if ( statesOut ) {
- for (i=0; statesOut[i].state; i++) edg_wll_FreeStatus(&statesOut[i]);
- free(statesOut);
- }
- edg_wll_FreeContext(ctx);
-
-
- return result;
-}
-
-static void
-usage(char *name) {
- fprintf(stderr,"Usage: %s [-x]\n", name);
-}
-
-static int
-query_all(edg_wll_Context ctx, int query_status, struct timeval query_time, edg_wll_JobStat **statesOut, edg_wlc_JobId **jobsOut) {
- edg_wll_QueryRec jc[3];
- int ret;
-
- memset(jc, 0, sizeof jc);
-
- /* jobs in the state 'query_status' within last hour */
- jc[0].attr = EDG_WLL_QUERY_ATTR_STATUS;
- jc[0].op = EDG_WLL_QUERY_OP_EQUAL;
- jc[0].value.i = query_status;
- jc[1].attr = EDG_WLL_QUERY_ATTR_TIME;
- jc[1].attr_id.state = query_status;
- jc[1].op = EDG_WLL_QUERY_OP_WITHIN;
- jc[1].value.t.tv_sec = query_time.tv_sec - 3600;
- jc[1].value.t.tv_usec = query_time.tv_usec;
- jc[1].value2.t.tv_sec = query_time.tv_sec;
- jc[1].value2.t.tv_usec = query_time.tv_usec;
- jc[2].attr = EDG_WLL_QUERY_ATTR_UNDEF;
-
- if ( (ret = edg_wll_QueryJobs(ctx, jc, 0, jobsOut, statesOut)) ) {
- if ( ret == E2BIG ) {
- int r;
- if ( edg_wll_GetParam(ctx, EDG_WLL_PARAM_QUERY_RESULTS, &r) ) return ret;
- if ( r != EDG_WLL_QUERYRES_LIMITED ) return ret;
-
- fprintf(stderr," edg_wll_QueryJobs() Warning: only limited result returned!\n");
- return 0;
- } else return ret;
- }
-
- return ret;
-}
-
-static void
-dgerr(edg_wll_Context ctx,char *where) {
- char *etxt,*edsc;
-
- edg_wll_Error(ctx,&etxt,&edsc);
- fprintf(stderr,"%s: %s: %s",myname,where,etxt);
- if (edsc) fprintf(stderr," (%s)",edsc);
- putc('\n',stderr);
- if(etxt) free(etxt);
- if(edsc) free(edsc);
-}
--- /dev/null
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <string.h>
+#include <errno.h>
+#include <fcntl.h>
+
+#include "glite/lb/producer.h"
+#include "glite/lb/events.h"
+#include "glite/lb/events_parse.h"
+
+#define MAXMSGSIZE 10240
+
+extern char *optarg;
+extern int opterr,optind;
+
+static const char *me;
+
+static void usage()
+{
+ fprintf(stderr,"usage: %s [-n] -f file_name\n", me);
+}
+
+int main(int argc, char *argv[])
+{
+ char *filename = NULL;
+ char buf[MAXMSGSIZE];
+ int done = 0,i=0,notif=0;
+ edg_wll_Context ctx;
+ edg_wll_Event *event = NULL;
+ FILE *f;
+ edg_wll_ErrorCode (*parse)(edg_wll_Context context,edg_wll_LogLine logline,edg_wll_Event **event);
+ edg_wll_LogLine (*unparse)(edg_wll_Context context,edg_wll_Event *event);
+ const char *parse_str,*unparse_str;
+
+ edg_wll_InitContext(&ctx);
+ opterr = 0;
+
+ me = strdup(argv[0]);
+
+ do {
+ switch (getopt(argc,argv,"nf:")) {
+ case 'n': notif = 1; break;
+ case 'f': filename = (char *) strdup(optarg); break;
+ case '?': usage(); exit(EINVAL);
+ case -1: done = 1; break;
+ }
+ } while (!done);
+
+ /* choose the right (un)parser */
+ if (notif) {
+ parse = edg_wll_ParseNotifEvent;
+ parse_str = "edg_wll_ParseNotifEvent";
+ unparse = edg_wll_UnparseNotifEvent;
+ unparse_str = "edg_wll_UnparseNotifEvent";
+ } else {
+ parse = edg_wll_ParseEvent;
+ parse_str = "edg_wll_ParseEvent";
+ unparse = edg_wll_UnparseEvent;
+ unparse_str = "edg_wll_UnparseEvent";
+ }
+
+ if (!filename) {
+ fprintf(stderr,"%s: -f required\n",me);
+ usage();
+ exit(1);
+ }
+
+ if ( (f = fopen(filename,"r")) == NULL) {
+ perror(filename);
+ exit(1);
+ } else {
+ fprintf(stderr,"Parsing file '%s' for correctness:\n",filename);
+ }
+
+ /* parse events */
+ i = 1;
+ while (!feof(f)) {
+ if (!fgets(buf,sizeof(buf),f)) break;
+ if (strcmp(buf,"\n")) {
+ // fprintf(stdout,"%d: %s\n",i,buf);
+
+ if (parse(ctx,buf,&event) != 0) {
+ /* Parse ERROR: */
+ char *et=NULL,*ed=NULL;
+
+ edg_wll_Error(ctx,&et,&ed);
+ fprintf(stderr,"line %d: %s() error: %s (%s)\n",i,parse_str,et,ed);
+ if (et) free(et);
+ if (ed) free(ed);
+ } else {
+ /* Parse OK : */
+ char *es=NULL;
+ edg_wll_LogLine logline = NULL;
+
+ es=edg_wll_EventToString(event->type);
+ logline = unparse(ctx,event);
+ fprintf(stderr,"line %d: %s() o.k. (event %s), ",i,parse_str,es);
+ if (logline) {
+ fprintf(stderr,"%s() o.k.\n",unparse_str);
+ free(logline);
+ } else {
+ fprintf(stderr,"%s() error\n",unparse_str);
+ }
+ if (es) free(es);
+ }
+ if (event) edg_wll_FreeEvent(event);
+ }
+ i++;
+ }
+ fclose(f);
+
+ edg_wll_FreeContext(ctx);
+
+ return 0;
+}
static void usage()
{
- fprintf(stderr,"usage: %s [-m bkserver] [-x] [-n jobs] [-f file_name]\n", me);
+ fprintf(stderr,"usage: %s -m bkserver [-x] [-N numjobs] [-n subjobs (each)] -f file_name \n", me);
}
int main(int argc, char *argv[])
FILE *f;
edg_wll_InitContext(&ctx);
+
opterr = 0;
me = strdup(argv[0]);
do {
- switch (getopt(argc,argv,"m:xn:f:")) {
+ switch (getopt(argc,argv,"m:xN:n:f:")) {
case 'm': server = strdup(optarg); break;
case 'x': lbproxy = 1; break;
- case 'n':
- njobs = atoi(optarg);
- fprintf(stderr,"WARNING: -n option not implemented yet\n");
- break;
+ case 'N': njobs = atoi(optarg); break;
+ case 'n': num_subjobs = atoi(optarg); break;
case 'f': filename = (char *) strdup(optarg); break;
case '?': usage(); exit(EINVAL);
case -1: done = 1; break;
exit(1);
}
- if (njobs <= 0) {
+ if ((njobs <= 0) || (num_subjobs)) {
fprintf(stderr,"%s: wrong number of jobs\n",me);
usage();
exit(1);
exit(1);
}
+/* MAIN LOOP */
+for (i = 1; i<njobs; i++) {
/* create jobid */
if (!job) {
char *p = strchr(server,':');
if (p) *p=0;
edg_wlc_JobIdCreate(server,p?atoi(p+1):0,&jobid);
job = edg_wlc_JobIdUnparse(jobid);
- // fprintf(stdout,"new jobid: %s\n",job);
+ fprintf(stdout,"new jobid: %s\n",job);
}
else if ((errno = edg_wlc_JobIdParse(job,&jobid))) {
perror(job);
/* register */
edg_wll_SetParam(ctx,EDG_WLL_PARAM_SOURCE,EDG_WLL_SOURCE_USER_INTERFACE);
// 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?EDG_WLL_REGJOB_COLLECTION:EDG_WLL_REGJOB_SIMPLE,
"JDL: blabla", "NNNSSSS",
num_subjobs,NULL,&subjobs))
{
}
} else {
if (edg_wll_RegisterJobSync(ctx,jobid,
- num_subjobs?EDG_WLL_REGJOB_DAG:EDG_WLL_REGJOB_SIMPLE,
+ num_subjobs?EDG_WLL_REGJOB_COLLECTION:EDG_WLL_REGJOB_SIMPLE,
"JDL: blabla", "NNNSSSS",
num_subjobs,NULL,&subjobs))
{
}
/* log events */
- i = 1;
while (!feof(f)) {
edg_wll_LogLine logline;
}
if (logline) free(logline);
}
- i++;
}
- fclose(f);
+ rewind(f);
+ if (job) free(job); job = NULL;
/* seq. code */
seq = edg_wll_GetSequenceCode(ctx);
- fprintf(stdout,"\n%s=\"%s\"\n",num_subjobs?"EDG_WL_DAG_JOBID":"EDG_JOBID",job);
+ fprintf(stdout,"\n%s=\"%s\"\n",num_subjobs?"EDG_WL_COLLECTION_JOBID":"EDG_JOBID",job);
fprintf(stdout,"EDG_WL_SEQUENCE=\"%s\"\n",seq);
free(seq);
- free(job);
if (num_subjobs) for (i=0; subjobs[i]; i++) {
char *job_s = edg_wlc_JobIdUnparse(subjobs[i]);
free(job_s);
}
+} /* MAIN LOOP */
+
+ fclose(f);
edg_wll_FreeContext(ctx);
return 0;
-#Fri Sep 02 14:17:41 CEST 2005
-# glite-lb-client_branch_3_0_0_RC15 tag is taken!
-module.version=2.3.0
+# $Id$
+# $Name$
+module.version=2.3.3
module.age=1
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};
return -1; /* gcc, shut up! */
}
+float Event::getValFloat(Attr attr) const
+{
+ edg_wll_Event const *cev = (edg_wll_Event *) flesh->ptr;
+
+@@@{
+ $indent = "\t";
+ typeswitch '_common_',undef,'float';
+@@@}
+
+ switch (cev->type) {
+@@@{
+ $indent = "\t\t";
+ for my $t (getTypes $event) {
+ gen "\t\tcase ".uc($t).":\n";
+ typeswitch $t,'goto badattr;','float';
+ }
+@@@}
+ default:
+ STACK_ADD;
+ throw(Exception(EXCEPTION_MANDATORY, EINVAL,
+ "attribute is not of float type"));
+ }
+badattr:
+ STACK_ADD;
+ throw(Exception(EXCEPTION_MANDATORY, ENOENT, "invalid attribute"));
+ return -1; /* gcc, shut up! */
+}
+
+double Event::getValDouble(Attr attr) const
+{
+ edg_wll_Event const *cev = (edg_wll_Event *) flesh->ptr;
+
+@@@{
+ $indent = "\t";
+ typeswitch '_common_',undef,'double';
+@@@}
+
+ switch (cev->type) {
+@@@{
+ $indent = "\t\t";
+ for my $t (getTypes $event) {
+ gen "\t\tcase ".uc($t).":\n";
+ typeswitch $t,'goto badattr;','double';
+ }
+@@@}
+ default:
+ STACK_ADD;
+ throw(Exception(EXCEPTION_MANDATORY, EINVAL,
+ "attribute is not of double type"));
+ }
+badattr:
+ STACK_ADD;
+ throw(Exception(EXCEPTION_MANDATORY, ENOENT, "invalid attribute"));
+ return -1; /* gcc, shut up! */
+}
+
static char const *get_string_val(const edg_wll_Event *cev, Event::Attr attr)
{
@@@{
@@@}
};
-
const std::string &
-Event::getAttrName(Attr attr) const
+Event::getAttrName(Attr attr)
{
if (attr<0 || attr>=ATTR_MAX) {
STACK_ADD;
}
+const std::string Event::getEventName(Type type)
+{
+ if(type < 0 || type >= TYPE_MAX) {
+ STACK_ADD;
+ throw(Exception(EXCEPTION_MANDATORY, EINVAL, "invalid event type"));
+ }
+
+ return std::string(edg_wll_EventToString(edg_wll_EventCode(type)));
+}
+
+
void
Event::destroyFlesh(void *in)
{
};
const std::string &
-JobStatus::getAttrName(JobStatus::Attr attr) const
+JobStatus::getAttrName(JobStatus::Attr attr)
{
if (attr<0 || attr>=ATTR_MAX) {
STACK_ADD;
return attrs;
}
+const std::string &
+JobStatus::getStateName(Code state)
+{
+ if (state<0 || state>=CODE_MAX) {
+ STACK_ADD;
+ throw(Exception(EXCEPTION_MANDATORY,
+ EINVAL,
+ "status code invalid"));
+ }
+ return names[state];
+}
+
+
void
JobStatus::destroyFlesh(void *p)
{
return rs;
}
+static void read_float(const edg_wll_Args* o, char* arg, char* par)
+{
+ float d;
+ if (!par)
+ {
+ printf("Option: %s - missing float value\n", arg);
+ exit(1);
+ }
+ d = strtof(par,NULL);
+ if (o->min != o->max)
+ {
+ if (d < o->min && d > o->max)
+ {
+ printf("Option: %s - value: %f out of range <%d, %d>",
+ arg, d, o->min, o->max);
+ exit(1);
+ }
+ }
+ if (o->value)
+ *(float*)o->value = d;
+}
+
static void read_double(const edg_wll_Args* o, char* arg, char* par)
{
double d;
if (!par)
{
- printf("Option: %s - missing double/float value\n", arg);
+ printf("Option: %s - missing double value\n", arg);
exit(1);
}
- d = atof(par);
+ d = strtod(par,NULL);
if (o->min != o->max)
{
if (d < o->min && d > o->max)
case Args::Option::BOOL:
read_bool(&o[j], arr[i], par, r);
break;
+ case Args::Option::FLOAT:
+ read_float(&o[j], arr[i], par, r);
+ break;
case Args::Option::DOUBLE:
read_double(&o[j], arr[i], par, r);
break;
if (!read_bool(o, arg, par))
ctx->idx--; // no argument given
break;
+ case EDG_WLL_ARGS_FLOAT:
+ read_float(o, arg, par);
+ break;
case EDG_WLL_ARGS_DOUBLE:
read_double(o, arg, par);
break;
EDG_WLL_ARGS_BOOL,
EDG_WLL_ARGS_INT,
EDG_WLL_ARGS_UINT16,
+ EDG_WLL_ARGS_FLOAT,
EDG_WLL_ARGS_DOUBLE,
EDG_WLL_ARGS_STRING,
EDG_WLL_ARGS_HELP,
my %typetab = (
"char *", "EDG_WLL_ARGS_STRING",
"int", "EDG_WLL_ARGS_INT",
+ "double", "EDG_WLL_ARGS_DOUBLE",
"edg_wlc_JobId", "EDG_WLL_ARGS_JOBID",
"edg_wll_NotifId", "EDG_WLL_ARGS_NOTIFID",
"edg_wll_Source", "EDG_WLL_ARGS_SOURCE",
ctx->connections->connPool[index].peerPort,index);
#endif
+#if 0
/* acquire gss credentials */
ret = edg_wll_gss_acquire_cred_gsi(
ctx->p_proxy_filename ? ctx->p_proxy_filename : ctx->p_cert_filename,
fprintf(stderr,"edg_wll_log_connect: going on anonymously!\n");
}
#endif
+#endif
#ifdef EDG_WLL_LOG_STUB
fprintf(stderr,"edg_wll_log_connect: opening connection to local-logger %s:%d\n",
ctx->connections->connPool[index].peerName,
/* gss_connect */
if (ctx->connections->connPool[index].gss.context == GSS_C_NO_CONTEXT) {
+ /* acquire gss credentials */
+ ret = edg_wll_gss_acquire_cred_gsi(
+ ctx->p_proxy_filename ? ctx->p_proxy_filename : ctx->p_cert_filename,
+ ctx->p_proxy_filename ? ctx->p_proxy_filename : ctx->p_key_filename,
+ &ctx->connections->connPool[index].gsiCred, &my_subject_name, &gss_stat);
+ /* give up if unable to acquire prescribed credentials, otherwise go on anonymously */
+ if (ret && ctx->p_proxy_filename) {
+ edg_wll_SetErrorGss(ctx, "edg_wll_gss_acquire_cred_gsi(): failed to load GSI credentials", &gss_stat);
+ goto edg_wll_log_connect_err;
+ }
+#ifdef EDG_WLL_LOG_STUB
+ if (my_subject_name != NULL) {
+ fprintf(stderr,"edg_wll_log_connect: using certificate: %s\n",my_subject_name);
+ } else {
+ fprintf(stderr,"edg_wll_log_connect: going on anonymously!\n");
+ }
+#endif
if ((answer = edg_wll_gss_connect(
ctx->connections->connPool[index].gsiCred,
ctx->connections->connPool[index].peerName,
edg_wll_poolUnlock();
#ifdef EDG_WLL_LOG_STUB
- fprintf(stderr,"edg_wll_log_connect: done (remaining timeout %d.%06d sec)\n",
+ if (answer) {
+ fprintf(stderr,"edg_wll_log_connect: error (remaining timeout %d.%06d sec)\n",
(int) ctx->p_tmp_timeout.tv_sec, (int) ctx->p_tmp_timeout.tv_usec);
+ } else {
+ fprintf(stderr,"edg_wll_log_connect: done o.k. (remaining timeout %d.%06d sec)\n",
+ (int) ctx->p_tmp_timeout.tv_sec, (int) ctx->p_tmp_timeout.tv_usec);
+ }
#endif
*conn = index;
return answer;
memset(&conn,0,sizeof(conn));
/* connect to lbproxy */
- if ((ret = edg_wll_log_proxy_connect(ctx,&conn)) < 0) {
+ if ((ret = edg_wll_log_proxy_connect(ctx,&conn))) {
edg_wll_UpdateError(ctx,EDG_WLL_IL_PROTO,"edg_wll_DoLogEventProxy(): edg_wll_log_proxy_write error");
goto edg_wll_DoLogEventProxy_end;
}
memset(&conn,0,sizeof(conn));
/* connect to bkserver */
- if ((ret = edg_wll_log_direct_connect(ctx,&conn)) < 0) {
+ if ((ret = edg_wll_log_direct_connect(ctx,&conn))) {
edg_wll_UpdateError(ctx,EDG_WLL_IL_PROTO,"edg_wll_DoLogEventDirect(): edg_wll_log_direct_connect error");
goto edg_wll_DoLogEventDirect_end;
}
(int) ctx->p_tmp_timeout.tv_sec, (int) ctx->p_tmp_timeout.tv_usec);
#endif
/* connect to bkserver */
- if ((ret = edg_wll_log_direct_connect(ctx,&con_bkserver)) < 0) {
+ if ((ret = edg_wll_log_direct_connect(ctx,&con_bkserver))) {
edg_wll_UpdateError(ctx,EAGAIN,"edg_wll_RegisterJobProxy(): edg_wll_log_direct_connect error");
goto edg_wll_registerjobproxy_end;
}
/* connect to lbproxy */
- if ((ret = edg_wll_log_proxy_connect(ctx,&con_lbproxy)) < 0) {
+ if ((ret = edg_wll_log_proxy_connect(ctx,&con_lbproxy))) {
edg_wll_UpdateError(ctx,EAGAIN,"edg_wll_RegisterJobProxy(): edg_wll_log_proxy_connect error");
goto edg_wll_registerjobproxy_end;
}
ifdef LB_PERF
STAGE_PERFTEST=mkdir -p ${PREFIX}/examples/perftest; \
install -m 644 ${top_srcdir}/examples/*.log ${PREFIX}/examples/perftest; \
- install -m 755 ${top_srcdir}/src/perftest_common.sh ${PREFIX}/sbin
+ mkdir -p ${PREFIX}/sbin; install -m 755 ${top_srcdir}/src/perftest_common.sh ${PREFIX}/sbin
else
STAGE_PERFTEST=true
endif
fi
clean:
- rm -rf *.o *.lo .libs lib*
+ rm -rf *.o *.lo .libs lib* *.c test_parse il_test
%.o: %.c
#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 */
void edg_wll_add_tagged_string_to_XMLBody(char **body, const char *toAdd, const char *tag, const char *name, const char *tag2, const char *null);
void edg_wll_add_int_to_XMLBody(char **body, const int toAdd, const char *tag, const int null);
void edg_wll_add_float_to_XMLBody(char **body, const float toAdd, const char *tag, const float null);
+void edg_wll_add_double_to_XMLBody(char **body, const double toAdd, const char *tag, const double null);
void edg_wll_add_timeval_to_XMLBody(char **body, struct timeval toAdd, const char *tag, const struct timeval null);
void edg_wll_add_jobid_to_XMLBody(char **body, edg_wlc_JobId toAdd, const char *tag, const void *null);
void edg_wll_add_notifid_to_XMLBody(char **body, edg_wll_NotifId toAdd, const char *tag, const void *null);
edg_wll_JobStatCode edg_wll_from_string_to_edg_wll_JobStatCode(edg_wll_XML_ctx *XMLCtx);
int edg_wll_from_string_to_int(edg_wll_XML_ctx *XMLCtx);
float edg_wll_from_string_to_float(edg_wll_XML_ctx *XMLCtx);
+double edg_wll_from_string_to_double(edg_wll_XML_ctx *XMLCtx);
long edg_wll_from_string_to_long(edg_wll_XML_ctx *XMLCtx);
uint16_t edg_wll_from_string_to_uint16_t(edg_wll_XML_ctx *XMLCtx);
struct timeval edg_wll_from_string_to_timeval(edg_wll_XML_ctx *XMLCtx);
-#Fri Sep 02 14:17:07 CEST 2005
-module.version=5.0.0
+# $Id$
+# $Name$
+module.version=5.0.3
module.age=1
/* XXX */
for (i=0; i<EDG_WLL_PARAM__LAST; i++) edg_wll_SetParam(out,i,NULL);
+ out->p_tmp_timeout.tv_sec = out->p_log_timeout.tv_sec;
+ out->p_tmp_timeout.tv_usec = out->p_log_timeout.tv_usec;
+
out->connections = edg_wll_initConnections();
// out->connections->connPool = (edg_wll_ConnPool *) calloc(out->connections->poolSize, sizeof(edg_wll_ConnPool));
out->connPoolNotif = (edg_wll_ConnPool *) calloc(1, sizeof(edg_wll_ConnPool));
case EDG_WLL_SEQ_PBS:
ret = strdup(ctx->p_seqcode.pbs);
break;
- default:
- assert(0); /* seq. number type was not correctly set */
+ 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;
}
return ret;
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";
edg_wll_ULMDateToTimeval(value,&this->any.arrived);
break;
case ULM_HOST :
- if (!(((this->any.host) == NULL && (NULL) == NULL) || ((this->any.host)&&(NULL)&& !strcmp(this->any.host,NULL)))) DUPLICITY
+ if (!(((this->any.host) == NULL) || ((this->any.host)&& !strcmp(this->any.host,"")))) DUPLICITY
this->any.host = strdup(value);
break;
case ULM_LVL :
this->any.source = edg_wll_StringToSource(value);
break;
case EDG_WLL_COMMON_SRC_INSTANCE :
- if (!(((this->any.src_instance) == NULL && (NULL) == NULL) || ((this->any.src_instance)&&(NULL)&& !strcmp(this->any.src_instance,NULL)))) DUPLICITY
+ if (!(((this->any.src_instance) == NULL) || ((this->any.src_instance)&& !strcmp(this->any.src_instance,"")))) DUPLICITY
this->any.src_instance = strdup(value);
break;
@@@{
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;
}
}
+void edg_wll_add_double_to_XMLBody(char **body, const double toAdd, const char *tag, const double null)
+{
+ if (toAdd != null) {
+ char *newBody;
+
+ trio_asprintf(&newBody,"%s\t\t\t<%s>%|Xf</%s>\r\n", *body, tag, toAdd, tag);
+
+ free(*body);
+ *body = newBody;
+ }
+}
/* edg_wll_add_timeval_to_XMLBody(&body, eventsOut[i].any.tv, "timestamp", -1) */
return(out);
}
+double edg_wll_from_string_to_double(edg_wll_XML_ctx *XMLCtx)
+{
+ double out = -1;
+ char *s;
+
+ s = edg_wll_UnescapeXML((const char *) XMLCtx->char_buf);
+ if (s) {
+ out = strtod(s, (char **) NULL);
+ free(s);
+ }
+ edg_wll_freeBuf(XMLCtx);
+
+ return(out);
+}
long edg_wll_from_string_to_long(edg_wll_XML_ctx *XMLCtx)
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 "
il_test.o IlTestBase.o server_msgTest.o event_queueTest.o input_queue_socketTest.o event_storeTest.o: %.o: %.cpp
${CXX} ${CFLAGS} ${GLOBUSTHRINC} ${TEST_INC} -c $< -o $@
+
+clean:
+ rm -rf .libs/ *.o *.no ${LOGD} ${INTERLOGD} ${NOTIF_INTERLOGD}
#Fri Sep 02 14:18:17 CEST 2005
-module.version=1.4.0
+module.version=1.4.2
module.age=1
int
event_store_recover(struct event_store *es)
{
- struct event_queue *eq_l = NULL, *eq_b, *eq_b_new;
+ struct event_queue *eq_l = NULL, *eq_b;
struct server_msg *msg;
char *event_s;
int fd, ret;
assert(es != NULL);
#if defined(IL_NOTIFICATIONS)
- eq_b = queue_list_get(es->dest);
+ /* destination queue has to be found for each message separately */
#else
/* find bookkepping server queue */
eq_b = queue_list_get(es->job_id_s);
}
#ifdef IL_NOTIFICATIONS
- eq_b_new = queue_list_get(msg->dest);
- if (eq_b_new != eq_b) {
- free(es->dest);
- es->dest = strdup(msg->dest);
- eq_b = eq_b_new;
- }
+ eq_b = queue_list_get(msg->dest);
#endif
/* now enqueue to the BS, if neccessary */
goto out;
}
-#if defined(IL_NOTIFICATIONS)
- es->dest = dest_name;
-#endif
-
if((es->last_committed_ls == 0) &&
(es->last_committed_bs == 0) &&
(es->offset == 0)) {
if(notifid_map_set_dest(msg->job_id_s, eq) < 0)
return(-1);
/* move all events with this notif_id from eq_known to eq */
- if(eq_known != NULL)
+ if(eq_known != NULL) {
event_queue_move_events(eq_known, eq, msg->job_id_s);
+ /* XXX - we should kill the old queue too */
+ }
}
#endif
/* Probably no, because the attempt to recover means we have missed some events,
and delivery of this one will not move offset ahead. So try our best and deliver it
even if it may cause duplicates on server. */
- /* COMMENTED OUT:
- server_msg_free(msg);
- event_store_release(es);
- return(0);
- */
+ /* COMMENTED OUT: uncommented again */
+ server_msg_free(msg);
+ event_store_release(es);
+ return(0);
+ /* */
} else if(ret == 0) {
/* we have seen this event already */
server_msg_free(msg);
strncpy(outfilename+count_total,".",1); count_total+=1; count=strlen(jobId);
strncpy(outfilename+count_total,jobId,count); count_total+=count;
outfilename[count_total]='\0';
- edg_wll_ll_log(LOG_DEBUG,"o.k.\n");
+// edg_wll_ll_log(LOG_DEBUG,"o.k.\n");
/* fopen and properly handle the filelock */
#ifdef LOGD_NOFILE
edg_wll_InitContext(&context);
/* parse the notification event */
- if((ret=edg_wll_ParseNotifEvent(context, event, ¬if_event))) {
+ if((ret=edg_wll_ParseNotifEvent(context, event->data, ¬if_event))) {
set_error(IL_LBAPI, ret, "server_msg_init: error parsing notification event");
return(-1);
}
-lglobus_common_${nothrflavour} \
-lglobus_gssapi_gsi_${nothrflavour} \
+archlib:=lib
+host_cpu:=${shell uname -m}
+ifeq (${host_cpu},x86_64)
+ archlib:=lib64
+endif
+
ifneq (${mysql_prefix},/usr)
ifeq ($(shell echo ${mysql_version} | cut -d. -f1,2),4.1)
- mysqlib := -L${mysql_prefix}/lib/mysql
+ mysqlib := -L${mysql_prefix}/${archlib}/mysql
else
- mysqlib := -L${mysql_prefix}/lib
+ mysqlib := -L${mysql_prefix}/${archlib}
endif
endif
-glite_lb_proxy: lbproxy.o fake_write2rgma.o ${STATIC_LIB_BK}
+glite-lb-proxy: lbproxy.o fake_write2rgma.o ${STATIC_LIB_BK}
@echo DEBUG: mysql_version=${mysql_version} mysql_prefix=${mysql_prefix}
@echo DEBUG: shell: x$(shell echo ${mysql_version} | cut -d. -f1,2)x
${LINK} -o $@ lbproxy.o fake_write2rgma.o ${LB_PROXY_LIBS}
-glite_lb_proxy_perf: lbproxy.o fake_write2rgma.o ${STATIC_LIB_BK}
+glite-lb-proxy-perf: lbproxy.o fake_write2rgma.o ${STATIC_LIB_BK}
${LINK} -o $@ lbproxy.o fake_write2rgma.o ${LB_PROXY_LIBS}
default all: compile
-compile: glite_lb_proxy
+compile: glite-lb-proxy
check: compile
-echo No test so far
-mkdir -p ${PREFIX}/share/doc/${package}-${version}
${INSTALL} -m 644 ${top_srcdir}/LICENSE ${PREFIX}/share/doc/${package}-${version}
${INSTALL} -m 644 ${top_srcdir}/doc/README ${top_srcdir}/doc/README.deploy ${PREFIX}/share/doc/${package}-${version}
- ${INSTALL} -m 755 glite_lb_proxy ${PREFIX}/bin/glite-lb-proxy
+ ${INSTALL} -m 755 glite-lb-proxy ${PREFIX}/bin/glite-lb-proxy
${INSTALL} -m 644 ${top_srcdir}/config/glite-lb-dbsetup-proxy.sql ${PREFIX}/etc
${INSTALL} -m 755 ${top_srcdir}/config/startup ${PREFIX}/etc/init.d/glite-lb-proxy
clean:
+ rm -rf *.o .libs glite-lb-proxy
%.c: %.c.T
rm -f $@
#Fri Sep 02 14:18:53 CEST 2005
-module.version=1.4.0
-module.age=1
+module.version=1.4.1
+module.age=3
#Fri Sep 02 14:17:59 CEST 2005
-module.version=2.2.4
+module.version=2.2.5
module.age=1
{
kick_client = KICK_HANDLER;
} else {
+ req_cnt++;
first_request = 0;
to = set_request_to;
if ((rv = services[srv].on_request_hnd(conn,to.tv_sec>=0 ? &to : NULL,clnt_data)) == ENOTCONN) {
default all: compile
# disable lb plugin in order to build also with 3.1 JP
-#BUILD_PLUGIN=yes
+BUILD_PLUGIN=yes
GLITE_LB_SERVER_WITH_WS=yes
gsoap_bin_prefix:=${shell if [ -x ${gsoap_prefix}/bin/soapcpp2 ]; then echo ${gsoap_prefix}/bin; else echo ${gsoap_prefix}; fi }
+archlib:=lib
+host_cpu:=${shell uname -m}
+ifeq (${host_cpu},x86_64)
+ archlib:=lib64
+endif
+
ifneq (${mysql_prefix},/usr)
ifeq ($(shell echo ${mysql_version} | cut -d. -f1,2),4.1)
- mysqlib := -L${mysql_prefix}/lib/mysql
+ mysqlib := -L${mysql_prefix}/${archlib}/mysql
else
- mysqlib := -L${mysql_prefix}/lib
+ mysqlib := -L${mysql_prefix}/${archlib}
endif
endif
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 \
stored_master.o srv_purge.o server_state.o dump.o lb_authz.o load.o \
notification.o il_notification.o notif_match.o stats.o
-glite_lb_bkserverd: ${NSMAP} ${BKSERVER_OBJS}
+glite-lb-bkserverd: ${NSMAP} ${BKSERVER_OBJS}
${LINKXX} -o $@ ${BKSERVER_OBJS} ${BKSERVER_LIBS}
-glite_lb_bkindex: ${INDEX_OBJS}
+glite-lb-bkindex: ${INDEX_OBJS}
${LINKXX} -o $@ ${INDEX_OBJS} ${INDEX_LIBS}
glite_lb_plugin.la: ${PLUGIN_LOBJS}
endif
endif
-compile: glite_lb_bkserverd glite_lb_bkindex ${STATIC_LIB_BK} ${PLUGIN_LIB} store.c index.c jp_job_attrs.h
+compile: glite-lb-bkserverd glite-lb-bkindex ${STATIC_LIB_BK} ${PLUGIN_LIB} store.c index.c jp_job_attrs.h
check: compile test.xml test.query
-mkdir -p ${PREFIX}/include/${globalprefix}/${lbprefix}
${INSTALL} -m 644 ${top_srcdir}/LICENSE ${PREFIX}/share/doc/${package}-${version}
for p in bkserverd bkindex; do \
- ${INSTALL} -m 755 "glite_lb_$$p" "${PREFIX}/bin/glite-lb-$$p"; \
+ ${INSTALL} -m 755 "glite-lb-$$p" "${PREFIX}/bin/glite-lb-$$p"; \
done
for f in dbsetup.sql dbsetup-migrate2transactions.sql index.conf.template; do \
${INSTALL} -m 644 ${top_srcdir}/interface/job-attrs.xsd ${PREFIX}/interface
${INSTALL} -m 644 ${top_srcdir}/interface/job-record.xsd ${PREFIX}/interface
- if [ x${DOSTAGE} != xyes ]; then \
- ${INSTALL} -m 755 ${stagedir}/bin/glite-lb-notif-interlogd ${PREFIX}/bin; \
- fi
- if [ x${DOSTAGE} = xyes ]; then \
- mkdir -p ${PREFIX}/include/${globalprefix}/${lbprefix} ; \
- (cd ${top_srcdir}/interface && install -m 644 ${HDRS} ${PREFIX}/include/${globalprefix}/${lbprefix}) ; \
- install -m 644 ${STATIC_LIB_BK} ${PREFIX}/lib; \
+ if [ ${stagedir} != ${PREFIX} ]; then ${INSTALL} -m 755 ${stagedir}/bin/glite-lb-notif-interlogd ${PREFIX}/bin; fi
+ mkdir -p ${PREFIX}/include/${globalprefix}/${lbprefix}
+ (cd ${top_srcdir}/interface && install -m 644 ${HDRS} ${PREFIX}/include/${globalprefix}/${lbprefix})
+ install -m 644 ${STATIC_LIB_BK} ${PREFIX}/lib
+ if [ x${LB_STANDALONE} = x -a x${PLUGIN_LIB} != x ]; then \
+ ${INSTALL} -m 755 ${PLUGIN_LIB} ${PREFIX}/lib; \
${INSTALL} -m 644 jp_job_attrs.h ${PREFIX}/include/${globalprefix}/${lbprefix} ; \
- if [ x${LB_STANDALONE} = x -a x${PLUGIN_LIB} != x ]; then \
- ${INSTALL} -m 755 ${PLUGIN_LIB} ${PREFIX}/lib; \
- fi; \
- ${INSTALL} -m 644 ${top_srcdir}/interface/srv_perf.h ${PREFIX}/include/${globalprefix}/${lbprefix}; \
fi
+ ${INSTALL} -m 644 ${top_srcdir}/interface/srv_perf.h ${PREFIX}/include/${globalprefix}/${lbprefix}
clean:
+ rm -rf *.c *.h *.ch *.xh *.xml *.nsmap *.o *.lo .libs glite-lb-* ${STATIC_LIB_BK} test*
%.c: %.c.T
rm -f $@
[ -d "$GLITE_LB_EXPORT_JPREG_MAILDIR" ] || mkdir -p "$GLITE_LB_EXPORT_JPREG_MAILDIR" && chown $GLITE_USER:$GLITE_GROUP -R "$GLITE_LB_EXPORT_JPREG_MAILDIR"
maildir="--jpreg-dir $GLITE_LB_EXPORT_JPREG_MAILDIR"
fi
- super="--super-users-file $GLITE_LOCATION/etc/LB-super-users"
+
+ if test -r "$GLITE_LOCATION/etc/LB-super-users"; then
+ super="--super-users-file $GLITE_LOCATION/etc/LB-super-users"
+ fi
[ -z "$creds" ] && echo $0: WARNING: No credentials specified. Using default lookup which is dangerous. >&2
-#Fri Sep 02 14:18:35 CEST 2005
-module.version=1.5.1
+# $Id$
+# $Name$
+module.version=1.5.5
module.age=1
#include "lbs_db.h"
#include "jobstat.h"
+#ifdef LB_PERF
+#include "glite/lb/lb_perftest.h"
+#include "glite/lb/srv_perf.h"
+
+enum lb_srv_perf_sink sink_mode;
+#endif
+
+
static struct option opts[] = {
{ "mysql",1,NULL,'m' },
{ "remove",0,NULL,'R' },
int main(int argc, char *argv[])
{
int fd, i;
+ int dtablesize;
struct sockaddr_in a;
char *mysubj = NULL;
int opt;
int silent = 0;
+ /* keep this at start of main() ! */
+ dtablesize = getdtablesize();
+ for (fd=3; fd < dtablesize ; fd++) close(fd);
name = strrchr(argv[0],'/');
if (name) name++; else name = argv[0];
semkey = ftok(pidfile,0);
- if (!debug) for (fd=3; fd<OPEN_MAX; fd++) close(fd);
-
if (check_mkdir(dumpStorage)) exit(1);
if (check_mkdir(purgeStorage)) exit(1);
if ( jpreg ) {
/*
* unknown error - do rather return (<0) (slave will be killed)
*/
- return -1;
+ return -EIO;
}
free(errt); free(errd);
}
/*
* unknown error - do rather return (<0) (slave will be killed)
*/
- return -1;
+ return -EIO;
}
free(errt); free(errd);
}
return 0;
}
- while (!feof(roots)) {
+ while (fgets(buf,sizeof buf,roots) != NULL) {
char *nl;
- fgets(buf,sizeof buf,roots);
nl = strchr(buf,'\n');
if (nl) *nl = 0;
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";
#ident "$Header$"
+#include <syslog.h>
#include "glite/lb/context-int.h"
#include "glite/lb/log_proto.h"
if ( edg_wll_log_event_send(ctx, lbproxy_ilog_socket_path, filepos,
event, strlen(event), 1, &ctx->p_tmp_timeout) ) {
- edg_wll_UpdateError(ctx, 0, "edg_wll_log_event_send()");
+ char *errt, *errd;
+ errt = errd = NULL;
+
+ edg_wll_UpdateError(ctx, EDG_WLL_IL_PROTO, "edg_wll_log_event_send()");
+ edg_wll_Error(ctx, &errt, &errd);
+ syslog(LOG_ERR,"%s (%s)", errt, errd);
+ free(errt); free(errd);
_err(-1);
}
if ( event_file ) free(event_file);
if ( !err ) return 0;
- edg_wll_UpdateError(ctx, 0, "edg_wll_EventSendProxy()");
- if ( err < 0 ) return 0;
- return edg_wll_Error(ctx, NULL, NULL);
+ if ( err < 0 ) {
+ /* do not propagate IL errors */
+ edg_wll_ResetError(ctx);
+ return 0;
+ } else {
+ edg_wll_UpdateError(ctx, 0, "edg_wll_EventSendProxy()");
+ return edg_wll_Error(ctx, NULL, NULL);
+ }
}
#if DAG_ENABLE
char *stmt = NULL;
#endif
+ char *errdesc = NULL;
//The following declarations have originally been positioned in the funcion's code
//That was rather messy and lead to redeclaratios :-(
char *stat_str, *s_out;
} else {
lockErr = edg_wll_LockJob(ctx,job);
intErr = edg_wll_intJobStatus(ctx, job, flags,&jobstat, js_enable_store && !lockErr);
+ if (intErr) edg_wll_Error(ctx, NULL, &errdesc);
if (!lockErr) {
edg_wll_UnlockJob(ctx,job);
}
free(string_jobid);
free(md5_jobid);
if (acl) edg_wll_FreeAcl(acl);
- return edg_wll_Error(ctx, NULL, NULL);
+ edg_wll_SetError(ctx, intErr, errdesc);
+ free(errdesc);
+ return edg_wll_UpdateError(ctx, EDG_WLL_ERROR_SERVER_RESPONSE, "Could not compute job status from events");
}
if (acl) {
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";
m1 = (MYSQL *)ctx->mysql;
edg_wll_ExecStmt(ctx, cmd_drop, NULL);
- if (edg_wll_ExecStmt(ctx, cmd_create, NULL) != 0) goto err1;
+ if (edg_wll_ExecStmt(ctx, cmd_create, NULL) != 0) {
+ edg_wll_ResetError(ctx);
+ goto err1;
+ }
if (edg_wll_Transaction(ctx) != 0) goto err2;
if (edg_wll_ExecStmt(ctx, cmd_insert, NULL) != 1) goto err2;
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);
e->enQueued.host,
e->enQueued.src_instance);
if (e->enQueued.source == EDG_WLL_SOURCE_LOG_MONITOR)
- js->pub.resubmitted += 1;
+ js->pub.resubmitted = 1;
} else {
js->pub.location = location_string(
edg_wll_SourceToString(e->enQueued.source),
--- /dev/null
+#ident "$Header$"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+#include <assert.h>
+#include <syslog.h>
+
+#include "glite/lb/producer.h"
+#include "glite/lb/context-int.h"
+
+#include "jobstat.h"
+#include "lock.h"
+
+/* TBD: share in whole logging or workload */
+#ifdef __GNUC__
+#define UNUSED_VAR __attribute__((unused))
+#else
+#define UNUSED_VAR
+#endif
+
+// XXX: maybe not needed any more
+// if not, remove also last_condor_event_timestamp from intJobStat
+static int compare_timestamps(struct timeval a, struct timeval b)
+{
+ if ( (a.tv_sec > b.tv_sec) ||
+ ((a.tv_sec == b.tv_sec) && (a.tv_usec > b.tv_usec)) ) return 1;
+ if ( (a.tv_sec < b.tv_sec) ||
+ ((a.tv_sec == b.tv_sec) && (a.tv_usec < b.tv_usec)) ) return -1;
+ return 0;
+}
+
+
+// XXX move this defines into some common place to be reusable
+#define USABLE(res) ((res) == RET_OK)
+#define USABLE_DATA(res) (1)
+#define rep(a,b) { free(a); a = (b == NULL) ? NULL : strdup(b); }
+#define rep_cond(a,b) { if (b) { free(a); a = strdup(b); } }
+
+int processEvent_Condor(intJobStat *js, edg_wll_Event *e, int ev_seq, int strict, char **errstring)
+{
+ edg_wll_JobStatCode old_state = js->pub.state;
+ int res = RET_OK;
+
+
+ if ((js->last_seqcode != NULL) &&
+ (edg_wll_compare_condor_seq(js->last_seqcode, e->any.seqcode) > 0) ) {
+ res = RET_LATE;
+ }
+
+ switch (e->any.type) {
+ case EDG_WLL_EVENT_REGJOB:
+ if (USABLE(res)) {
+ js->pub.state = EDG_WLL_JOB_SUBMITTED;
+ rep(js->pub.condor_status, "Idle");
+ }
+ if (USABLE_DATA(res)) {
+ rep(js->pub.jdl, e->regJob.jdl);
+ }
+ break;
+ case EDG_WLL_EVENT_CONDORMATCH:
+ if (USABLE(res)) {
+ js->pub.state = EDG_WLL_JOB_READY;
+ rep(js->pub.condor_status, "Idle");
+ }
+ if (USABLE_DATA(res)) {
+ rep_cond(js->pub.condor_dest_host,e->CondorMatch.dest_host);
+ }
+ break;
+ case EDG_WLL_EVENT_CONDORREJECT:
+ if (USABLE(res)) {
+ js->pub.state = EDG_WLL_JOB_ABORTED;
+ rep(js->pub.condor_status, "Unexpanded");
+ }
+ if (USABLE_DATA(res)) {
+ switch(e->CondorReject.status_code) {
+ case EDG_WLL_CONDORREJECT_NOMATCH:
+ rep(js->pub.condor_reason,"No match found.");
+ break;
+ case EDG_WLL_CONDORREJECT_OTHER:
+ default:
+ break;
+ }
+ }
+ break;
+ case EDG_WLL_EVENT_CONDORSHADOWSTARTED:
+ if (USABLE(res)) {
+ js->pub.state = EDG_WLL_JOB_READY;
+ rep(js->pub.condor_status, "Idle");
+ }
+ if (USABLE_DATA(res)) {
+ switch (get_condor_event_source(e->any.seqcode)) {
+ case EDG_WLL_CONDOR_EVENT_SOURCE_SCHED:
+ js->pub.condor_shadow_pid = e->CondorShadowStarted.shadow_pid;
+ break;
+ default:
+ break;
+ }
+ }
+ break;
+ case EDG_WLL_EVENT_CONDORSHADOWEXITED:
+ if (USABLE(res)) {
+ js->pub.state = EDG_WLL_JOB_DONE;
+ rep(js->pub.condor_status, "Completed");
+ }
+ if (USABLE_DATA(res)) {
+ switch (get_condor_event_source(e->any.seqcode)) {
+ case EDG_WLL_CONDOR_EVENT_SOURCE_SHADOW:
+ js->pub.condor_shadow_exit_status = e->CondorShadowExited.shadow_exit_status;
+ break;
+ default:
+ break;
+ }
+ }
+ break;
+ case EDG_WLL_EVENT_CONDORSTARTERSTARTED:
+ if (USABLE(res)) {
+ switch (get_condor_event_source(e->any.seqcode)) {
+ case EDG_WLL_CONDOR_EVENT_SOURCE_START:
+ js->pub.state = EDG_WLL_JOB_SCHEDULED;
+ rep(js->pub.condor_status, "Idle");
+ break;
+ case EDG_WLL_CONDOR_EVENT_SOURCE_STARTER:
+ js->pub.state = EDG_WLL_JOB_RUNNING;
+ rep(js->pub.condor_status, "Running");
+ break;
+ default:
+ break;
+ }
+ }
+ if (USABLE_DATA(res)) {
+ switch (get_condor_event_source(e->any.seqcode)) {
+ case EDG_WLL_CONDOR_EVENT_SOURCE_STARTER:
+ rep(js->pub.condor_universe, e->CondorStarterStarted.universe);
+ js->pub.condor_starter_pid = e->CondorStarterStarted.starter_pid;
+ break;
+ default:
+ break;
+ }
+ }
+ break;
+ case EDG_WLL_EVENT_CONDORSTARTEREXITED:
+ if (USABLE(res)) {
+ js->pub.state = EDG_WLL_JOB_DONE;
+ rep(js->pub.condor_status, "Completed");
+ }
+ if (USABLE_DATA(res)) {
+ switch (get_condor_event_source(e->any.seqcode)) {
+ case EDG_WLL_CONDOR_EVENT_SOURCE_START:
+ js->pub.condor_starter_pid = e->CondorStarterExited.starter_pid;
+ js->pub.condor_starter_exit_status = e->CondorStarterExited.starter_exit_status;
+ break;
+ case EDG_WLL_CONDOR_EVENT_SOURCE_STARTER:
+ js->pub.condor_starter_pid = e->CondorStarterExited.starter_pid;
+ js->pub.condor_job_pid = e->CondorStarterExited.job_pid;
+ js->pub.condor_job_exit_status = e->CondorStarterExited.job_exit_status;
+ break;
+ default:
+ break;
+ }
+ }
+ break;
+ case EDG_WLL_EVENT_CONDORRESOURCEUSAGE:
+ if (USABLE(res)) {
+ }
+ if (USABLE_DATA(res)) {
+ }
+ break;
+ case EDG_WLL_EVENT_CONDORERROR:
+ if (USABLE(res)) {
+ }
+ if (USABLE_DATA(res)) {
+ }
+ break;
+
+ default:
+ break;
+ }
+
+/* XXX : just debug output - remove */
+
+ printf("processEvent_Condor(): %s (%s), state: %s --> %s\n ",
+ edg_wll_EventToString(e->any.type),
+ (res == RET_LATE) ? "RET_LATE" : "RET_OK",
+ edg_wll_StatToString(old_state),
+ edg_wll_StatToString(js->pub.state) );
+ printf("\t%s\n",e->any.seqcode);
+ printf("\t(last=%s)\n",js->last_seqcode);
+
+/*----------------------------------*/
+
+ if (USABLE(res)) {
+ rep(js->last_seqcode, e->any.seqcode);
+
+ js->pub.lastUpdateTime = e->any.timestamp;
+ if (old_state != js->pub.state) {
+ js->pub.stateEnterTime = js->pub.lastUpdateTime;
+ js->pub.stateEnterTimes[1 + js->pub.state]
+ = (int)js->pub.lastUpdateTime.tv_sec;
+ }
+ }
+ if (! js->pub.location) js->pub.location = strdup("this is CONDOR");
+
+
+ return RET_OK;
+}
+
rep(js->pub.pbs_state, "R");
break;
default:
- assert(0); // running event from strande source
+ assert(0); // running event from strange source
break;
}
}
if (USABLE_DATA(res)) {
char *new_resource_usage;
- asprintf(&new_resource_usage,"%s%s\t%s = %d [%s]",
+ asprintf(&new_resource_usage,"%s%s\t%s = %f [%s]",
(js->pub.pbs_resource_usage) ? js->pub.pbs_resource_usage : "",
(js->pub.pbs_resource_usage) ? "\n": "",
e->PBSResourceUsage.name,
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 {
gen $indent."$dest = $source;\n";
}
- }
- elsif ($tn eq 'port' || $tn eq 'bool') {
+ } elsif ($tn eq 'port' || $tn eq 'bool' || $tn eq 'float' || $tn eq 'double') {
if ($f->{optional}) {
gen $indent."$dest = soap_malloc(soap, sizeof(*$dest));\n";
gen $indent."*$dest = $source;\n";
};
$dest = "VALUEEV_GET($dst, $soap_en)->$soap_fn";
- if ($tn eq 'int' || $tn eq 'port' || $tn eq 'bool' || $tn eq 'logsrc') {
+ if ($tn eq 'int' || $tn eq 'port' || $tn eq 'bool' || $tn eq 'float' || $tn eq 'double' || $tn eq 'logsrc') {
if ($f->{optional}) {
gen $indent."if ($dest) soap_dealloc(soap, $dest);\n";
}
} 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])(.*)/);
}
elsif ($f->{optional}) {
gen "\t\t\tout->$act.$fn = *$src;\n";
+ } else {
+ gen "\t\t\tout->$act.$fn = $src;\n";
}
- else {
+ } elsif ($tn eq 'port' || $tn eq 'bool' || $tn eq 'float' || $ft eq 'double') {
+ if ($f->{optional}) {
+ gen "\t\t\tout->$act.$fn = *$src;\n";
+ } else {
gen "\t\t\tout->$act.$fn = $src;\n";
}
- }
- elsif ($ft eq 'logsrc') {
+ } elsif ($ft eq 'logsrc') {
gen "\t\t\tedg_wll_SoapToSource($src, &(out->$act.$fn));\n";
- }
- else {
+ } else {
gen "\t\t\tout->$act.$fn = $src;\n";
}
}
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";
module.version = 1.1.1
-module.age = 2
+module.age = 3
# fi
clean:
- rm -f *.h
+ rm -f *.h *.html *.xml *.wsdl
%.xml: %.xml.T
#Fri Sep 02 14:16:49 CEST 2005
# glite-lb-ws-interface_branch_3_0_0_RC15 tak is taken!
module.version=2.3.0
-module.age=1
+module.age=2
Revision history:
$Log$
+ Revision 1.43.2.1 2007/03/29 20:05:00 akrenek
+ disable utils temporarily
+
+ Revision 1.43 2007/03/21 13:10:38 akrenek
+ utils -> jp.primary (sync with 3.1)
+
Revision 1.42 2006/03/24 08:26:11 akrenek
missing utils->client dependency (should fix nightly build)
</target>
<!-- Main proxy -->
+<!--XXX: until JP from head is included utils, -->
<target name="buildmodules" depends="envset,
- utils,
client-interface,
ws-interface,
client,
-ext.gsoap.version=2.7.9d
-ext.gsoap.rep.file=gSOAP-2.7.9d.tar.gz
-
+ext.gsoap.version=2.7.6b
+ext.gsoap.rep.file=gSOAP-2.7.6b.tar.gz
org.glite.lb.logger.version = HEAD
org.glite.lb.utils.version = HEAD
-ext.gsoap.version = 2.7.9d
+ext.gsoap.version = 2.7.6b
@type ResourceUsage Resource (CPU, memory etc.) consumption.
string resource Resource's name.
- int quantity Resources's quantity (how much).
+ double quantity Resources's quantity (how much).
string unit Units (sec, kB, etc.).
@type ReallyRunning User payload started.
_code_ REQUESTED Requested value
_code_ USED Consumed quantity
string name Name of resource
- int quantity The quantity
+ double quantity The quantity
_optional_ Bypass need of 'null value'
string unit Units (sec, kB, etc.)
@type PBSError Any error occured
string error_desc Error reason
-@type CondorSubmit Job SUBMITed to Condor
- string universe Condor Universe
- string submit_host Submitting machine
- string condor_id Condor ID
-
-@type CondorMatch Job MATCHed
- string condor_id Condor ID
+@type CondorMatch Job MATCHed
string owner Owner
- string matched_host Matched host
+ string dest_host Matched host
string preempting Preempting
_optional_
-@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
- _optional_
- int pid Actual process ID
+@type CondorReject Job REJECTed
+ string owner Owner
+ int status_code Reason code for the rejection of the job
+ _code_ NOMATCH No match found
+ _code_ OTHER Other reason
+
+@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_
-@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 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 CondorShadowExited Condor Shadow Exited
+ int shadow_pid PID of shadow process
+ int shadow_exit_status Exit status of shadow process
-@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.
logsrc=>'"edg_wll_Source"',
port=>'"uint16_t"',
# level=>'"enum edg_wll_Level"',
- int=>'"int"'
+ int=>'"int"',
+ float=>'"float"',
+ double=>'"double"',
},
'C++'=>{
string=>'"std::string"',
stslist=>'"std::vector<JobStatus>"',
logsrc=>'"int"',
port=>'"int"',
- int=>'"int"'
+ int=>'"int"',
+ float=>'"float"',
+ double=>'"double"',
},
'wsdl'=>{
bool=>'"xsd:boolean"',
logsrc=>'"eventSource"',
notifid=>'"xsd:string"',
port=>'"xsd:int"',
+ float=>'"xsd:float"',
+ double=>'"xsd:double"',
}
);
%baseTypes = (
intlist=>'int',
+ floatlist=>'float',
+ doublelist=>'double',
strlist=>'string',
stslist=>'jobstat',
taglist=>'usertag'
%toString = (
C=>{
int=>'qq{asprintf(&$dst,"%d",$src);}',
+ float=>'qq{asprintf(&$dst,"%f",$src);}',
+ double=>'qq{asprintf(&$dst,"%f",$src);}',
port=>'qq{asprintf(&$dst,"%d",(int) $src);}',
bool=>'qq{asprintf(&$dst,"%d",$src);}',
string=>'qq{$dst = $src?strdup($src):NULL;}',
%fromString = (
C=>{
int=>'qq{$dst = atoi($src);}',
+ float=>'qq{$dst = strtof($src,NULL);}',
+ double=>'qq{$dst = strtod($src,NULL);}',
port=>'qq{$dst = (uint16_t) atoi($src);}',
bool=>'qq{$dst = atoi($src);}',
string=>'qq{$dst = strdup($src);}',
%DefaultNullValue = (
int=>0,
+ float=>0.0,
+ double=>0.0,
port=>0,
# level=>'EDG_WLL_LEVEL_UNDEFINED',
bool=>0,
%compare = (
C=>{
int=>'"($a == $b)"',
+ float=>'"($a == $b)"',
+ double=>'"($a == $b)"',
port=>'"($a == $b)"',
# level=>'"($a == $b)"',
bool=>'"(($a || !$b) && ($b || !$a))"',
- string=>'"(($a) == NULL && ($b) == NULL) || (($a)&&($b)&& !strcmp($a,$b))"',
- jobid=>'"(($a) == NULL && ($b) == NULL) || (($a)&&($b)&& !strcmp(edg_wlc_JobIdUnparse($a),edg_wlc_JobIdUnparse($b)))"',
+# string=>'"(($a) == NULL && ($b) == NULL) || (($a)&&($b)&& !strcmp($a,$b))"',
+ string=>'if ($b =~ m/^NULL/) { qq{(($a) == NULL) || (($a)&& !strcmp($a,""))}; }
+ else { qq{(($a) == NULL && ($b) == NULL) || (($a)&&($b)&& !strcmp($a,$b))}; } ',
+# jobid=>'"(($a) == NULL && ($b) == NULL) || (($a)&&($b)&& !strcmp(edg_wlc_JobIdUnparse($a),edg_wlc_JobIdUnparse($b)))"',
+ jobid=>'if ($b =~ m/^NULL/) { qq{(($a) == NULL) || (($a)&& !strcmp(edg_wlc_JobIdUnparse($a),""))}; }
+ else { qq{(($a) == NULL && ($b) == NULL) || (($a)&&($b)&& !strcmp(edg_wlc_JobIdUnparse($a),edg_wlc_JobIdUnparse($b)))}; }',
notifid=>'"($a) == ($b)"',
logsrc=>'"($a) == ($b)"',
timeval=>'"($a).tv_sec == ($b).tv_sec && ($a).tv_usec == ($b).tv_usec"',
%toFormatString = (
C=>{
int=>'"%d"',
+ float=>'"%f"',
+ double=>'"%f"',
port=>'"%d"',
bool=>'"%d"',
# level=>'"%s"',
-#Fri Sep 02 14:19:10 CEST 2005
-module.version=1.3.3
-module.age=0
+# $Id$
+# $Name$
+module.version=1.4.5
+module.age=2