33 bool help_flag =
false;
34 for (
int i=0; i<*argc; i++)
36 if (strcmp((*argv)[i],
"-h")==0)
40 bool setGeomP =
false;
46 const int maxlen = 256;
48 strncpy(rtinode,
"your_local_food_store", maxlen);
54 fprintf(stderr,
"Usage: %s options\n",(*argv)[0]);
55 fprintf(stderr,
"options:\n");
56 fprintf(stderr,
" -h help\n");
57 fprintf(stderr,
" -V %%d [%d] verbose mode for QMP\n",
59#if defined(QDP_USE_PROFILING)
60 fprintf(stderr,
" -p %%d [%d] profile level\n",
65 fprintf(stderr,
" -geom %%d");
66 for(
int i=1; i <
Nd; i++)
67 fprintf(stderr,
" %%d");
69 fprintf(stderr,
" [-1");
70 for(
int i=1; i <
Nd; i++)
71 fprintf(stderr,
",-1");
72 fprintf(stderr,
"] logical machine geometry\n");
75 fprintf(stderr,
" -cd %%s [.] set working dir for QIO interface\n");
76 fprintf(stderr,
" -rti %%d [%d] use run-time interface\n",
78 fprintf(stderr,
" -rtinode %%s [%s] run-time interface fileserver node\n",
85 for (
int i=1; i<*argc; i++)
87 if (strcmp((*argv)[i],
"-V")==0)
91#if defined(QDP_USE_PROFILING)
92 else if (strcmp((*argv)[i],
"-p")==0)
95 sscanf((*argv)[++i],
"%d", &lev);
99 else if (strcmp((*argv)[i],
"-geom")==0)
102 for(
int j=0; j <
Nd; j++)
105 sscanf((*argv)[++i],
"%d", &uu);
106 logical_geom[j] = uu;
110 else if (strcmp((*argv)[i],
"-cd")==0)
113 setenv(
"QHOSTDIR", (*argv)[++i], 0);
115 else if (strcmp((*argv)[i],
"-rti")==0)
117 sscanf((*argv)[++i],
"%d", &rtiP);
119 else if (strcmp((*argv)[i],
"-rtinode")==0)
121 int n = strlen((*argv)[++i]);
124 QDPIO::cerr <<
"rtinode name too long" << std::endl;
127 sscanf((*argv)[i],
"%s", rtinode);
133 QDPIO::cerr << __func__ <<
": Unknown argument = " << (*argv)[i] << std::endl;
140 QDPIO::cerr << __func__ <<
": missing argument at the end" << std::endl;
150 for (
int i=0; i<*argc; i++)
151 QDP_info(
"QDP_init: arg[%d] = XX%sXX",i,(*argv)[i]);
158 if (QMP_is_initialized() == QMP_FALSE)
160 QMP_thread_level_t prv;
161 if (QMP_init_msg_passing(argc, argv, QMP_THREAD_MULTIPLE, &prv) != QMP_SUCCESS)
163 QDPIO::cerr <<
"QMP_init_msg_passing failed" << std::endl;
173 if (QMP_declare_logical_topology(logical_geom.
slice(),
Nd) != QMP_SUCCESS)
175 QDPIO::cerr <<
"QMP_declare_logical_topology failed" << std::endl;
215#if defined(QDP_USE_HDF5)
219 QMP_finalize_msg_passing();
Container for a multi-dimensional 1D array.
const T * slice() const
Return ref to a column slice.
void init()
Initializer for layout.
bool primaryNode()
Returns whether this is the primary node.
StandardOutputStream cout
StandardOutputStream cerr
Yet another random number generator.
bool QDP_isInitialized()
Is the machine initialized?
void QDP_initialize(int *argc, char ***argv)
Turn on the machine.
static bool isInit
Private flag for status.
void QDP_suspend()
Suspends QDP communications.
int setProgramProfileLevel(int n)
void QDP_abort(int status)
Panic button.
void QDP_resume()
Resumes QDP communications.
void initProfile(const std::string &file, const std::string &caller, int line)
void QDP_finalize()
Turn off the machine.
int QDP_info(const char *format,...)
Simple information display routine.
Primary include file for QDP.
void QMP_verbose(QMP_bool_t verbose)