-static char *rcsId = "$Header: /misc/hadesprojects/daq/cvsroot/eventbuilder/hadaq/evtbuild.c,v 6.100 2010-01-27 17:29:50 hadaq Exp $";
+static char *rcsId = "$Header: /misc/hadesprojects/daq/cvsroot/eventbuilder/hadaq/evtbuild.c,v 6.101 2010-04-15 17:33:01 hadaq Exp $";
#define _POSIX_C_SOURCE 199309L
#define SYSLOG_NAMES
char rfioRemotePath[PARAM_MAX_VALUE_LEN];
char rfioLustrePath[PARAM_MAX_VALUE_LEN];
+ char rfio_pcOption[PARAM_MAX_VALUE_LEN];
+ unsigned short rfio_iCopyMode;
+ unsigned short rfio_iCopyFrac;
+ unsigned short rfio_iMaxFile;
+ unsigned short rfio_iPathConv;
char lustrePath[PARAM_MAX_VALUE_LEN];
unsigned short buffStat;
unsigned short epicsCtrl;
#ifdef RFIO
syslog(LOG_ERR, "Usage: [--rfio path_to_tape_archive] example: --rfio rfiodaq:gstore:/hadaqtest/test002");
syslog(LOG_ERR, "Usage: [--rfiolustre path] example: --rfiolustre /lustre/hades/daq");
+ syslog(LOG_ERR, "Usage: [--rfio_pcoption option] internal RFIO options (do not set anything if not sure)");
+ syslog(LOG_ERR,
+ "Usage: [--rfio_icopymode mode] 0 : standard RFIO, ignore following arguments, 1 : copy the data to Lustre path after the file is written to a write cache (this is for the high data rates), 2 : for lustre only");
+ syslog(LOG_ERR,
+ "Usage: [--rfio_icopyfrac frac] 0 : write only to a tape, i (>0) : copy each i-th file to lustre (pcCopyPath). If migration to a tape fails, ignore iCopyFraction and copy each file to lustre.");
+ syslog(LOG_ERR,
+ "Usage: [--rfio_imaxfile maxnum] 0 : no file number limit, i (>0) : maximum number of files to be written to a directory");
+ syslog(LOG_ERR, "Usage: [--rfio_ipathconv conv] # 0 : default convention, 1 : HADES convention");
#endif
syslog(LOG_ERR, "Usage: [--buffstat] show fill levels of buffers");
syslog(LOG_ERR, "Usage: [--epicsctrl] enable synch and distribution of RUN Id by Epics for parallel event builders");
if (my->write_data == 1) {
syslog(LOG_DEBUG, "sec_path: %s", my->sec_path);
}
+#ifdef RFIO
if (strcmp(my->rfioRemotePath, "") != 0) {
syslog(LOG_DEBUG, "rfio path: %s", my->rfioRemotePath);
}
if (strcmp(my->rfioLustrePath, "") != 0) {
syslog(LOG_DEBUG, "rfio lustre path: %s", my->rfioLustrePath);
}
+#endif
if (strcmp(my->lustrePath, "") != 0) {
syslog(LOG_DEBUG, "lustre path: %s", my->lustrePath);
}
strcpy(my->rfioRemotePath, "");
strcpy(my->rfioLustrePath, "");
+ strcpy(my->rfio_pcOption, "wb");
+ my->rfio_iCopyMode = 0;
+ my->rfio_iCopyFrac = 0;
+ my->rfio_iMaxFile = 200;
+ my->rfio_iPathConv = 0;
strcpy(my->lustrePath, "");
my->buffStat = 0;
my->epicsCtrl = 0;
{"help", 0, 0, 'H'},
{"rfio", 1, 0, 'R'},
{"rfiolustre", 1, 0, 'A'},
+ {"rfio_pcoption", 1, 0, 'W'},
+ {"rfio_icopymode", 1, 0, 'M'},
+ {"rfio_icopyfrac", 1, 0, 'F'},
+ {"rfio_imaxfile", 1, 0, 'X'},
+ {"rfio_ipathconv", 1, 0, 'C'},
{"buffstat", 0, 0, 'b'},
{"epicsctrl", 0, 0, 'E'},
{"lustre", 1, 0, 'L'},
{"ignore", 0, 0, 'i'},
{0, 0, 0, 0}
};
- i = getopt_long(argc, argv, "am:f:r:o:d:q:p:v:x:I:tz:e:n:h:w:tz:e:n:Hs:l:R:A:bEL:S:B:O:i", long_options, &option_index);
+ i = getopt_long(argc, argv, "am:f:r:o:d:q:p:v:x:I:tz:e:n:h:w:tz:e:n:Hs:l:R:A:bEL:S:B:O:iW:M:F:X:C:", long_options,
+ &option_index);
if (i == -1)
break;
switch (i) {
case 'A':
strcpy(my->rfioLustrePath, optarg);
break;
+ case 'W':
+ strcpy(my->rfio_pcOption, optarg);
+ break;
+ case 'M':
+ my->rfio_iCopyMode = strtoul(optarg, NULL, 0);
+ break;
+ case 'F':
+ my->rfio_iCopyFrac = strtoul(optarg, NULL, 0);
+ break;
+ case 'X':
+ my->rfio_iMaxFile = strtoul(optarg, NULL, 0);
+ break;
+ case 'C':
+ my->rfio_iPathConv = strtoul(optarg, NULL, 0);
+ break;
case 'L':
strcpy(my->lustrePath, optarg);
break;
fprintf(stderr, "<I> evtbuild.c, rfio_fopen(): trying to open connection to Data Mover: %s\n", rfioBase);
/* fRemote = rfio_fopen( rfioBase, "wb" ); */
- fRemote = rfio_fopen_gsidaq(rfioBase, "wb", 1, theArgs->rfioLustrePath, 1, 10, 1);
+ fRemote = rfio_fopen_gsidaq(rfioBase,
+ theArgs->rfio_pcOption,
+ theArgs->rfio_iCopyMode,
+ theArgs->rfioLustrePath,
+ theArgs->rfio_iCopyFrac, theArgs->rfio_iMaxFile, theArgs->rfio_iPathConv);
if (fRemote == NULL) {
syslog(LOG_ERR, "%s, %d: trying to open connection to Data Mover %s: %s",
setlogmask(LOG_UPTO(LOG_INFO));
argsDefault(theArgs);
+
argsFromParam(theArgs, argc, argv);
if (0 > argsFromCL(theArgs, argc, argv)) {