From b4b1f6b7291e55651d7aa3f717a083367f896c8e Mon Sep 17 00:00:00 2001 From: hadaq Date: Mon, 11 Oct 2010 15:37:33 +0000 Subject: [PATCH] Option multdisk has an argument now. Sergey. --- hadaq/args.c | 6 +++--- hadaq/evtbuild.c | 11 ++++++----- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/hadaq/args.c b/hadaq/args.c index 28f8137..7f171de 100644 --- a/hadaq/args.c +++ b/hadaq/args.c @@ -155,11 +155,11 @@ int Args_fromCL(TheArgs *my, int argc, char *argv[]) {"ignore", 0, 0, 'i'}, {"debug", 1, 0, 'D'}, {"trigtype", 1, 0, 'T'}, - {"multidisks", 0, 0, 'k'}, + {"multidisks", 1, 0, 'k'}, {"maxtrigmismatch", 1, 0, 'g'}, {0, 0, 0, 0} }; - i = getopt_long(argc, argv, "am:f:r:o:d:q:Q:p:v:x:I:tz:e:n:h:w:Hs:l:R:A:bEL:S:B:O:iW:M:F:X:C:D:T:kg:", long_options, + i = getopt_long(argc, argv, "am:f:r:o:d:q:Q:p:v:x:I:tz:e:n:h:w:Hs:l:R:A:bEL:S:B:O:iW:M:F:X:C:D:T:k:g:", long_options, &option_index); if (i == -1) break; @@ -209,7 +209,7 @@ int Args_fromCL(TheArgs *my, int argc, char *argv[]) my->online = 1; break; case 'k': - my->multiDisks = 1; + my->multiDisks = strtoul(optarg, NULL, 0); break; case 'z': /* from MBytes to Bytes */ my->maxFileSz = strtoul(optarg, NULL, 0) * 1024 * 1024UL; diff --git a/hadaq/evtbuild.c b/hadaq/evtbuild.c index b006a9a..a97574c 100644 --- a/hadaq/evtbuild.c +++ b/hadaq/evtbuild.c @@ -1,4 +1,4 @@ -static char *rcsId = "$Header: /misc/hadesprojects/daq/cvsroot/eventbuilder/hadaq/evtbuild.c,v 6.137 2010-10-08 13:55:16 hadaq Exp $"; +static char *rcsId = "$Header: /misc/hadesprojects/daq/cvsroot/eventbuilder/hadaq/evtbuild.c,v 6.138 2010-10-11 15:37:33 hadaq Exp $"; #define _POSIX_C_SOURCE 199309L #define SYSLOG_NAMES @@ -144,8 +144,9 @@ static void usage(const char *progName) syslog(LOG_ERR, " [--lustre path_to_lustre] Output path for writing data on the Lustre cluster (if mounted)."); syslog(LOG_ERR, " [--orapath path] Path to eb_runinfo2ora.txt for writing data to Oracle."); syslog(LOG_ERR, " [--ignore] Ignore trigger mismatch conditions."); - syslog(LOG_ERR, " [--maxtrigmismatch number] Maximum number of triggers allowed for missmatch."); - syslog(LOG_ERR, " [--multidisk] Write data to a disk number provided by daq_disks via shared memory."); + syslog(LOG_ERR, " [--maxtrigmismatch number] Maximum number of triggers allowed for missmatch."); + syslog(LOG_ERR, + " [--multidisk diskNr] Write data to a disk number provided by daq_disks via shared memory. The very first file will be written to diskNr provided via --multidisk option."); syslog(LOG_ERR, ""); syslog(LOG_ERR, "Options for debugging:"); syslog(LOG_ERR, " [-v debug|info|notice|warning|err|alert|crit|emerg]"); @@ -416,7 +417,7 @@ static void changeDisk(int once, TheArgs *theArgs, TheStats *theStats) char newOutPath[_POSIX_PATH_MAX]; char sec_path[_POSIX_PATH_MAX]; - sprintf(ebOutPath, "/data%02d", theArgs->ebnum); + sprintf(ebOutPath, "/data%02d", theArgs->multiDisks); if (once) { /* @@ -426,7 +427,7 @@ static void changeDisk(int once, TheArgs *theArgs, TheStats *theStats) strcpy(theArgs->outPath, strReplace(theArgs->outPath, "/data01", ebOutPath)); strcpy(theArgs->sec_path, strReplace(theArgs->sec_path, "/data01", ebOutPath)); - (*theStats->diskNrEB) = theArgs->ebnum; + (*theStats->diskNrEB) = theArgs->multiDisks; } else { /* * For the next files we should be able to get diskNr from shared memory, -- 2.43.0