OPAL (Object Oriented Parallel Accelerator Library)  2.2.0
OPAL
IpplInfo.cpp
Go to the documentation of this file.
1 // -*- C++ -*-
2 /***************************************************************************
3  *
4  * The IPPL Framework
5  *
6  * This program was prepared by PSI.
7  * All rights in the program are reserved by PSI.
8  * Neither PSI nor the author(s)
9  * makes any warranty, express or implied, or assumes any liability or
10  * responsibility for the use of this software
11  *
12  * Visit www.amas.web.psi for more details
13  *
14  ***************************************************************************/
15 
16 // -*- C++ -*-
17 /***************************************************************************
18  *
19  * The IPPL Framework
20  *
21  *
22  * Visit http://people.web.psi.ch/adelmann/ for more details
23  *
24  ***************************************************************************/
25 
26 // include files
27 #include "Utility/IpplInfo.h"
28 #include "Utility/IpplStats.h"
29 #include "Utility/PAssert.h"
31 #include "Utility/vmap.h"
33 #include "Message/CommCreator.h"
34 #include "Message/Communicate.h"
35 
36 #include "IpplVersions.h"
37 
38 #include <unistd.h>
39 #include <cstdio>
40 #include <csignal>
41 
43 // public static members of IpplInfo, initialized to default values
50 
52  if (Comm == 0)
53  Comm = new Communicate();
54  if (Stats == 0)
55  Stats = new IpplStats();
56  if (Info == 0)
57  Info = new Inform("Ippl");
58  if (Warn == 0)
59  Warn = new Inform("Warning", std::cerr);
60  if (Error == 0)
61  Error = new Inform("Error", std::cerr, INFORM_ALL_NODES);
62  if (Debug == 0)
63  Debug = new Inform("**DEBUG**", std::cerr, INFORM_ALL_NODES);
64 }
65 
67  delete Comm;
68  delete Stats;
69  delete Info;
70  delete Warn;
71  delete Error;
72  delete Debug;
73 
74  Comm = 0;
75  Stats = 0;
76  Info = 0;
77  Warn = 0;
78  Error = 0;
79  Debug = 0;
80 }
81 
82 std::stack<StaticIpplInfo> IpplInfo::stashedStaticMembers;
83 
84 //dks base member of IpplInfo initialized to default values
85 bool IpplInfo::DKSEnabled = false;
86 
87 #ifdef IPPL_DKS
88 
89 #ifdef IPPL_DKS_CUDA
90 DKSOPAL *IpplInfo::DKS = new DKSOPAL("Cuda", "-gpu");
91 #endif
92 
93 #ifdef IPPL_DKS_OPENCL
94 DKSOPAL *IpplInfo::DKS = new DKSOPAL("OpenCL", "-gpu");
95 #endif
96 
97 #ifdef IPPL_DKS_MIC
98 DKSOPAL *IpplInfo::DKS = new DKSOPAL("OpenMP", "-mic");
99 #endif
100 
101 #endif
102 
103 
104 // should we use the optimization of deferring guard cell fills until
105 // absolutely needed? Can be changed to true by specifying the
106 // flag --defergcfill
107 bool IpplInfo::deferGuardCellFills = false;
108 
109 // should we use the compression capabilities in {[Bare]Field,LField}? Can be
110 // changed to false by specifying the flag --nofieldcompression
111 bool IpplInfo::noFieldCompression = false;
112 
113 // private static members of IpplInfo, initialized to default values
114 MPI_Comm IpplInfo::communicator_m = MPI_COMM_WORLD;
115 int IpplInfo::NumCreated = 0;
116 bool IpplInfo::CommInitialized = false;
117 bool IpplInfo::PrintStats = false;
118 bool IpplInfo::NeedDeleteComm = false;
119 int IpplInfo::MyArgc = 0;
120 char **IpplInfo::MyArgv = 0;
121 int IpplInfo::MyNode = 0;
122 int IpplInfo::TotalNodes = 1;
123 int IpplInfo::NumSMPs = 1;
124 int* IpplInfo::SMPIDList = 0;
125 int* IpplInfo::SMPNodeList = 0;
126 bool IpplInfo::UseChecksums = false;
127 bool IpplInfo::Retransmit = false;
128 int IpplInfo::MaxFFTNodes = 0;
129 int IpplInfo::ChunkSize = 512*1024; // 512K == 64K doubles
130 bool IpplInfo::PerSMPParallelIO = false;
131 bool IpplInfo::offsetStorage = false;
132 bool IpplInfo::extraCompressChecks = false;
133 bool IpplInfo::useDirectIO = false;
134 
135 
136 #ifdef IPPL_COMM_ALARMS
137 // A timeout quantity, in seconds, to allow us to wait a certain number
138 // of seconds before we signal a timeout when we're trying to rece
139 // a message. By default, this will be zero; change it with the
140 // --msgtimeout <seconds> flag
141 unsigned int IpplInfo::CommTimeoutSeconds = 0;
142 #endif
143 
144 
146 // print out current state to the given output stream
147 std::ostream& operator<<(std::ostream& o, const IpplInfo&) {
148  o << "------------------------------------------\n";
149  o << "IPPL Framework Application Summary:\n";
150  o << " Running on node " << IpplInfo::myNode();
151  o << ", out of " << IpplInfo::getNodes() << " total.\n";
152  o << " Number of SMPs: " << IpplInfo::getSMPs() << "\n";
153  o << " Relative SMP node: " << IpplInfo::mySMPNode();
154  o << ", out of " << IpplInfo::getSMPNodes(IpplInfo::mySMP());
155  o << " nodes.\n";
156  o << " Communication method: " << IpplInfo::Comm->name() << "\n";
157  o << " Disc read chunk size: " << IpplInfo::chunkSize() << " bytes.\n";
158  o << " Deferring guard cell fills? ";
159  o << IpplInfo::deferGuardCellFills << "\n";
160  o << " Turning off Field compression? ";
161  o << IpplInfo::noFieldCompression << "\n";
162  o << " Offsetting storage? ";
163  o << IpplInfo::offsetStorage << "\n";
164  o << " Using extra compression checks in expressions? ";
165  o << IpplInfo::extraCompressChecks << "\n";
166  o << " Use per-SMP parallel IO? ";
167  o << IpplInfo::perSMPParallelIO() << "\n";
168  o << " Computing message CRC checksums? ";
169  o << IpplInfo::useChecksums() << "\n";
170  o << " Retransmit messages on error (only if checkums on)? ";
171  o << IpplInfo::retransmit() << "\n";
172 
173 #ifdef IPPL_DIRECTIO
174  o << " Use Direct-IO? " << IpplInfo::useDirectIO << "\n";
175 #endif
176 
177 #ifdef IPPL_COMM_ALARMS
178  if (IpplInfo::getCommTimeout() > 0) {
179  o << " Allowed message receive timeout length (in seconds): ";
180  o << IpplInfo::getCommTimeout() << "\n";
181  }
182 #endif
183 
184  o << " Elapsed wall-clock time (in seconds): ";
185  o << IpplInfo::Stats->getTime().clock_time() << "\n";
186  o << " Elapsed CPU-clock time (in seconds) : ";
187  o << IpplInfo::Stats->getTime().cpu_time() << "\n";
188  o << "------------------------------------------\n";
189  return o;
190 }
191 
192 
194 // Constructor 1: parse argc, argv, and create proper Communicate object
195 // The second argument controls whether the IPPL-specific command line
196 // arguments are stripped out (the default) or left in (if the setting
197 // is IpplInfo::KEEP).
198 IpplInfo::IpplInfo(int& argc, char**& argv, int removeargs, MPI_Comm mpicomm) {
199 
200  int i; // loop variables
201  int connectoption = (-1); // for connection method option
202  int retargc; // number of args to return to caller
203  char **retargv; // arguments to return
204  bool printsummary = false; // print summary at end of constructor
205 
206  //Inform dbgmsg("IpplInfo(argc,argv)", INFORM_ALL_NODES);
207 
208  // determine whether we should strip out ippl-specific arguments, or keep
209  bool stripargs = (removeargs != KEEP);
210 
211  communicator_m = mpicomm;
212 
213  if (NumCreated == 0) {
214  Comm = new Communicate();
215  Stats = new IpplStats();
216  Info = new Inform("Ippl");
217  Warn = new Inform("Warning", std::cerr);
218  Error = new Inform("Error", std::cerr, INFORM_ALL_NODES);
219  Debug = new Inform("**DEBUG**", std::cerr, INFORM_ALL_NODES);
220  }
221  // You can only specify argc, argv once; if it is done again, print a warning
222  // and continue as if we had not given argc, argv.
223  if ( CommInitialized ) {
224  // ADA WARNMSG("Attempt to create IpplInfo with argc, argv again." << endl);
225  //WARNMSG("Using previous argc,argv settings." << endl);
226  } else {
227  // dbgmsg << "Starting initialization: argc = " << argc << ", " << endl;
228  // for (unsigned int dbgi=0; dbgi < argc; ++dbgi)
229  // dbgmsg << " argv[" << dbgi << "] = '" << argv[dbgi] << "'" << endl;
230 
231  // first make a pass through the arguments, figure out whether we should
232  // run in parallel, and start up the parallel environment. After this,
233  // process all the other cmdline args
234  std::string commtype;
235  bool startcomm = false;
236  bool comminit = true; // do comm. system's init call
237  int nprocs = (-1); // num of processes to start; -1 means default
238 
239 
240  /*
241  if no argument is given, we assume mpi as
242  communication method
243  */
244  commtype = std::string("mpi");
245  startcomm = true;
246 
247  for (i=1; i < argc; ++i) {
248  if ( ( strcmp(argv[i], "--processes") == 0 ) ||
249  ( strcmp(argv[i], "-procs") == 0 ) ) {
250  // The user specified how many processes to use. This may not be useful
251  // for all communication methods.
252  if ( (i + 1) < argc && argv[i+1][0] != '-' && atoi(argv[i+1]) > 0 )
253  nprocs = atoi(argv[++i]);
254  else
255  param_error(argv[i],
256  "Please specify a positive number of processes", 0);
257  } else if ( ( strcmp(argv[i], "--commlib") == 0 ) ||
258  ( strcmp(argv[i], "-comm") == 0 ) ) {
259  // The user specified what kind of comm library to use
260  if ( (i + 1) < argc && argv[i+1][0] != '-' ) {
261  commtype = argv[++i];
262  startcomm = true;
263  } else {
264  param_error(argv[i], "Please use one of: ",
266  startcomm = false;
267  }
268 
269  } else if ( strcmp(argv[i], "--nocomminit") == 0 ) {
270  // The user requested that we do not let the run-time system call
271  // whatever initialization routine it might have (like MPI_Init).
272  // This is in case another agency has already done the initialization.
273  comminit = false;
274  }
275  }
276 
277  // create Communicate object now.
278  // dbgmsg << "Setting up parallel environment ..." << endl;
279  if (startcomm && nprocs != 0 && nprocs != 1) {
280  // dbgmsg << " commlibarg=" << commtype << endl;
281  // dbgmsg << ", nprocs=" << nprocs << endl;
282  Communicate *newcomm = CommCreator::create(commtype.c_str(),
283  argc, argv,
284  nprocs, comminit, mpicomm);
285 
286  if (newcomm == 0) {
287  if (CommCreator::supported(commtype.c_str()))
288  param_error("--commlib", "Could not initialize this ",
289  "communication library.", commtype.c_str());
290  else if (CommCreator::known(commtype.c_str()))
291  param_error("--commlib", "This communication library is not ",
292  "available.", commtype.c_str());
293  else
294  param_error("--commlib", "Please use one of: ",
296  } else {
297  // success, we have a new comm object
298  NeedDeleteComm = true;
299  delete Comm;
300  Comm = newcomm;
301 
302  // cache our node number and node count
303  MyNode = Comm->myNode();
304  TotalNodes = Comm->getNodes();
305  find_smp_nodes();
306 
307  // advance the default random number generator
309 
310  // dbgmsg << " Comm creation successful." << endl;
311  // dbgmsg << *this << endl;
312  }
313  }
314 
315  // dbgmsg << "After comm init: argc = " << argc << ", " << endl;
316  // for (unsigned int dbgi=0; dbgi < argc; ++dbgi)
317  // dbgmsg << " argv[" << dbgi << "] = '" << argv[dbgi] << "'" << endl;
318 
319  // keep track of which arguments we do no use; these are returned
320  retargc = 1;
321  retargv = new char*[argc];
322  retargv[0] = argv[0]; // we always return arg 0 (the exec. name)
323 
324  // if we're not stripping out arguments, just save all the args
325  if (!stripargs)
326  for (i=1; i < argc; ++i)
327  retargv[retargc++] = argv[i];
328 
329 
330  // Parse command-line options, looking for ippl options. When found,
331  // save their suggested values and use them at the end to create data, etc.
332  for (i=1; i < argc; ++i) {
333  if ( ( strcmp(argv[i], "--processes") == 0 ) ||
334  ( strcmp(argv[i], "-procs") == 0 ) ) {
335  // handled above
336  if ( (i + 1) < argc && argv[i+1][0] != '-' && atoi(argv[i+1]) > 0 )
337  ++i;
338 
339  } else if ( ( strcmp(argv[i], "--nocomminit") == 0 ) ) {
340  // handled above, nothing to do here but skip the arg
341 
342  } else if ( ( strcmp(argv[i], "--summary") == 0 ) ) {
343  // set flag to print out summary of Ippl library settings at the
344  // end of this constructor
345  printsummary = true;
346 
347  } else if ( ( strcmp(argv[i], "--ipplversion") == 0 ) ) {
348  printVersion(false);
349  std::string options = compileOptions();
350  std::string header("Compile-time options: ");
351  while (options.length() > 58) {
352  std::string line = options.substr(0, 58);
353  size_t n = line.find_last_of(' ');
354  INFOMSG(header << line.substr(0, n) << "\n");
355 
356  header = std::string(22, ' ');
357  options = options.substr(n + 1);
358  }
359  INFOMSG(header << options << endl);
360  exit(0);
361 
362  } else if ( ( strcmp(argv[i], "--checksums") == 0 ) ||
363  ( strcmp(argv[i], "--checksum") == 0 ) ) {
364  UseChecksums = true;
365 
366  } else if ( ( strcmp(argv[i], "--retransmit") == 0 ) ) {
367  Retransmit = true;
368 
369  } else if ( ( strcmp(argv[i], "--ipplversionall") == 0 ) ||
370  ( strcmp(argv[i], "-vall") == 0 ) ) {
371  printVersion(true);
372  std::string options = compileOptions();
373  std::string header("Compile-time options: ");
374  while (options.length() > 58) {
375  std::string line = options.substr(0, 58);
376  size_t n = line.find_last_of(' ');
377  INFOMSG(header << line.substr(0, n) << "\n");
378 
379  header = std::string(22, ' ');
380  options = options.substr(n + 1);
381  }
382  INFOMSG(header << options << endl);
383  exit(0);
384 
385  } else if ( ( strcmp(argv[i], "--time") == 0 ) ||
386  ( strcmp(argv[i], "-time") == 0 ) ||
387  ( strcmp(argv[i], "--statistics") == 0 ) ||
388  ( strcmp(argv[i], "-stats") == 0 ) ) {
389  // The user specified that the program stats be printed at
390  // the end of the program.
391  PrintStats = true;
392 
393  } else if ( ( strcmp(argv[i], "--info") == 0 ) ) {
394  // Set the output level for informative messages.
395  if ( (i + 1) < argc && argv[i+1][0] != '-' && atoi(argv[i+1]) >= 0 )
396  Info->setOutputLevel(atoi(argv[++i]));
397  else
398  param_error(argv[i],
399  "Please specify an output level from 0 to 5", 0);
400 
401  } else if ( ( strcmp(argv[i], "--use-dks") == 0 ) ) {
402  // Set DKSEnabled to true if OPAL is compiled with DKS.
403  #ifdef IPPL_DKS
404  int ndev = 0;
405  DKS->getDeviceCount(ndev);
406  if (ndev > 0) {
407  DKSEnabled = true;
408  INFOMSG("DKS enabled OPAL will use GPU where possible");
409  INFOMSG(endl);
410  } else {
411  DKSEnabled = false;
412  INFOMSG("No GPU device detected! --use-dks flag will have no effect");
413  INFOMSG(endl);
414  }
415  //TODO: check if any device is available and disable DKS if there isn't
416  #else
417  DKSEnabled = false;
418  INFOMSG("OPAL compiled without DKS, " << argv[i] << " flag has no effect");
419  INFOMSG(endl);
420  #endif
421 
422  } else if ( ( strcmp(argv[i], "--warn") == 0 ) ) {
423  // Set the output level for warning messages.
424  if ( (i + 1) < argc && argv[i+1][0] != '-' && atoi(argv[i+1]) >= 0 )
425  Warn->setOutputLevel(atoi(argv[++i]));
426  else
427  param_error(argv[i],
428  "Please specify an output level from 0 to 5", 0);
429 
430  } else if ( ( strcmp(argv[i], "--error") == 0 ) ) {
431  // Set the output level for error messages.
432  if ( (i + 1) < argc && argv[i+1][0] != '-' && atoi(argv[i+1]) >= 0 )
433  Error->setOutputLevel(atoi(argv[++i]));
434  else
435  param_error(argv[i],
436  "Please specify an output level from 0 to 5", 0);
437 
438  } else if ( ( strcmp(argv[i], "--debug") == 0 ) ) {
439  // Set the output level for debug messages.
440  if ( (i + 1) < argc && argv[i+1][0] != '-' && atoi(argv[i+1]) >= 0 )
441  Debug->setOutputLevel(atoi(argv[++i]));
442  else
443  param_error(argv[i],
444  "Please specify an output level from 0 to 5", 0);
445 
446  } else if ( ( strcmp(argv[i], "--connect") == 0 ) ) {
447  // Set the default external connection method
448  if ( (i + 1) < argc && argv[i+1][0] != '-' )
449  connectoption = ++i;
450  else
451  param_error(argv[i], "Please use one of: ",
453 
454  } else if ( ( strcmp(argv[i], "--connectnodes") == 0 ) ) {
455  // Set the number of nodes that are used in connections, by default
456  if ( (i + 1) < argc && argv[i+1][0] != '-' && atoi(argv[i+1]) > 0 )
457  DataConnectCreator::setDefaultNodes(atoi(argv[++i]));
458  else
459  param_error(argv[i],
460  "Please specify a number of nodes for connections > 0",
461  0);
462 
463  } else if ( ( strcmp(argv[i], "--commlib") == 0 ) ||
464  ( strcmp(argv[i], "-comm") == 0 ) ) {
465  // handled above
466  if ( (i + 1) < argc && argv[i+1][0] != '-' )
467  ++i;
468 
469  } else if ( strcmp(argv[i], "--profile") == 0 ) {
470  // handled above in
471  if ( (i + 1) < argc && argv[i+1][0] != '-' )
472  ++i;
473 
474  } else if ( ( strcmp(argv[i], "--persmppario") == 0 ) ) {
475  // Turn on the ability to use per-smp parallel IO
476  PerSMPParallelIO = true;
477 
478  } else if ( ( strcmp(argv[i], "--nopersmppario") == 0 ) ) {
479  // Turn off the ability to use per-smp parallel IO
480  PerSMPParallelIO = false;
481 
482  } else if ( ( strcmp(argv[i], "--chunksize") == 0 ) ) {
483  // Set the I/O chunk size, used to limit how many items
484  // are read in or written to disk at one time.
485  if ( (i + 1) < argc && argv[i+1][0] != '-' && atoi(argv[i+1]) >= 0 ) {
486  ChunkSize = atoi(argv[++i]);
487  char units = static_cast<char>(toupper(argv[i][strlen(argv[i])-1]));
488  if (units == 'K')
489  ChunkSize *= 1024;
490  else if (units == 'M')
491  ChunkSize *= 1024*1024;
492  else if (units == 'G')
493  ChunkSize *= 1024*1024*1024;
494  } else {
495  param_error(argv[i],
496  "Please specify a timeout value (in seconds)", 0);
497  }
498 #ifdef IPPL_COMM_ALARMS
499  } else if ( ( strcmp(argv[i], "--msgtimeout") == 0 ) ) {
500  // Set the timeout period for receiving messages
501  if ( (i + 1) < argc && argv[i+1][0] != '-' && atoi(argv[i+1]) >= 0 )
502  CommTimeoutSeconds = atoi(argv[++i]);
503  else
504  param_error(argv[i],
505  "Please specify a timeout value (in seconds)", 0);
506 #endif
507 
508  } else if ( ( strcmp(argv[i], "--defergcfill") == 0 ) ) {
509  // Turn on the defer guard cell fill optimization
510  deferGuardCellFills = true;
511 
512  } else if ( ( strcmp(argv[i], "--offsetstorage") == 0 ) ) {
513  // Turn on the offset-storage modification to LFields
514  offsetStorage = true;
515 
516  } else if ( ( strcmp(argv[i], "--extracompcheck") == 0 ) ) {
517  // Turn on the extra compression checks in expressions
518  extraCompressChecks = true;
519 
520  } else if ( ( strcmp(argv[i], "--nofieldcompression") == 0 ) ) {
521  // Turn off compression in the Field classes
522  noFieldCompression = true;
523 
524  } else if ( ( strcmp(argv[i], "--directio") == 0 ) ) {
525  // Turn on the use of Direct-IO, if possible
526 #ifdef IPPL_DIRECTIO
527  useDirectIO = true;
528 #else
529  param_error(argv[i],
530  "Direct-IO is not available in this build of IPPL", 0);
531 #endif
532  } else if ( ( strcmp(argv[i], "--maxfftnodes") == 0 ) ) {
533  // Limit the number of nodes that can participate in FFT operations
534  if ( (i + 1) < argc && argv[i+1][0] != '-' && atoi(argv[i+1]) > 0 )
535  MaxFFTNodes = atoi(argv[++i]);
536  else
537  param_error(argv[i],
538  "Please specify a maximum number of FFT nodes > 0", 0);
539 
540  } else if ( ( strcmp(argv[i], "--ipplhelp") == 0 ) ||
541  ( strcmp(argv[i], "-h") == 0 ) ||
542  ( strcmp(argv[i], "-?") == 0 ) ) {
543  // print out summary of command line switches and exit
544  printHelp(argv);
545  INFOMSG(" --ipplversion : Print a brief version summary.\n");
546  INFOMSG(" --ipplversionall : Print a detailed version summary.\n");
547  INFOMSG(" --ipplhelp : Display this command-line summary.\n");
548  INFOMSG(endl);
549  exit(0);
550 
551  } else {
552  // Unknown option; just ignore it.
553  DEBUGMSG(level3 << "Unknown command-line option " << argv[i] << endl);
554  if (stripargs)
555  retargv[retargc++] = argv[i];
556  }
557  }
558 
559  // We can get on with creating and initializing all globally-used objects.
560 
561  // Select the default connection method
562  if ( connectoption >= 0 ) {
563  if ( ! DataConnectCreator::setDefaultMethod(argv[connectoption]) ) {
564  if (DataConnectCreator::supported(argv[connectoption]))
565  param_error(argv[connectoption - 1], "Could not initialize this ",
566  "connection.", argv[connectoption]);
567  else if (DataConnectCreator::known(argv[connectoption]))
568  param_error(argv[connectoption - 1],"This connection method is not ",
569  "available.", argv[connectoption]);
570  else
571  param_error(argv[connectoption - 1], "Please use one of: ",
573  }
574  }
575 
576  // indicate back to the caller which arguments are left
577  MyArgc = retargc;
578  MyArgv = retargv;
579  if (stripargs) {
580  argc = retargc;
581  argv = retargv;
582  }
583 
584  // Inform dbgmsg("IpplInfo::IpplInfo", INFORM_ALL_NODES);
585  // dbgmsg << "Created IpplInfo. node = " << MyNode << " out of ";
586  // dbgmsg << TotalNodes << ", commlib = " << Comm->name() << endl;
587 
588  // now, at end, start the timer running, and print out a summary if asked
589  Stats->getTime().stop();
590  Stats->getTime().clear();
591  Stats->getTime().start();
592  }
593 
594  // indicate we've created one more Ippl object
595  CommInitialized = true;
596  NumCreated++;
597 
598  // At the very end, print out a summary if requested
599  if (printsummary)
600  INFOMSG(*this << endl);
601 }
602 
603 
605 // Constructor 2: default constructor.
607  if (NumCreated == 0) {
608  Comm = new Communicate();
609  Stats = new IpplStats();
610  Info = new Inform("Ippl");
611  Warn = new Inform("Warning", std::cerr);
612  Error = new Inform("Error", std::cerr, INFORM_ALL_NODES);
613  Debug = new Inform("**DEBUG**", std::cerr, INFORM_ALL_NODES);
614  }
615 
616  // just indicate we've also been created
617  NumCreated++;
618 }
619 
620 
622 // Constructor 3: copy constructor.
624  if (NumCreated == 0) {
625  Comm = new Communicate();
626  Stats = new IpplStats();
627  Info = new Inform("Ippl");
628  Warn = new Inform("Warning", std::cerr);
629  Error = new Inform("Error", std::cerr, INFORM_ALL_NODES);
630  Debug = new Inform("**DEBUG**", std::cerr, INFORM_ALL_NODES);
631  }
632 
633  // just indicate we've also been created
634  NumCreated++;
635 }
636 
637 
639 // Destructor: need to delete comm library if this is the last IpplInfo
641  // indicate we have one less instance; if this is the last one,
642  // close communication and clean up
643  // Inform dbgmsg("IpplInfo::~IpplInfo", INFORM_ALL_NODES);
644  // dbgmsg << "In destructor: Current NumCreated = " << NumCreated << endl;
645 
646  if ((--NumCreated) == 0) {
647  // at end of program, print statistics if requested to do so
648  if (PrintStats) {
649  Inform statsmsg("Stats", INFORM_ALL_NODES);
650  statsmsg << *this;
651  printStatistics(statsmsg);
652  }
653 
654  // Delete the communications object, if necessary, to shut down parallel
655  // environment
656  if (NeedDeleteComm) {
657  // dbgmsg << " Deleting comm object, since now NumCreated = ";
658  // dbgmsg << NumCreated << endl;
659  delete Comm;
660  Comm = 0;
661  NeedDeleteComm = false;
662  }
663  CommInitialized = false;
664 
665  // delete other dynamically-allocated static objects
666  delete [] MyArgv;
667  if (SMPIDList != 0) {
668  delete [] SMPIDList;
669  }
670  if (SMPNodeList != 0) {
671  delete [] SMPNodeList;
672  }
673  delete Stats;
674 
675  MyArgv = 0;
676  SMPIDList = 0;
677  SMPNodeList = 0;
678  Stats = 0;
679  }
680 }
681 
682 
684 // equal operator
686  // nothing to do, we don't even need to indicate we've made another
687  return *this;
688 }
689 
690 
692 // abort: kill the comm and exit the program, in an emergency. This
693 // will exit with an error code. If the given exit code is < 0, the
694 // program will call the system abort(). If the exit code is >= 0,
695 // the program will call the system exit() with the given error code.
696 void IpplInfo::abort(const char *msg, int exitcode) {
697  // print out message, if one was provided
698  if (msg != 0) {
699  ERRORMSG(msg << endl);
700  }
701 
702  // print out final stats, if necessary
703  if (PrintStats) {
704  Inform statsmsg("Stats", INFORM_ALL_NODES);
705  statsmsg << IpplInfo();
706  printStatistics(statsmsg);
707  }
708 
709  // delete communication object, if necessary
710  if (NeedDeleteComm) {
711  NeedDeleteComm = false;
712  delete Comm;
713  Comm = 0;
714  }
715 
716  // that's it, folks this error will be propperly catched in the main
717  throw std::runtime_error("Error form IpplInfo::abort");
718 }
719 
720 
722 // Signal to ALL the nodes that we should exit or abort. If we abort,
723 // a core file will be produced. If we exit, no core file will be made.
724 // The node which calls abortAllNodes will print out the given message;
725 // the other nodes will print out that they are aborting due to a message
726 // from this node.
727 void IpplInfo::abortAllNodes(const char *msg, bool abortThisNode) {
728  // print out message, if one was provided
729  if (msg != 0) {
730  ERRORMSG(msg << endl);
731  }
732 
733  // print out final stats, if necessary
734  if (PrintStats) {
735  Inform statsmsg("Stats", INFORM_ALL_NODES);
736  statsmsg << IpplInfo();
737  printStatistics(statsmsg);
738  }
739 
740  // broadcast out the kill message, if necessary
741  if (getNodes() > 1)
743 
744  throw std::runtime_error("Error form IpplInfo::abortAllNodes");
745 
746 }
747 
748 void IpplInfo::exitAllNodes(const char *msg, bool exitThisNode) {
749  // print out message, if one was provided
750  if (msg != 0) {
751  ERRORMSG(msg << endl);
752  }
753 
754  // print out final stats, if necessary
755  if (PrintStats) {
756  Inform statsmsg("Stats", INFORM_ALL_NODES);
757  statsmsg << IpplInfo();
758  printStatistics(statsmsg);
759  }
760 
761  // broadcast out the kill message, if necessary
762  if (getNodes() > 1)
764 
765  // Now quit ourselves
766  if (exitThisNode)
767  exit(1);
768 }
769 
770 
772 // getNodes: return the number of 'Nodes' in use for the computation
774  return TotalNodes;
775 }
776 
777 
779 // getContexts: return the number of 'Contexts' for the given node
780 int IpplInfo::getContexts(const int n) {
781  return Comm->getContexts(n);
782 }
783 
784 
786 // getProcesses: return the number of 'Processes' for the given Node and Context
787 int IpplInfo::getProcesses(const int n, const int c) {
788  return Comm->getProcesses(n, c);
789 }
790 
791 
793 // myNode: return which Node we are running on right now
795  return MyNode;
796 }
797 
798 
800 // getSMPs: return number of SMP's (each of which may be running
801 // several processes)
803  return NumSMPs;
804 }
805 
806 
808 // getSMPNodes: return number of nodes on the SMP with the given index
809 int IpplInfo::getSMPNodes(int smpindx) {
810  int num = 0;
811  if (SMPIDList == 0) {
812  num = 1;
813  } else {
814  for (int i=0; i < TotalNodes; ++i)
815  if (SMPIDList[i] == smpindx)
816  num++;
817  }
818  return num;
819 }
820 
821 
823 // mySMP: return ID of my SMP (numbered 0 ... getSMPs() - 1)
825  return (SMPIDList != 0 ? SMPIDList[MyNode] : 0);
826 }
827 
828 
830 // mySMPNode: return relative node number within the nodes on our SMP
832  return (SMPNodeList != 0 ? SMPNodeList[MyNode] : 0);
833 }
834 
835 
837 // printVersion: print out a version summary. If the argument is true,
838 // print out a detailed listing, otherwise a summary.
839 void IpplInfo::printVersion(bool printFull) {
840 #ifdef OPAL_DKS
841  INFOMSG("DKS Version " << IPPL_DKS_VERSION << endl);
842 #endif
843  INFOMSG("IPPL Framework version " << version() << endl);
844  INFOMSG("Last build date: " << compileDate() << " by user ");
845  INFOMSG(compileUser() << endl);
846  INFOMSG("Built for machine: " << compileMachine() << endl);
847 }
848 
849 
850 void IpplInfo::printHelp(char** argv) {
851  INFOMSG("Usage: " << argv[0] << " [<option> <option> ...]\n");
852  INFOMSG(" The possible values for <option> are:\n");
853  INFOMSG(" --summary : Print IPPL lib summary at start.\n");
854  INFOMSG(" --processes <n> : Number of parallel nodes to use.\n");
855  INFOMSG(" --commlib <x> : Selects a parallel comm. library.\n");
856  INFOMSG(" <x> = ");
858  INFOMSG(" --nocomminit : IPPL does not do communication\n");
859  INFOMSG(" initialization, assume already done.\n");
860  INFOMSG(" --connect <x> : Select external connection method.\n");
861  INFOMSG(" <x> = ");
863  INFOMSG(" --time : Show total time used in execution.\n");
864  INFOMSG(" --notime : Do not show timing info (default).\n");
865  INFOMSG(" --info <n> : Set info message level. 0 = off.\n");
866  INFOMSG(" --warn <n> : Set warning message level. 0 = off.\n");
867  INFOMSG(" --error <n> : Set error message level. 0 = off.\n");
868  INFOMSG(" --debug <n> : Set debug message level. 0 = off.\n");
869  /*#ifdef PROFILING_ON
870  INFOMSG(" --profile <gr> : Enable profiling for groups (e.g., M+P+io) \n");
871  INFOMSG(" M - Message, P - Pete, V - Viz, A - Assign, I - IO\n");
872  INFOMSG(" F - Field, L - Layout, S - Sparse, D - Domainmap \n");
873  INFOMSG(" Ut - Utility, R - Region, Ff - FFT \n");
874  INFOMSG(" U - User, 1 - User1, 2 - User2, 3 - User3, 4 - User4\n");
875 
876  #endif*/ //PROFILING_ON
877  INFOMSG(" --defergcfill : Turn on deferred guard cell fills.\n");
878  INFOMSG(" --nofieldcompression: Turn off compression in the Field classes.\n");
879  INFOMSG(" --offsetstorage : Turn on random LField storage offsets.\n");
880  INFOMSG(" --extracompcheck : Turn on extra compression checks in evaluator.\n");
881 #ifdef IPPL_COMM_ALARMS
882  INFOMSG(" --msgtimeout <n> : Set receive timeout time, in secs.\n");
883 #endif
884  INFOMSG(" --checksums : Turn on CRC checksums for messages.\n");
885  INFOMSG(" --retransmit : Resent messages if a CRC error occurs.\n");
886  INFOMSG(" --maxfftnodes <n> : Limit the nodes that work on FFT's.\n");
887  INFOMSG(" --chunksize <n> : Set I/O chunk size. Can end w/K,M,G.\n");
888  INFOMSG(" --persmppario : Enable on-SMP parallel IO option.\n");
889  INFOMSG(" --nopersmppario : Disable on-SMP parallel IO option (default).\n");
890 #ifdef IPPL_DIRECTIO
891  INFOMSG(" --directio : Use Direct-IO if possible.\n");
892 #endif
893 }
894 
896 // here: as in stop in IpplInfo::here (in the debugger)
898 {
899 }
900 
902 // print out statistics to the given Inform stream
904 
905 
907 // version: return the name of this version of Ippl, as a string
908 // (from Versions.h)
909 const char *IpplInfo::version() {
910  return ippl_version_name;
911 }
912 
913 
914 
916 // compileArch: return the architecture on which this library was built
917 // (from IpplVersions.h)
918 const char *IpplInfo::compileArch() {
919  return ippl_compile_arch;
920 }
921 
922 
924 // compileDate: return the date on which this library was prepared for
925 // compilation (from IpplVersions.h)
926 const char *IpplInfo::compileDate() {
927  return ippl_compile_date;
928 }
929 
930 
932 // compileLine: return the compiler command used to compile each source file
933 // (from IpplVersions.h)
934 const char *IpplInfo::compileLine() {
935  return ippl_compile_line;
936 }
937 
938 
940 // compileMachine: return the machine on which this library was
941 // compiled (from IpplVersions.h)
943  return ippl_compile_machine;
944 }
945 
946 
948 // compileOptions: return the option list used to compile this library
949 // (from IpplVersions.h)
951  return ippl_compile_options;
952 }
953 
954 
956 // compileUser: return the username of the user who compiled this
957 // library (from IpplVersions.h)
958 const char *IpplInfo::compileUser() {
959  return ippl_compile_user;
960 }
961 
962 
964 // param_error: print out an error message when an illegal cmd-line
965 // parameter is encountered.
966 // Arguments are: parameter, error message, bad value (if any)
967 void IpplInfo::param_error(const char *param, const char *msg,
968  const char *bad) {
969  if ( param != 0 )
970  ERRORMSG(param << " ");
971  if ( bad != 0 )
972  ERRORMSG(bad << " ");
973  if ( msg != 0 )
974  ERRORMSG(": " << msg);
975  ERRORMSG(endl);
976  IpplInfo::abort(0, 0);
977 }
978 
979 void IpplInfo::param_error(const char *param, const char *msg1,
980  const char *msg2, const char *bad) {
981  if ( param != 0 )
982  ERRORMSG(param << " ");
983  if ( bad != 0 )
984  ERRORMSG(bad << " ");
985  if ( msg1 != 0 )
986  ERRORMSG(": " << msg1);
987  if ( msg2 != 0 )
988  ERRORMSG(msg2);
989  ERRORMSG(endl);
990  IpplInfo::abort(0, 0);
991 }
992 
993 
995 // find out how many SMP's there are, and which processor we are on
996 // our local SMP (e.g., if there are two SMP's with 4 nodes each,
997 // the process will have a node number from 0 ... 7, and an SMP node
998 // number from 0 ... 3
1000  // Inform dbgmsg("IpplInfo::find_smp_nodes", INFORM_ALL_NODES);
1001 
1002  // create a tag for use in sending info to/from other nodes
1004 
1005  // create arrays to store the Node -> SMP mapping, and the relative
1006  // SMP node number
1007  if (SMPIDList != 0)
1008  delete [] SMPIDList;
1009  if (SMPNodeList != 0)
1010  delete [] SMPNodeList;
1011  SMPIDList = new int[TotalNodes];
1012  SMPNodeList = new int[TotalNodes];
1013 
1014  // obtain the hostname and processor ID to send out
1015  char name[1024];
1016  if (gethostname(name, 1023) != 0) {
1017  ERRORMSG("Could not get hostname ... using localhost." << endl);
1018  strcpy(name, "localhost");
1019  }
1020  std::string NodeName(name,strlen(name));
1021  // dbgmsg << "My hostname is " << NodeName << endl;
1022 
1023  // all other nodes send their hostname to node 0; node 0 gets the names,
1024  // maps pnode ID's -> SMP ID's, then broadcasts all the necessary info to
1025  // all other nodes
1026  if (MyNode != 0) {
1027  // other nodes send their node name to node 0
1028  Message *msg = new Message;
1029  ::putMessage(*msg,NodeName);
1030  // dbgmsg << "Sending my name to node 0." << endl;
1031  Comm->send(msg, 0, tag);
1032 
1033  // receive back the SMPIDList mapping
1034  int node = 0;
1035  msg = Comm->receive_block(node, tag);
1036  PInsist(msg != 0 && node == 0,
1037  "SPMDList map not received from master in IpplInfo::find_smp_nodes!!");
1040  delete msg;
1041  }
1042  else {
1043  // collect node names from everyone else, and then retransmit the collected
1044  // list.
1045  SMPIDList[0] = 0;
1046  vmap<std::string,int> smpMap;
1048  smpMap.insert(vmap<std::string,int>::value_type(NodeName, 0));
1049  unsigned int unreceived = TotalNodes - 1;
1050  while (unreceived-- > 0) {
1051  // get the hostname from the remote node
1052  int node = COMM_ANY_NODE;
1053  Message *msg = Comm->receive_block(node, tag);
1054  PInsist(msg != 0,
1055  "Hostname not received by master in IpplInfo::find_smp_nodes!!");
1056  std::string nodename;
1057  ::getMessage(*msg,nodename);
1058  delete msg;
1059  // dbgmsg <<"Received name '"<< nodename <<"' from node "<< node<<endl;
1060 
1061  // put it in the mapping from hostname -> SMP ID, if necessary
1062  smpiter = smpMap.find(nodename);
1063  if (smpiter == smpMap.end())
1064  smpMap.insert(vmap<std::string,int>::value_type(nodename,smpMap.size()));
1065 
1066  // from the hostname, get the SMP ID number and store it in SMPIDList
1067  SMPIDList[node] = smpMap[nodename];
1068  }
1069 
1070  // convert from SMPID mapping -> relative node number
1071  for (int smpindx = 0; (unsigned int) smpindx < smpMap.size(); ++smpindx) {
1072  int smpnodes = 0;
1073  for (int n=0; n < TotalNodes; ++n) {
1074  if (SMPIDList[n] == smpindx)
1075  SMPNodeList[n] = smpnodes++;
1076  }
1077  }
1078 
1079  // broadcast SMP info to other nodes
1080  if (TotalNodes > 1) {
1081  Message *msg = new Message;
1084  Comm->broadcast_others(msg, tag);
1085  }
1086  }
1087 
1088  // compute number of SMP's ... necessary for all but node 0, but we'll do
1089  // it for all
1090  NumSMPs = 0;
1091  for (int ns=0; ns < TotalNodes; ++ns)
1092  if (SMPNodeList[ns] == 0)
1093  NumSMPs++;
1094 
1095  // dbgmsg << "Results of SMP mapping: NumSMPs = " << NumSMPs << endl;
1096  // for (unsigned int n=0; n < TotalNodes; ++n) {
1097  // dbgmsg << " n=" << n << ", SMPID=" << SMPIDList[n] << ", SMPNode=";
1098  // dbgmsg << SMPNodeList[n] << endl;
1099  // }
1100 }
1101 
1103  PAssert_EQ(stashedStaticMembers.size(), 0);
1104 
1105  StaticIpplInfo obj;
1106 
1107  obj.Comm = Comm;
1108  obj.Stats = Stats;
1109  obj.Info = Info;
1110  obj.Warn = Warn;
1111  obj.Error = Error;
1112  obj.Debug = Debug;
1113  obj.deferGuardCellFills = deferGuardCellFills;
1114  obj.noFieldCompression = noFieldCompression;
1115  obj.offsetStorage = offsetStorage;
1116  obj.extraCompressChecks = extraCompressChecks;
1117  obj.useDirectIO = useDirectIO;
1118  obj.communicator_m = communicator_m;
1119  obj.NumCreated = NumCreated;
1120  obj.CommInitialized = CommInitialized;
1121  obj.PrintStats = PrintStats;
1122  obj.NeedDeleteComm = NeedDeleteComm;
1123  obj.UseChecksums = UseChecksums;
1124  obj.Retransmit = Retransmit;
1125  obj.MyArgc = MyArgc;
1126  obj.MyArgv = MyArgv;
1127  obj.MyNode = MyNode;
1128  obj.TotalNodes = TotalNodes;
1129  obj.NumSMPs = NumSMPs;
1130  obj.SMPIDList = SMPIDList;
1131  obj.SMPNodeList = SMPNodeList;
1132  obj.MaxFFTNodes = MaxFFTNodes;
1133  obj.ChunkSize = ChunkSize;
1134  obj.PerSMPParallelIO = PerSMPParallelIO;
1135 
1136 #ifdef IPPL_COMM_ALARMS
1137  obj.CommTimeoutSeconds = CommTimeoutSeconds;
1138 #endif
1139 
1140  stashedStaticMembers.push(obj);
1141 
1142  Comm = 0;
1143  Stats = 0;
1144  Info = 0;
1145  Warn = 0;
1146  Error = 0;
1147  Debug = 0;
1148 
1149  deferGuardCellFills = false;
1150  noFieldCompression = false;
1151  offsetStorage = false;
1152  extraCompressChecks = false;
1153  useDirectIO = false;
1154  communicator_m = MPI_COMM_WORLD;
1155  NumCreated = 0;
1156  CommInitialized = false;
1157  PrintStats = false;
1158  NeedDeleteComm = false;
1159  UseChecksums = false;
1160  Retransmit = false;
1161  MyArgc = 0;
1162  MyArgv = 0;
1163  MyNode = 0;
1164  TotalNodes = 1;
1165  NumSMPs = 1;
1166  SMPIDList = 0;
1167  SMPNodeList = 0;
1168  MaxFFTNodes = 0;
1169  ChunkSize = 512*1024; // 512K == 64K doubles
1170  PerSMPParallelIO = false;
1171 }
1172 
1174  PAssert_EQ(stashedStaticMembers.size(), 1);
1175 
1177  stashedStaticMembers.pop();
1178  // Delete the communications object, if necessary, to shut down parallel
1179  // environment
1180  // Comm is deleted in destructor
1181  delete [] MyArgv;
1182  delete [] SMPIDList;
1183  delete [] SMPNodeList;
1184  delete Info;
1185  delete Warn;
1186  delete Error;
1187  delete Debug;
1188  delete Stats;
1189 
1190  Comm = obj.Comm;
1191  Stats = obj.Stats;
1192  Info = obj.Info;
1193  Warn = obj.Warn;
1194  Error = obj.Error;
1195  Debug = obj.Debug;
1196  deferGuardCellFills = obj.deferGuardCellFills;
1197  noFieldCompression = obj.noFieldCompression;
1198  offsetStorage = obj.offsetStorage;
1199  extraCompressChecks = obj.extraCompressChecks;
1200  useDirectIO = obj.useDirectIO;
1201  communicator_m = obj.communicator_m;
1202  NumCreated = obj.NumCreated;
1203  CommInitialized = obj.CommInitialized;
1204  PrintStats = obj.PrintStats;
1205  NeedDeleteComm = obj.NeedDeleteComm;
1206  UseChecksums = obj.UseChecksums;
1207  Retransmit = obj.Retransmit;
1208  MyArgc = obj.MyArgc;
1209  MyArgv = obj.MyArgv;
1210  MyNode = obj.MyNode;
1211  TotalNodes = obj.TotalNodes;
1212  NumSMPs = obj.NumSMPs;
1213  SMPIDList = obj.SMPIDList;
1214  SMPNodeList = obj.SMPNodeList;
1215  MaxFFTNodes = obj.MaxFFTNodes;
1216  ChunkSize = obj.ChunkSize;
1217  PerSMPParallelIO = obj.PerSMPParallelIO;
1218 
1219 #ifdef IPPL_COMM_ALARMS
1220  CommTimeoutSeconds = obj.CommTimeoutSeconds;
1221 #endif
1222 }
1223 
1224 #ifdef IPPL_RUNTIME_ERRCHECK
1225 // special routine used in runtime debugging error detection
1227 void __C_runtime_error ( int trap_code, char *name, int line_no, ... ) {
1228  switch ( trap_code ) {
1229  /* Subscript range violations: */
1230  case BRK_RANGE:
1231  fprintf ( stderr, "error: Subscript range violation" );
1232  break;
1233 
1234  /* Others (unknown trap codes): */
1235  default:
1236  fprintf ( stderr, "error: Trap %d ", trap_code );
1237  break;
1238  }
1239 
1240  fprintf ( stderr, " in '%s'", name);
1241  if ( line_no != -1 )
1242  fprintf ( stderr, " (line %d)", line_no );
1243  exit (99);
1244 }
1245 #endif
1246 
1247 
1248 /***************************************************************************
1249  * $RCSfile: IpplInfo.cpp,v $ $Author: adelmann $
1250  * $Revision: 1.1.1.1 $ $Date: 2003/01/23 07:40:33 $
1251  * IPPL_VERSION_ID: $Id: IpplInfo.cpp,v 1.1.1.1 2003/01/23 07:40:33 adelmann Exp $
1252  ***************************************************************************/
static int getProcesses(int, int)
Definition: IpplInfo.cpp:787
static bool extraCompressChecks
Definition: IpplInfo.h:306
static int getNodes()
Definition: IpplInfo.cpp:773
static bool Retransmit
Definition: IpplInfo.h:345
std::ostream & operator<<(std::ostream &os, const Attribute &attr)
Definition: Attribute.cpp:167
std::pair< iterator, bool > insert(const value_type &x)
Definition: vmap.hpp:73
const char * ippl_compile_options
Definition: IpplVersions.h:12
Communicate * Comm
static void abort(const char *=0, int exitcode=(-1))
Definition: IpplInfo.cpp:696
static int NumCreated
Definition: IpplInfo.h:328
static void param_error(const char *, const char *, const char *)
Definition: IpplInfo.cpp:967
static bool PerSMPParallelIO
Definition: IpplInfo.h:372
static bool known(int)
static void deleteGlobals()
Definition: IpplInfo.cpp:66
static char ** MyArgv
Definition: IpplInfo.h:349
#define INFORM_ALL_NODES
Definition: Inform.h:38
int myNode() const
Definition: Communicate.h:155
static int NumSMPs
Definition: IpplInfo.h:358
static bool setDefaultMethod(int)
static bool useDirectIO
Definition: IpplInfo.h:311
static int ChunkSize
Definition: IpplInfo.h:367
#define IPPL_TAG_CYCLE
Definition: Tags.h:90
static bool retransmit()
Definition: IpplInfo.h:221
#define ERRORMSG(msg)
Definition: IpplInfo.h:399
const char * ippl_compile_machine
Definition: IpplVersions.h:11
static void stash()
Definition: IpplInfo.cpp:1102
int getContexts(const int n) const
Definition: Communicate.h:147
const char * ippl_compile_line
Definition: IpplVersions.h:9
static bool DKSEnabled
Definition: IpplInfo.h:285
static Inform * Warn
Definition: IpplInfo.h:88
void AdvanceSeed(int adv=0)
Definition: RNGSimple.h:119
IpplInfo & operator=(const IpplInfo &)
Definition: IpplInfo.cpp:685
const int COMM_ANY_NODE
Definition: Communicate.h:40
static int myNode()
Definition: IpplInfo.cpp:794
#define IPPL_DKS_VERSION
Definition: IpplVersions.h:16
RandomNumberGen IpplRandom
static void setDefaultNodes(int)
void getMessage_iter(Message &m, OutputIterator o)
Definition: Message.h:603
#define IPPL_MAKE_HOST_MAP_TAG
Definition: Tags.h:89
int next_tag(int t, int s=1000)
Definition: TagMaker.h:43
static std::stack< StaticIpplInfo > stashedStaticMembers
Definition: IpplInfo.h:382
static bool supported(int)
static int MaxFFTNodes
Definition: IpplInfo.h:364
static int * SMPIDList
Definition: IpplInfo.h:359
static bool deferGuardCellFills
Definition: IpplInfo.h:295
static bool offsetStorage
Definition: IpplInfo.h:302
static Communicate * create(int, int &, char **&, int=(-1), bool=true, MPI_Comm mpicomm=MPI_COMM_WORLD)
static bool noFieldCompression
Definition: IpplInfo.h:298
static Inform * Debug
Definition: IpplInfo.h:90
static bool CommInitialized
Definition: IpplInfo.h:332
const char * ippl_compile_arch
Definition: IpplVersions.h:8
#define PAssert_EQ(a, b)
Definition: PAssert.h:119
static const char * version()
Definition: IpplInfo.cpp:909
static int mySMP()
Definition: IpplInfo.cpp:824
void print(Inform &)
Definition: IpplStats.cpp:105
static const char * compileUser()
Definition: IpplInfo.cpp:958
static int MyNode
Definition: IpplInfo.h:353
static void printVersion(bool=false)
Definition: IpplInfo.cpp:839
static bool useChecksums()
Definition: IpplInfo.h:218
static const char * getAllMethodNames()
static void instantiateGlobals()
Definition: IpplInfo.cpp:51
#define IPPL_ABORT_TAG
Definition: Tags.h:25
constexpr double c
The velocity of light in m/s.
Definition: Physics.h:52
static int TotalNodes
Definition: IpplInfo.h:354
static const char * compileArch()
Definition: IpplInfo.cpp:918
static int mySMPNode()
Definition: IpplInfo.cpp:831
#define INFOMSG(msg)
Definition: IpplInfo.h:397
virtual int broadcast_others(Message *, int, bool delmsg=true)
static const char * compileLine()
Definition: IpplInfo.cpp:934
Timer & getTime()
Definition: IpplStats.h:81
static int getSMPs()
Definition: IpplInfo.cpp:802
static void abortAllNodes(const char *=0, bool thisnode=true)
Definition: IpplInfo.cpp:727
Inform & setOutputLevel(const int)
Definition: Inform.cpp:228
static const char * getAllLibraryNames()
Definition: CommCreator.cpp:69
static bool PrintStats
Definition: IpplInfo.h:336
std::pair< Key, T > value_type
Definition: vmap.h:71
static void here()
Definition: IpplInfo.cpp:897
const char * ippl_compile_user
Definition: IpplVersions.h:13
static bool UseChecksums
Definition: IpplInfo.h:342
static bool supported(int)
Definition: CommCreator.cpp:77
static void printHelp(char **argv)
Definition: IpplInfo.cpp:850
static IpplStats * Stats
Definition: IpplInfo.h:96
int getProcesses(const int n, const int c) const
Definition: Communicate.h:151
static Inform * Error
Definition: IpplInfo.h:89
static const char * compileOptions()
Definition: IpplInfo.cpp:950
const char * ippl_compile_date
Definition: IpplVersions.h:10
static const char * compileMachine()
Definition: IpplInfo.cpp:942
void stop()
Definition: Timer.cpp:18
static Inform * Info
Definition: IpplInfo.h:87
const std::string name
static void find_smp_nodes()
Definition: IpplInfo.cpp:999
void clear()
Definition: Timer.cpp:8
void getMessage(Message &m, T &t)
Definition: Message.h:580
static void printStatistics(Inform &)
Definition: IpplInfo.cpp:903
double clock_time()
Definition: Timer.cpp:29
static int * SMPNodeList
Definition: IpplInfo.h:360
size_type size() const
Definition: vmap.h:138
static int chunkSize()
Definition: IpplInfo.h:239
Inform & level3(Inform &inf)
Definition: Inform.cpp:47
#define PInsist(c, m)
Definition: PAssert.h:135
void putMessage(Message &m, const T &t)
Definition: Message.h:557
const char * ippl_version_name
Definition: IpplVersions.h:7
double cpu_time()
Definition: Timer.cpp:44
static bool NeedDeleteComm
Definition: IpplInfo.h:339
static int getSMPNodes(int)
Definition: IpplInfo.cpp:809
void start()
Definition: Timer.cpp:13
rep_type::iterator iterator
Definition: vmap.h:116
Message * receive_block(int &node, int &tag)
Definition: Inform.h:41
virtual const char * name() const
Definition: Communicate.h:137
#define DEBUGMSG(msg)
Definition: IpplInfo.h:405
static Communicate * Comm
Definition: IpplInfo.h:93
iterator find(const key_type &x)
Definition: vmap.hpp:214
bool send(Message *, int node, int tag, bool delmsg=true)
static void pop()
Definition: IpplInfo.cpp:1173
static void exitAllNodes(const char *=0, bool thisnode=true)
Definition: IpplInfo.cpp:748
static const char * compileDate()
Definition: IpplInfo.cpp:926
#define IPPL_EXIT_TAG
Definition: Tags.h:26
int getNodes() const
Definition: Communicate.h:143
Inform & endl(Inform &inf)
Definition: Inform.cpp:42
iterator end()
Definition: vmap.h:126
static MPI_Comm communicator_m
Definition: IpplInfo.h:324
Definition: vmap.h:65
static int getContexts(int)
Definition: IpplInfo.cpp:780
static bool known(const char *nm)
Definition: CommCreator.h:69
static int MyArgc
Definition: IpplInfo.h:348
static bool perSMPParallelIO()
Definition: IpplInfo.h:244