]> jspc29.x-matter.uni-frankfurt.de Git - daqdata.git/commitdiff
Printing out disk nr. Sergey
authorhadaq <hadaq>
Tue, 6 Jul 2010 16:48:59 +0000 (16:48 +0000)
committerhadaq <hadaq>
Tue, 6 Jul 2010 16:48:59 +0000 (16:48 +0000)
hadaq/evtbuild.c

index 08fde58ebded266c44a3887923ba1e1b448c4cf8..9d5e084d418bec70f62690f30b7e26b5e83c03cb 100644 (file)
@@ -1,4 +1,4 @@
-static char *rcsId = "$Header: /misc/hadesprojects/daq/cvsroot/eventbuilder/hadaq/evtbuild.c,v 6.117 2010-07-06 15:40:09 hadaq Exp $";
+static char *rcsId = "$Header: /misc/hadesprojects/daq/cvsroot/eventbuilder/hadaq/evtbuild.c,v 6.118 2010-07-06 16:48:59 hadaq Exp $";
 
 #define _POSIX_C_SOURCE 199309L
 #define SYSLOG_NAMES
@@ -231,8 +231,8 @@ static void usage(const char *progName)
        syslog(LOG_ERR, "       [-o outPath]                 Output path for writing data on the local hard disk.");
        syslog(LOG_ERR, "       [-d null|tape|file|stdout]   Type of data output.");
        syslog(LOG_ERR, "       [--filesize max_size]        Maximum size of output file in MB.");
-       syslog(LOG_ERR, "       [-q queueSize]               Size of the queue (shared memory segments) in Bytes.");
-       syslog(LOG_ERR, "       [-Q queueNr:queueSize]       Set different queue sizes for different queue numbers,");
+       syslog(LOG_ERR, "       [-q queueSize]               Size of the queue (shared memory segments) in MBytes.");
+       syslog(LOG_ERR, "       [-Q queueNr:queueSize]       Set different queue sizes in MB for different queue numbers,");
        syslog(LOG_ERR, "                                    example: -Q 2:1000000 -Q 4:4000000 -Q 5:12000000");
        syslog(LOG_ERR, "       [-r runNumber]");
        syslog(LOG_ERR, "       [-S|--shmname shmem_name]    Extension of shared memory segment name.");
@@ -349,7 +349,7 @@ static int makeQueues(TheArgs *my)
                                break;
                        }
 
-                       my->queueSize[queueNum] = atoi(newQueueSize);
+                       my->queueSize[queueNum] = atoi(newQueueSize) * 1024 * 1024UL;
                }
        }
 
@@ -437,7 +437,7 @@ static void argsDefault(TheArgs *my)
        strcpy(my->shmname, "");
        my->priority = 0;
        my->isStandalone = 1;
-       my->queueSize[0] = 64 * 1024 * 1024UL;
+       my->queueSize[0] = 32 * 1024 * 1024UL;
        strcpy(my->verbosity, "info");
 
        my->evtId = 0;
@@ -557,7 +557,7 @@ static int argsFromCL(TheArgs *my, int argc, char *argv[])
                        my->priority = strtoul(optarg, NULL, 0);
                        break;
                case 'q':
-                       my->queueSize[0] = strtoul(optarg, NULL, 0);
+                       my->queueSize[0] = strtoul(optarg, NULL, 0) * 1024 * 1024UL;;
                        break;
                case 'Q':
                        strcpy(my->queueVarSize[my->queueVarSizeCnt++], optarg);
@@ -710,6 +710,7 @@ static int argsCheck(TheArgs *my)
 
        if (((my->maxFileSz) < (my->queueSize[0]))) {
                fprintf(stderr, "<E> evtbuild.c, argsCheck(): --filesize must be larger than queuesize(-q)\n");
+               fprintf(stderr, "<W> evtbuild.c, argsCheck(): the queue size must be given in MBytes\n");
                return 1;
        }
 
@@ -719,6 +720,12 @@ static int argsCheck(TheArgs *my)
                return 1;
        }
 
+       /* Check queue sizes */
+       if (1 * 1024 * 1024 * 1024UL < (my->queueSize[0])) {
+               fprintf(stderr, "<W> evtbuild.c, argsCheck(): the queue size must be given in MBytes\n");
+               return 1;
+       }
+
        /* Check debug options */
        int i;
 
@@ -1992,7 +1999,6 @@ int main(int argc, char *argv[])
        }
 
        if (argsCheck(theArgs)) {
-               sleep(10);
                exit(EXIT_FAILURE);
        }