libmesh.C
Go to the documentation of this file.
1 // The libMesh Finite Element Library.
2 // Copyright (C) 2002-2014 Benjamin S. Kirk, John W. Peterson, Roy H. Stogner
3 
4 // This library is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU Lesser General Public
6 // License as published by the Free Software Foundation; either
7 // version 2.1 of the License, or (at your option) any later version.
8 
9 // This library is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 // Lesser General Public License for more details.
13 
14 // You should have received a copy of the GNU Lesser General Public
15 // License along with this library; if not, write to the Free Software
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 
18 
19 // Local includes
20 #include "libmesh/libmesh.h"
21 #include "libmesh/auto_ptr.h"
22 #include "libmesh/getpot.h"
23 #include "libmesh/parallel.h"
26 #include "libmesh/remote_elem.h"
27 #include "libmesh/threads.h"
28 #include "libmesh/print_trace.h"
29 
30 
31 // C/C++ includes
32 #include <iostream>
33 #include <fstream>
34 
35 #ifdef LIBMESH_ENABLE_EXCEPTIONS
36 #include <exception>
37 #endif
38 
39 #ifdef LIBMESH_HAVE_OPENMP
40 #include <omp.h>
41 #endif
42 
43 #include "signal.h"
44 
45 
46 // floating-point exceptions
47 #ifdef LIBMESH_HAVE_FENV_H
48 # include <fenv.h>
49 #endif
50 #ifdef LIBMESH_HAVE_XMMINTRIN_H
51 # include <xmmintrin.h>
52 #endif
53 
54 
55 #if defined(LIBMESH_HAVE_MPI)
56 # include "libmesh/ignore_warnings.h"
57 # include <mpi.h>
59 #endif // #if defined(LIBMESH_HAVE_MPI)
60 
61 #if defined(LIBMESH_HAVE_PETSC)
62 # include "libmesh/petsc_macro.h"
63 EXTERN_C_FOR_PETSC_BEGIN
64 # include <petsc.h>
65 # include <petscerror.h>
66 EXTERN_C_FOR_PETSC_END
67 # if defined(LIBMESH_HAVE_SLEPC)
68 # include "libmesh/slepc_macro.h"
69 EXTERN_C_FOR_PETSC_BEGIN
70 # include <slepc.h>
71 EXTERN_C_FOR_PETSC_END
72 # endif // #if defined(LIBMESH_HAVE_SLEPC)
73 #endif // #if defined(LIBMESH_HAVE_PETSC)
74 
75 
76 // --------------------------------------------------------
77 // Local anonymous namespace to hold miscelaneous bits
78 namespace {
79 
80  using libMesh::AutoPtr;
81 
84  // If std::cout and std::cerr are redirected, we need to
85  // be a little careful and save the original streambuf objects,
86  // replacing them in the destructor before program termination.
87  std::streambuf* out_buf (NULL);
88  std::streambuf* err_buf (NULL);
89 
91 #if defined(LIBMESH_HAVE_MPI)
93 #endif
94 #if defined(LIBMESH_HAVE_PETSC)
96 #endif
97 #if defined(LIBMESH_HAVE_SLEPC)
99 #endif
100 
101 
102 
106  void libmesh_handleFPE(int /*signo*/, siginfo_t *info, void * /*context*/)
107  {
108  libMesh::err << std::endl;
109  libMesh::err << "Floating point exception signaled (";
110  switch (info->si_code)
111  {
112  case FPE_INTDIV: libMesh::err << "integer divide by zero"; break;
113  case FPE_INTOVF: libMesh::err << "integer overflow"; break;
114  case FPE_FLTDIV: libMesh::err << "floating point divide by zero"; break;
115  case FPE_FLTOVF: libMesh::err << "floating point overflow"; break;
116  case FPE_FLTUND: libMesh::err << "floating point underflow"; break;
117  case FPE_FLTRES: libMesh::err << "floating point inexact result"; break;
118  case FPE_FLTINV: libMesh::err << "invalid floating point operation"; break;
119  case FPE_FLTSUB: libMesh::err << "subscript out of range"; break;
120  default: libMesh::err << "unrecognized"; break;
121  }
122  libMesh::err << ")!" << std::endl;
123 
124  libMesh::err << std::endl;
125  libMesh::err << "To track this down, compile debug version, start debugger, set breakpoint for 'libmesh_handleFPE' and run" << std::endl;
126  libMesh::err << "In gdb do:" << std::endl;
127  libMesh::err << " break libmesh_handleFPE" << std::endl;
128  libMesh::err << " run ..." << std::endl;
129  libMesh::err << " bt" << std::endl;
130 
131  libmesh_error();
132  }
133 }
134 
135 
136 
137 #ifdef LIBMESH_HAVE_MPI
138 void libMesh_MPI_Handler (MPI_Comm *, int *, ...)
139 {
140  libmesh_error();
141 }
142 #endif
143 
144 
145 namespace libMesh
146 {
147 
155  namespace libMeshPrivateData {
156 
160  extern bool _is_initialized;
161 
166  }
167 
168 
169 // ------------------------------------------------------------
170 // libMeshdata initialization
171 #ifdef LIBMESH_HAVE_MPI
172 MPI_Comm COMM_WORLD = MPI_COMM_NULL;
173 #else
174 int COMM_WORLD = 0;
175 #endif
176 
177 #ifdef LIBMESH_DISABLE_COMMWORLD
180 #else
183 #endif
184 
185 
186 OStreamProxy out(std::cout);
187 OStreamProxy err(std::cerr);
188 
189 
190 PerfLog perflog ("libMesh",
191 #ifdef LIBMESH_ENABLE_PERFORMANCE_LOGGING
192  true
193 #else
194  false
195 #endif
196  );
197 
198 
199 // const Real pi = 3.1415926535897932384626433832795029L;
200 
201 #ifdef LIBMESH_USE_COMPLEX_NUMBERS
202 const Number imaginary (0., 1.);
203 // const Number zero (0., 0.);
204 #else
205 // const Number zero = 0.;
206 #endif
207 
208 // This is now a static constant in the header; no reason not to let
209 // the compiler inline it.
210 
211 // const unsigned int invalid_uint = static_cast<unsigned int>(-1);
212 
213 
214 
215 // ------------------------------------------------------------
216 // libMesh::libMeshPrivateData data initialization
217 #ifdef LIBMESH_HAVE_MPI
218 MPI_Errhandler libmesh_errhandler;
219 
222 #endif
223 int libMesh::libMeshPrivateData::_n_threads = 1; /* Threads::task_scheduler_init::automatic; */
226 #if defined(LIBMESH_HAVE_PETSC) // PETSc is the default
228 #elif defined(LIBMESH_HAVE_TRILINOS) // Use Trilinos if PETSc isn't there
230 #elif defined(LIBMESH_HAVE_LASPACK) // Use LASPACK if neither are there
232 #elif defined(LIBMESH_HAVE_EIGEN) // Use Eigen as a last resort
234 #else // No valid linear solver package at compile time
236 #endif
237 
238 
239 
240 // ------------------------------------------------------------
241 // libMesh functions
242 
244 {
246 }
247 
248 
249 
250 bool closed()
251 {
253 }
254 
255 
256 #ifdef LIBMESH_ENABLE_EXCEPTIONS
257 std::terminate_handler old_terminate_handler;
258 
260 {
261  // If this got called then we're probably crashing; let's print a
262  // stack trace. The trace files that are ultimately written depend on:
263  // 1.) Who throws the exception.
264  // 2.) Whether the C++ runtime unwinds the stack before the
265  // terminate_handler is called (this is implementation defined).
266  //
267  // The various cases are summarized in the table below:
268  //
269  // | libmesh exception | other exception
270  // -------------------------------------
271  // stack unwinds | A | B
272  // stack does not unwind | C | D
273  //
274  // Case A: There will be two stack traces in the file: one "useful"
275  // one, and one nearly empty one due to stack unwinding.
276  // Case B: You will get one nearly empty stack trace (not great, Bob!)
277  // Case C: You will get two nearly identical stack traces, ignore one of them.
278  // Case D: You will get one useful stack trace.
279  //
280  // Cases A and B (where the stack unwinds when an exception leaves
281  // main) appear to be non-existent in practice. I don't have a
282  // definitive list, but the stack does not unwind for GCC on either
283  // Mac or Linux. I think there's good reasons for this behavior too:
284  // it's much easier to get a stack trace when the stack doesn't
285  // unwind, for example.
287 
288  // If we have MPI and it has been initialized, we need to be sure
289  // and call MPI_Abort instead of std::abort, so that the parallel
290  // job can die nicely.
291 #if defined(LIBMESH_HAVE_MPI)
292  int mpi_initialized;
293  MPI_Initialized (&mpi_initialized);
294 
295  if (mpi_initialized)
296  MPI_Abort(libMesh::COMM_WORLD, 1);
297  else
298 #endif
299  // The system terminate_handler may do useful things like printing
300  // uncaught exception information, or the user may have created
301  // their own terminate handler that we want to call.
303 }
304 #endif
305 
306 
307 
308 #ifndef LIBMESH_HAVE_MPI
309 LibMeshInit::LibMeshInit (int argc, const char* const* argv)
310 #else
311 LibMeshInit::LibMeshInit (int argc, const char* const* argv,
312  MPI_Comm COMM_WORLD_IN)
313 #endif
314 {
315  // should _not_ be initialized already.
317 
318  // Build a command-line parser.
319  command_line.reset (new GetPot (argc, argv));
320 
321  // Disable performance logging upon request
322  {
323  if (libMesh::on_command_line ("--disable-perflog"))
325  }
326 
327  // Build a task scheduler
328  {
329  // Get the requested number of threads, defaults to 1 to avoid MPI and
330  // multithreading competition. If you would like to use MPI and multithreading
331  // at the same time then (n_mpi_processes_per_node)x(n_threads) should be the
332  // number of processing cores per node.
333  std::vector<std::string> n_threads(2);
334  n_threads[0] = "--n_threads";
335  n_threads[1] = "--n-threads";
338 
339  // Set the number of OpenMP threads to the same as the number of threads libMesh is going to use
340 #ifdef LIBMESH_HAVE_OPENMP
342 #endif
343 
345  }
346 
347  // Construct singletons who may be at risk of the
348  // "static initialization order fiasco"
350 
351  // Make sure the construction worked
353 
354 #if defined(LIBMESH_HAVE_MPI)
355 
356  // Allow the user to bypass MPI initialization
357  if (!libMesh::on_command_line ("--disable-mpi"))
358  {
359  // Check whether the calling program has already initialized
360  // MPI, and avoid duplicate Init/Finalize
361  int flag;
362  MPI_Initialized (&flag);
363 
364  if (!flag)
365  {
366  MPI_Init (&argc, const_cast<char***>(&argv));
368  }
369 
370  // Duplicate the input communicator for internal use
371  // And get a Parallel::Communicator copy too, to use
372  // as a default for that API
373  this->_comm = COMM_WORLD_IN;
374 
375  libMesh::COMM_WORLD = COMM_WORLD_IN;
376 
377 #ifndef LIBMESH_DISABLE_COMMWORLD
378  Parallel::Communicator_World = COMM_WORLD_IN;
379 #endif
380 
381  //MPI_Comm_set_name not supported in at least SGI MPT's MPI implementation
382  //MPI_Comm_set_name (libMesh::COMM_WORLD, "libMesh::COMM_WORLD");
383 
385  libmesh_cast_int<processor_id_type>(this->comm().rank());
387  libmesh_cast_int<processor_id_type>(this->comm().size());
388 
389  // Set up an MPI error handler if requested. This helps us get
390  // into a debugger with a proper stack when an MPI error occurs.
391  if (libMesh::on_command_line ("--handle-mpi-errors"))
392  {
393 #if MPI_VERSION > 1
394  MPI_Comm_create_errhandler(libMesh_MPI_Handler, &libmesh_errhandler);
395  MPI_Comm_set_errhandler(libMesh::COMM_WORLD, libmesh_errhandler);
396  MPI_Comm_set_errhandler(MPI_COMM_WORLD, libmesh_errhandler);
397 #else
398  MPI_Errhandler_create(libMesh_MPI_Handler, &libmesh_errhandler);
399  MPI_Errhandler_set(libMesh::COMM_WORLD, libmesh_errhandler);
400  MPI_Errhandler_set(MPI_COMM_WORLD, libmesh_errhandler);
401 #endif // #if MPI_VERSION > 1
402  }
403  }
404 
405  // Could we have gotten bad values from the above calls?
407 
408  // The libmesh_cast_int already tested _processor_id>=0
409  // libmesh_assert_greater_equal (libMeshPrivateData::_processor_id, 0);
410 
411  // Let's be sure we properly initialize on every processor at once:
412  libmesh_parallel_only(this->comm());
413 
414 #endif
415 
416 #if defined(LIBMESH_HAVE_PETSC)
417 
418  // Allow the user to bypass PETSc initialization
419  if (!libMesh::on_command_line ("--disable-petsc")
420 
421 #if defined(LIBMESH_HAVE_MPI)
422  // If the user bypassed MPI, we'd better be safe and assume that
423  // PETSc was built to require it; otherwise PETSc initialization
424  // dies.
425  && !libMesh::on_command_line ("--disable-mpi")
426 #endif
427  )
428  {
429  int ierr=0;
430 
431  PETSC_COMM_WORLD = libMesh::COMM_WORLD;
432 
433  // Check whether the calling program has already initialized
434  // PETSc, and avoid duplicate Initialize/Finalize
435  PetscBool petsc_already_initialized;
436  ierr = PetscInitialized(&petsc_already_initialized);
438  if (petsc_already_initialized != PETSC_TRUE)
440 # if defined(LIBMESH_HAVE_SLEPC)
441 
442  // If SLEPc allows us to check whether the calling program
443  // has already initialized it, we do that, and avoid
444  // duplicate Initialize/Finalize.
445  // We assume that SLEPc will handle PETSc appropriately,
446  // which it does in the versions we've checked.
447 # if !SLEPC_VERSION_LESS_THAN(2,3,3)
448  if (!SlepcInitializeCalled)
449 # endif
450  {
451  ierr = SlepcInitialize (&argc, const_cast<char***>(&argv), NULL, NULL);
454  }
455 # else
457  {
458  ierr = PetscInitialize (&argc, const_cast<char***>(&argv), NULL, NULL);
460  }
461 # endif
462  }
463 #endif
464 
465  // Re-parse the command-line arguments. Note that PETSc and MPI
466  // initialization above may have removed command line arguments
467  // that are not relevant to this application in the above calls.
468  // We don't want a false-positive by detecting those arguments.
469  command_line->parse_command_line (argc, argv);
470 
471  // The following line is an optimization when simultaneous
472  // C and C++ style access to output streams is not required.
473  // The amount of benefit which occurs is probably implementation
474  // defined, and may be nothing. On the other hand, I have seen
475  // some IO tests where IO peformance improves by a factor of two.
476  if (!libMesh::on_command_line ("--sync-with-stdio"))
477  std::ios::sync_with_stdio(false);
478 
479  // Honor the --separate-libmeshout command-line option.
480  // When this is specified, the library uses an independent ostream
481  // for libMesh::out/libMesh::err messages, and
482  // std::cout and std::cerr are untouched by any other options
483  if (libMesh::on_command_line ("--separate-libmeshout"))
484  {
485  // Redirect. We'll share streambufs with cout/cerr for now, but
486  // presumably anyone using this option will want to replace the
487  // bufs later.
488  std::ostream* newout = new std::ostream(std::cout.rdbuf());
489  libMesh::out = *newout;
490  std::ostream* newerr = new std::ostream(std::cerr.rdbuf());
491  libMesh::err = *newerr;
492  }
493 
494  // Honor the --redirect-stdout command-line option.
495  // When this is specified each processor sends
496  // libMesh::out/libMesh::err messages to
497  // stdout.processor.####
498  if (libMesh::on_command_line ("--redirect-stdout"))
499  {
500  std::ostringstream filename;
501  filename << "stdout.processor." << libMesh::processor_id();
502  _ofstream.reset (new std::ofstream (filename.str().c_str()));
503  // Redirect, saving the original streambufs!
504  out_buf = libMesh::out.rdbuf (_ofstream->rdbuf());
505  err_buf = libMesh::err.rdbuf (_ofstream->rdbuf());
506  }
507 
508  // redirect libMesh::out to nothing on all
509  // other processors unless explicitly told
510  // not to via the --keep-cout command-line argument.
512  if (!libMesh::on_command_line ("--keep-cout"))
513  libMesh::out.rdbuf (NULL);
514 
515  // Check command line to override printing
516  // of reference count information.
517  if(libMesh::on_command_line("--disable-refcount-printing") )
519 
520 #ifdef LIBMESH_ENABLE_EXCEPTIONS
521  // Set our terminate handler to write stack traces in the event of a
522  // crash
523  old_terminate_handler = std::set_terminate(libmesh_terminate_handler);
524 #endif
525 
526 
527  if (libMesh::on_command_line("--enable-fpe"))
528  libMesh::enableFPE(true);
529 
530  // The library is now ready for use
532 
533 
534  // Make sure these work. Library methods
535  // depend on these being implemented properly,
536  // so this is a good time to test them!
539 }
540 
541 
542 
544 {
545  // We can't delete, finalize, etc. more than once without
546  // reinitializing in between
548 
549  // Delete reference counted singleton(s)
551 
552  // Clear the thread task manager we started
553  task_scheduler.reset();
554 
555  // Let's be sure we properly close on every processor at once:
556  libmesh_parallel_only(this->comm());
557 
558 
559  // Force the \p ReferenceCounter to print
560  // its reference count information. This allows
561  // us to find memory leaks. By default the
562  // \p ReferenceCounter only prints its information
563  // when the last created object has been destroyed.
564  // That does no good if we are leaking memory!
566 
567 
568  // Print an informative message if we detect a memory leak
569  if (ReferenceCounter::n_objects() != 0)
570  {
571  libMesh::err << "Memory leak detected!"
572  << std::endl;
573 
574 #if !defined(LIBMESH_ENABLE_REFERENCE_COUNTING) || defined(NDEBUG)
575 
576  libMesh::err << "Compile in DEBUG mode with --enable-reference-counting"
577  << std::endl
578  << "for more information"
579  << std::endl;
580 #endif
581 
582  }
583 
584  // print the perflog to individual processor's file.
586 
587  // Now clear the logging object, we don't want it to print
588  // a second time during the PerfLog destructor.
590 
591  // Reconnect the output streams
592  // (don't do this, or we will get messages from objects
593  // that go out of scope after the following return)
594  //std::cout.rdbuf(std::cerr.rdbuf());
595 
596 
597  // Set the initialized() flag to false
599 
600  if (libMesh::on_command_line ("--redirect-stdout"))
601  {
602  // If stdout/stderr were redirected to files, reset them now.
605  }
606 
607  // If we built our own output streams, we want to clean them up.
608  if (libMesh::on_command_line ("--separate-libmeshout"))
609  {
610  delete libMesh::out.get();
611  delete libMesh::err.get();
612 
613  libMesh::out.reset(std::cout);
614  libMesh::err.reset(std::cerr);
615  }
616 
617 #ifdef LIBMESH_ENABLE_EXCEPTIONS
618  // Reset the old terminate handler; maybe the user code wants to
619  // keep doing C++ stuff after closing libMesh stuff.
620  std::set_terminate(old_terminate_handler);
621 #endif
622 
623 
624  if (libMesh::on_command_line("--enable-fpe"))
625  libMesh::enableFPE(false);
626 
627 #if defined(LIBMESH_HAVE_PETSC)
628  // Allow the user to bypass PETSc finalization
629  if (!libMesh::on_command_line ("--disable-petsc")
630 #if defined(LIBMESH_HAVE_MPI)
631  && !libMesh::on_command_line ("--disable-mpi")
632 #endif
633  )
634  {
635 # if defined(LIBMESH_HAVE_SLEPC)
637  SlepcFinalize();
638 # else
640  PetscFinalize();
641 # endif
642  }
643 #endif
644 
645 
646 #if defined(LIBMESH_HAVE_MPI)
647  // Allow the user to bypass MPI finalization
648  if (!libMesh::on_command_line ("--disable-mpi"))
649  {
650  this->_comm.clear();
651 #ifndef LIBMESH_DISABLE_COMMWORLD
653 #endif
654 
656  MPI_Finalize();
657  }
658 #endif
659 }
660 
661 
662 
666 void enableFPE(bool on)
667 {
668 #if !defined(LIBMESH_HAVE_FEENABLEEXCEPT) && defined(LIBMESH_HAVE_XMMINTRIN_H)
669  static int flags = 0;
670 #endif
671 
672  if (on)
673  {
674  struct sigaction new_action, old_action;
675 
676 #ifdef LIBMESH_HAVE_FEENABLEEXCEPT
677  feenableexcept(FE_DIVBYZERO | FE_INVALID);
678 #elif LIBMESH_HAVE_XMMINTRIN_H
679 # ifndef __SUNPRO_CC
680  flags = _MM_GET_EXCEPTION_MASK(); // store the flags
681  _MM_SET_EXCEPTION_MASK(flags & ~_MM_MASK_INVALID);
682 # endif
683 #endif
684 
685 
686  // Set up the structure to specify the new action.
687  new_action.sa_sigaction = libmesh_handleFPE;
688  sigemptyset (&new_action.sa_mask);
689  new_action.sa_flags = SA_SIGINFO;
690 
691  sigaction (SIGFPE, NULL, &old_action);
692  if (old_action.sa_handler != SIG_IGN)
693  sigaction (SIGFPE, &new_action, NULL);
694  }
695  else
696  {
697 #ifdef LIBMESH_HAVE_FEDISABLEEXCEPT
698  fedisableexcept(FE_DIVBYZERO | FE_INVALID);
699 #elif LIBMESH_HAVE_XMMINTRIN_H
700 # ifndef __SUNPRO_CC
701  _MM_SET_EXCEPTION_MASK(flags);
702 # endif
703 #endif
704  signal(SIGFPE, 0);
705  }
706 }
707 
708 
709 
710 bool on_command_line (const std::string& arg)
711 {
712  // Make sure the command line parser is ready for use
714 
715  return command_line->search (arg);
716 }
717 
718 
719 
720 template <typename T>
721 T command_line_value (const std::string &name, T value)
722 {
723  // Make sure the command line parser is ready for use
725 
726  // only if the variable exists in the file
727  if (command_line->have_variable(name.c_str()))
728  value = (*command_line)(name.c_str(), value);
729 
730  return value;
731 }
732 
733 template <typename T>
734 T command_line_value (const std::vector<std::string> &name, T value)
735 {
736  // Make sure the command line parser is ready for use
738 
739  // Check for multiple options (return the first that matches)
740  for (std::vector<std::string>::const_iterator i=name.begin(); i != name.end(); ++i)
741  if (command_line->have_variable(i->c_str()))
742  {
743  value = (*command_line)(i->c_str(), value);
744  break;
745  }
746 
747  return value;
748 }
749 
750 
751 
752 
753 template <typename T>
754 void command_line_vector (const std::string &name, std::vector<T>& vec)
755 {
756  // Make sure the command line parser is ready for use
758 
759  // only if the variable exists on the command line
760  if (command_line->have_variable(name.c_str()))
761  {
762  unsigned size = command_line->vector_variable_size(name.c_str());
763  vec.resize(size);
764 
765  for (unsigned i=0; i<size; ++i)
766  vec[i] = (*command_line)(name.c_str(), vec[i], i);
767  }
768 }
769 
770 
772 {
774 
775  static bool called = false;
776 
777  // Check the command line. Since the command line is
778  // unchanging it is sufficient to do this only once.
779  if (!called)
780  {
781  called = true;
782 
783 #ifdef LIBMESH_HAVE_PETSC
784  if (libMesh::on_command_line ("--use-petsc"))
786 #endif
787 
788 #ifdef LIBMESH_HAVE_TRILINOS
789  if (libMesh::on_command_line ("--use-trilinos") ||
790  libMesh::on_command_line ("--disable-petsc"))
792 #endif
793 
794 #ifdef LIBMESH_HAVE_EIGEN
795  if (libMesh::on_command_line ("--use-eigen" ) ||
796 #if defined(LIBMESH_HAVE_MPI)
797  // If the user bypassed MPI, we disable PETSc and Trilinos
798  // too
799  libMesh::on_command_line ("--disable-mpi") ||
800 #endif
801  libMesh::on_command_line ("--disable-petsc"))
803 #endif
804 
805 #ifdef LIBMESH_HAVE_LASPACK
806  if (libMesh::on_command_line ("--use-laspack" ) ||
807 #if defined(LIBMESH_HAVE_MPI)
808  // If the user bypassed MPI, we disable PETSc and Trilinos
809  // too
810  libMesh::on_command_line ("--disable-mpi") ||
811 #endif
812  libMesh::on_command_line ("--disable-petsc"))
814 #endif
815 
816  if (libMesh::on_command_line ("--disable-laspack") &&
817  libMesh::on_command_line ("--disable-trilinos") &&
818  libMesh::on_command_line ("--disable-eigen") &&
819  (
820 #if defined(LIBMESH_HAVE_MPI)
821  // If the user bypassed MPI, we disable PETSc too
822  libMesh::on_command_line ("--disable-mpi") ||
823 #endif
824  libMesh::on_command_line ("--disable-petsc")))
826  }
827 
828 
830 }
831 
832 
833 
834 //-------------------------------------------------------------------------------
835 template int command_line_value<int> (const std::string&, int);
836 template float command_line_value<float> (const std::string&, float);
837 template double command_line_value<double> (const std::string&, double);
838 template long double command_line_value<long double> (const std::string&, long double);
839 template std::string command_line_value<std::string> (const std::string&, std::string);
840 
841 template void command_line_vector<int> (const std::string&, std::vector<int>&);
842 template void command_line_vector<float> (const std::string&, std::vector<float>&);
843 template void command_line_vector<double> (const std::string&, std::vector<double>&);
844 template void command_line_vector<long double> (const std::string&, std::vector<long double>&);
845 
846 } // namespace libMesh

Site Created By: libMesh Developers
Last modified: February 07 2014 16:57:05 UTC

Hosted By:
SourceForge.net Logo