71 #include <include/hpctoolkit-config.h> 84 #define ARG_ERROR(streamArgs) \ 85 { std::ostringstream WeIrDnAmE; \ 86 WeIrDnAmE << streamArgs ; \ 87 printError(std::cerr, WeIrDnAmE.str()); \ 92 static const char*
version_info =
"hpcserver version 0.9, protocol version 0.9. \n" HPCTOOLKIT_VERSION_STRING;
98 hpcserver is an optional component that works with hpctraceviewer to enable\n\ 99 visualizations of larger databases. The disk access and heavy processing\n\ 100 required by hpctraceviewer are offloaded to hpctraceserver, which can run in\n\ 101 parallel with MPI. The results are streamed back to a connected hpctraceviewer\n\ 102 client in a way that permits the same interactivity as running hpctraceviewer\n\ 103 with the data located locally.\n\ 105 Unlike standard web servers, for example, hpcserver is designed to run only\n\ 106 while in use, and not perpetually as a daemon on background process. hpcserver\n\ 107 also runs with the permissions of the user that launched it and allows the\n\ 108 hpctraceviewer client to specify and access any database that hpcserver can read.\ 111 -V, --version Print version information.\n\ 112 -h, --help Print this help.\n\ 113 -c, --compression Enables or disables compression (on by default)\n\ 114 Allowed values: on off \n\ 115 -p, --port Sets the main communication port (default is 21590)\n\ 116 Specifying 0 indicates that an open port should be \n\ 117 chosen automatically.\n\ 118 -x, --xmlport Sets the port on which the experiment.xml file will be\n\ 119 transmitted. Specifying 0 or not including this flag\n\ 120 indicates that the port will be auto-negotiated with\n\ 121 the client. Specifying 1 indicates that the xml will\n\ 122 be transferred on the main data port.\n\ 131 #define CLP CmdLineParser 132 #define CLP_SEPARATOR "!!" 142 {
'V',
"version", CLP::ARG_NONE, CLP::DUPOPT_CLOB,
NULL,
144 {
'h',
"help", CLP::ARG_NONE, CLP::DUPOPT_CLOB,
NULL,
146 {
'c' ,
"compression", CLP::ARG_REQ, CLP::DUPOPT_CLOB,
NULL,
147 CLP::isOptArg_long },
148 {
'p' ,
"port", CLP::ARG_REQ, CLP::DUPOPT_CLOB,
NULL,
149 CLP::isOptArg_long },
150 {
'x' ,
"xmlport", CLP::ARG_REQ, CLP::DUPOPT_CLOB,
NULL,
151 CLP::isOptArg_long },
168 Args::Args(
int argc,
const char*
const argv[])
207 os <<
getCmd() <<
": " << msg << endl
208 <<
"Try '" <<
getCmd() <<
" --help' for more information." << endl;
265 ARG_ERROR(
"Ports must be greater than 1024.")
270 if (xmlPort < 1024 && xmlPort > 1)
271 ARG_ERROR(
"Ports must be greater than 1024.")
287 os <<
"Args.cmd= " <<
getCmd() << endl;
306 cerr <<
"Error: Please set your " <<
HPCTOOLKIT <<
" environment variable." 312 int len = strlen(home);
313 if (home[len-1] ==
'/') home[--len] = 0;
315 DIR *fp = opendir(home);
317 cerr <<
"Error: " << home <<
" is not a directory" << endl;
bool isOpt(const char swShort) const
void printUsage(std::ostream &os) const
const std::string & getOptArg(const char swShort) const
const std::string & getCmd() const
virtual const std::string & what() const
void parse(const OptArgDesc *optArgDescs, int argc, const char *const argv[])
void printVersion(std::ostream &os) const
void parse(int argc, const char *const argv[])
virtual std::string message() const
#define CmdLineParser_OptArgDesc_NULL_MACRO
void printError(std::ostream &os, const char *msg) const
static CmdLineParser::OptArgDesc optArgs[]
static const std::string HPCTOOLKIT
static bool parseArg_bool(const std::string &value, const char *errTag)
const std::string & getCmd() const
void dump(std::ostream &os=std::cerr) const
static long toLong(const std::string &str)