From 714950b12b1fdfc6ec370b8a7f08274622236cfc Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ale=C5=A1=20K=C5=99enek?= Date: Tue, 19 Sep 2006 18:01:25 +0000 Subject: [PATCH] merge from 3.0 --- org.glite.lb.client/Makefile | 2 +- org.glite.lb.client/examples/stress_context.c | 110 +++++++++++++++++++++++++ org.glite.lb.client/project/version.properties | 2 +- 3 files changed, 112 insertions(+), 2 deletions(-) create mode 100644 org.glite.lb.client/examples/stress_context.c diff --git a/org.glite.lb.client/Makefile b/org.glite.lb.client/Makefile index b3a9f14..4006993 100644 --- a/org.glite.lb.client/Makefile +++ b/org.glite.lb.client/Makefile @@ -129,7 +129,7 @@ PLUSLIB:=libglite_lb_clientpp_${nothrflavour}.la THRPLUSLIB:=libglite_lb_clientpp_${thrflavour}.la TOOLS:=dump load purge lb_dump_exporter -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 +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_CL=user_jobs job_status FAKE_EXAMPLES:=job_log_fake diff --git a/org.glite.lb.client/examples/stress_context.c b/org.glite.lb.client/examples/stress_context.c new file mode 100644 index 0000000..405f4d1 --- /dev/null +++ b/org.glite.lb.client/examples/stress_context.c @@ -0,0 +1,110 @@ +#include +#include +#include +#include +#include + +#include "glite/wmsutils/jobid/cjobid.h" +#include "glite/lb/producer.h" +#include "glite/lb/events.h" + +char *outfile = "context_errors"; +edg_wlc_JobId job; + +static int stop; + +struct { + int err; + char *text,*desc; +} *errors; + +int nerrors; + +static void killslaves(int sig) +{ + kill(0,SIGTERM); + exit(0); +} + +static void terminate(int sig) +{ + stop = sig; +} + +static void slave(int num) +{ + int good = 0,i; + char fname[PATH_MAX]; + FILE *errf; + edg_wll_Context ctx; + + signal(SIGINT,terminate); + signal(SIGTERM,terminate); + signal(SIGHUP,terminate); + + + while (!stop) { + edg_wll_InitContext(&ctx); + edg_wll_SetParam(ctx, EDG_WLL_PARAM_SOURCE, EDG_WLL_SOURCE_WORKLOAD_MANAGER); + + if (edg_wll_SetLoggingJobProxy(ctx,job,NULL,"/I/am/the/user",EDG_WLL_SEQ_NORMAL) && !stop) { + errors = realloc(errors,(nerrors+1) * sizeof(*errors)); + errors[nerrors].err = edg_wll_Error(ctx,&errors[nerrors].text,&errors[nerrors].desc); + nerrors++; + } + else good++; + + edg_wll_FreeContext(ctx); + } + + sprintf(fname,"%s_%03d",outfile,num); + errf = fopen(fname,"w"); + if (!errf) { perror(fname); exit(1); } + + for (i=0; i