From 26d9033d9e54b878e3487a4e092e52558ad8cbdb Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20Posp=C3=AD=C5=A1il?= Date: Sun, 29 Apr 2007 19:54:33 +0000 Subject: [PATCH] Updated stresslog: - added -N (number of jobs = number of repetitions) - added -n (number of subjobs -> now COLLECTIONS) --- org.glite.lb.client/examples/stresslog.c | 33 +++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/org.glite.lb.client/examples/stresslog.c b/org.glite.lb.client/examples/stresslog.c index 8f47414..39773a6 100644 --- a/org.glite.lb.client/examples/stresslog.c +++ b/org.glite.lb.client/examples/stresslog.c @@ -21,7 +21,7 @@ static const char *me; 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[]) @@ -35,18 +35,17 @@ 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; @@ -59,7 +58,7 @@ int main(int argc, char *argv[]) exit(1); } - if (njobs <= 0) { + if ((njobs <= 0) || (num_subjobs)) { fprintf(stderr,"%s: wrong number of jobs\n",me); usage(); exit(1); @@ -76,13 +75,15 @@ int main(int argc, char *argv[]) exit(1); } +/* MAIN LOOP */ +for (i = 1; i