119 o <<
"------------------------------------------\n";
120 o <<
"IPPL Framework Application Summary:\n";
129 o <<
" Deferring guard cell fills? ";
131 o <<
" Turning off Field compression? ";
133 o <<
" Offsetting storage? ";
135 o <<
" Using extra compression checks in expressions? ";
137 o <<
" Use per-SMP parallel IO? ";
139 o <<
" Computing message CRC checksums? ";
141 o <<
" Retransmit messages on error (only if checkums on)? ";
144 o <<
" Elapsed wall-clock time (in seconds): ";
146 o <<
" Elapsed CPU-clock time (in seconds) : ";
148 o <<
"------------------------------------------\n";
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 )
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 )
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 )
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 )
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: ",
637 throw std::runtime_error(
"Error form IpplInfo::abort");
664 throw std::runtime_error(
"Error form IpplInfo::abortAllNodes");
678 return Comm->getContexts(
n);
685 return Comm->getProcesses(
n,
c);
745 INFOMSG(
" --summary : Print IPPL lib summary at start.\n");
746 INFOMSG(
" --processes <n> : Number of parallel nodes to use.\n");
747 INFOMSG(
" --commlib <x> : Selects a parallel comm. library.\n");
750 INFOMSG(
" --nocomminit : IPPL does not do communication\n");
751 INFOMSG(
" initialization, assume already done.\n");
752 INFOMSG(
" --connect <x> : Select external connection method.\n");
755 INFOMSG(
" --time : Show total time used in execution.\n");
756 INFOMSG(
" --notime : Do not show timing info (default).\n");
757 INFOMSG(
" --info <n> : Set info message level. 0 = off.\n");
758 INFOMSG(
" --warn <n> : Set warning message level. 0 = off.\n");
759 INFOMSG(
" --error <n> : Set error message level. 0 = off.\n");
760 INFOMSG(
" --debug <n> : Set debug message level. 0 = off.\n");
769 INFOMSG(
" --defergcfill : Turn on deferred guard cell fills.\n");
770 INFOMSG(
" --nofieldcompression : Turn off compression in the Field classes.\n");
771 INFOMSG(
" --offsetstorage : Turn on random LField storage offsets.\n");
772 INFOMSG(
" --extracompcheck : Turn on extra compression checks in evaluator.\n");
773 INFOMSG(
" --checksums : Turn on CRC checksums for messages.\n");
774 INFOMSG(
" --retransmit : Resent messages if a CRC error occurs.\n");
775 INFOMSG(
" --maxfftnodes <n> : Limit the nodes that work on FFT's.\n");
776 INFOMSG(
" --chunksize <n> : Set I/O chunk size. Can end w/K,M,G.\n");
777 INFOMSG(
" --persmppario : Enable on-SMP parallel IO option.\n");
778 INFOMSG(
" --nopersmppario : Disable on-SMP parallel IO option (default).\n");
866 const char *msg2,
const char *bad) {
902 if (gethostname(
name, 1023) != 0) {
903 ERRORMSG(
"Could not get hostname ... using localhost." <<
endl);
904 strcpy(
name,
"localhost");
906 std::string NodeName(
name,strlen(
name));
917 Comm->send(msg, 0, tag);
921 msg =
Comm->receive_block(node, tag);
923 "SPMDList map not received from master in IpplInfo::find_smp_nodes!!");
936 while (unreceived-- > 0) {
941 "Hostname not received by master in IpplInfo::find_smp_nodes!!");
942 std::string nodename;
948 smpiter = smpMap.
find(nodename);
949 if (smpiter == smpMap.
end())
957 for (
int smpindx = 0; (
unsigned int) smpindx < smpMap.
size(); ++smpindx) {
970 Comm->broadcast_others(msg, tag);
void putMessage(Message &m, const T &t)
void getMessage_iter(Message &m, OutputIterator o)
void getMessage(Message &m, T &t)
#define IPPL_MAKE_HOST_MAP_TAG
const char * ippl_compile_date
const char * ippl_compile_user
const char * ippl_compile_line
const char * ippl_compile_options
const char * ippl_version_name
const char * ippl_compile_machine
const char * ippl_compile_arch
Inform & endl(Inform &inf)
std::ostream & operator<<(std::ostream &o, const IpplInfo &)
RandomNumberGen IpplRandom
constexpr double c
The velocity of light in m/s.
static void setDefaultNodes(int)
static bool supported(int)
static const char * getAllMethodNames()
static bool setDefaultMethod(int)
static const char * getAllLibraryNames()
static bool supported(int)
static Communicate * create(int, int &, char **&, int=(-1), bool=true, MPI_Comm mpicomm=MPI_COMM_WORLD)
static bool known(const char *nm)
virtual const char * name() const
Inform & setOutputLevel(const int)
static bool NeedDeleteComm
static void deleteGlobals()
static bool noFieldCompression
static void printStatistics(Inform &)
static void instantiateGlobals()
static bool extraCompressChecks
static void printVersion(void)
static MPI_Comm communicator_m
static bool offsetStorage
static bool perSMPParallelIO()
static const char * compileMachine()
static bool PerSMPParallelIO
static void param_error(const char *, const char *, const char *)
static void abort(const char *=0)
static int getProcesses(int, int)
static int getContexts(int)
static int getSMPNodes(int)
static const char * compileLine()
static const char * compileArch()
static void find_smp_nodes()
static bool useChecksums()
static bool CommInitialized
static const char * version()
static void abortAllNodes(const char *=0)
static std::stack< StaticIpplInfo > stashedStaticMembers
static const char * compileUser()
static bool deferGuardCellFills
static Communicate * Comm
static const char * compileDate()
IpplInfo & operator=(const IpplInfo &)
static const char * compileOptions()
void AdvanceSeed(int adv=0)
rep_type::iterator iterator
iterator find(const key_type &x)
std::pair< Key, T > value_type
std::pair< iterator, bool > insert(const value_type &x)