161 int connectoption = (-1);
164 bool printsummary =
false;
169 bool stripargs = (removeargs !=
KEEP);
194 std::string commtype;
195 bool startcomm =
false;
196 bool comminit =
true;
204 commtype = std::string(
"mpi");
207 for (i=1; i < argc; ++i) {
208 if ( ( strcmp(argv[i],
"--processes") == 0 ) ||
209 ( strcmp(argv[i],
"-procs") == 0 ) ) {
212 if ( (i + 1) < argc && argv[i+1][0] !=
'-' && atoi(argv[i+1]) > 0 )
213 nprocs = atoi(argv[++i]);
216 "Please specify a positive number of processes", 0);
217 }
else if ( ( strcmp(argv[i],
"--commlib") == 0 ) ||
218 ( strcmp(argv[i],
"-comm") == 0 ) ) {
220 if ( (i + 1) < argc && argv[i+1][0] !=
'-' ) {
221 commtype = argv[++i];
229 }
else if ( strcmp(argv[i],
"--nocomminit") == 0 ) {
239 if (startcomm && nprocs != 0 && nprocs != 1) {
244 nprocs, comminit, mpicomm);
248 param_error(
"--commlib",
"Could not initialize this ",
249 "communication library.", commtype.c_str());
251 param_error(
"--commlib",
"This communication library is not ",
252 "available.", commtype.c_str());
281 retargv =
new char*[argc];
282 retargv[0] = argv[0];
286 for (i=1; i < argc; ++i)
287 retargv[retargc++] = argv[i];
292 for (i=1; i < argc; ++i) {
293 if ( ( strcmp(argv[i],
"--processes") == 0 ) ||
294 ( strcmp(argv[i],
"-procs") == 0 ) ) {
296 if ( (i + 1) < argc && argv[i+1][0] !=
'-' && atoi(argv[i+1]) > 0 )
299 }
else if ( ( strcmp(argv[i],
"--nocomminit") == 0 ) ) {
302 }
else if ( ( strcmp(argv[i],
"--summary") == 0 ) ) {
307 }
else if ( ( strcmp(argv[i],
"--ipplversion") == 0 ) ) {
310 std::string header(
"Compile-time options: ");
311 while (options.length() > 58) {
312 std::string line = options.substr(0, 58);
313 size_t n = line.find_last_of(
' ');
314 INFOMSG(header << line.substr(0, n) <<
"\n");
316 header = std::string(22,
' ');
317 options = options.substr(n + 1);
322 }
else if ( ( strcmp(argv[i],
"--checksums") == 0 ) ||
323 ( strcmp(argv[i],
"--checksum") == 0 ) ) {
326 }
else if ( ( strcmp(argv[i],
"--retransmit") == 0 ) ) {
329 }
else if ( ( strcmp(argv[i],
"--ipplversionall") == 0 ) ||
330 ( strcmp(argv[i],
"-vall") == 0 ) ) {
333 std::string header(
"Compile-time options: ");
334 while (options.length() > 58) {
335 std::string line = options.substr(0, 58);
336 size_t n = line.find_last_of(
' ');
337 INFOMSG(header << line.substr(0, n) <<
"\n");
339 header = std::string(22,
' ');
340 options = options.substr(n + 1);
345 }
else if ( ( strcmp(argv[i],
"--time") == 0 ) ||
346 ( strcmp(argv[i],
"-time") == 0 ) ||
347 ( strcmp(argv[i],
"--statistics") == 0 ) ||
348 ( strcmp(argv[i],
"-stats") == 0 ) ) {
353 }
else if ( ( strcmp(argv[i],
"--info") == 0 ) ) {
355 if ( (i + 1) < argc && argv[i+1][0] !=
'-' && atoi(argv[i+1]) >= 0 )
356 Info->setOutputLevel(atoi(argv[++i]));
359 "Please specify an output level from 0 to 5", 0);
361 }
else if ( ( strcmp(argv[i],
"--warn") == 0 ) ) {
363 if ( (i + 1) < argc && argv[i+1][0] !=
'-' && atoi(argv[i+1]) >= 0 )
364 Warn->setOutputLevel(atoi(argv[++i]));
367 "Please specify an output level from 0 to 5", 0);
369 }
else if ( ( strcmp(argv[i],
"--error") == 0 ) ) {
371 if ( (i + 1) < argc && argv[i+1][0] !=
'-' && atoi(argv[i+1]) >= 0 )
372 Error->setOutputLevel(atoi(argv[++i]));
375 "Please specify an output level from 0 to 5", 0);
377 }
else if ( ( strcmp(argv[i],
"--debug") == 0 ) ) {
379 if ( (i + 1) < argc && argv[i+1][0] !=
'-' && atoi(argv[i+1]) >= 0 )
380 Debug->setOutputLevel(atoi(argv[++i]));
383 "Please specify an output level from 0 to 5", 0);
385 }
else if ( ( strcmp(argv[i],
"--connect") == 0 ) ) {
387 if ( (i + 1) < argc && argv[i+1][0] !=
'-' )
393 }
else if ( ( strcmp(argv[i],
"--connectnodes") == 0 ) ) {
395 if ( (i + 1) < argc && argv[i+1][0] !=
'-' && atoi(argv[i+1]) > 0 )
399 "Please specify a number of nodes for connections > 0",
402 }
else if ( ( strcmp(argv[i],
"--commlib") == 0 ) ||
403 ( strcmp(argv[i],
"-comm") == 0 ) ) {
405 if ( (i + 1) < argc && argv[i+1][0] !=
'-' )
408 }
else if ( strcmp(argv[i],
"--profile") == 0 ) {
410 if ( (i + 1) < argc && argv[i+1][0] !=
'-' )
413 }
else if ( ( strcmp(argv[i],
"--persmppario") == 0 ) ) {
417 }
else if ( ( strcmp(argv[i],
"--nopersmppario") == 0 ) ) {
421 }
else if ( ( strcmp(argv[i],
"--chunksize") == 0 ) ) {
424 if ( (i + 1) < argc && argv[i+1][0] !=
'-' && atoi(argv[i+1]) >= 0 ) {
426 char units =
static_cast<char>(toupper(argv[i][strlen(argv[i])-1]));
429 else if (units ==
'M')
431 else if (units ==
'G')
435 "Please specify a timeout value (in seconds)", 0);
437 }
else if ( ( strcmp(argv[i],
"--defergcfill") == 0 ) ) {
441 }
else if ( ( strcmp(argv[i],
"--offsetstorage") == 0 ) ) {
445 }
else if ( ( strcmp(argv[i],
"--extracompcheck") == 0 ) ) {
449 }
else if ( ( strcmp(argv[i],
"--nofieldcompression") == 0 ) ) {
453 }
else if ( ( strcmp(argv[i],
"--directio") == 0 ) ) {
456 "Direct-IO is not available in this build of IPPL", 0);
457 }
else if ( ( strcmp(argv[i],
"--maxfftnodes") == 0 ) ) {
459 if ( (i + 1) < argc && argv[i+1][0] !=
'-' && atoi(argv[i+1]) > 0 )
463 "Please specify a maximum number of FFT nodes > 0", 0);
465 }
else if ( ( strcmp(argv[i],
"--ipplhelp") == 0 ) ||
466 ( strcmp(argv[i],
"-h") == 0 ) ||
467 ( strcmp(argv[i],
"-?") == 0 ) ) {
469 INFOMSG(
"Usage: " << argv[0] <<
" [<option> <option> ...]\n");
470 INFOMSG(
" The possible values for <option> are:\n");
472 INFOMSG(
" --ipplversion : Print a brief version summary.\n");
473 INFOMSG(
" --ipplversionall : Print a detailed version summary.\n");
474 INFOMSG(
" --ipplhelp : Display this command-line summary.\n");
481 retargv[retargc++] = argv[i];
488 if ( connectoption >= 0 ) {
491 param_error(argv[connectoption - 1],
"Could not initialize this ",
492 "connection.", argv[connectoption]);
494 param_error(argv[connectoption - 1],
"This connection method is not ",
495 "available.", argv[connectoption]);
497 param_error(argv[connectoption - 1],
"Please use one of: ",
515 Stats->getTime().stop();
516 Stats->getTime().clear();
517 Stats->getTime().start();