339 command_line.reset (
new GetPot (argc, argv));
360 #if !LIBMESH_USING_THREADS 364 libmesh_warning(
"Warning: You requested --n-threads>1 but no threading model is active!\n" 365 <<
"Forcing --n-threads==1 instead!");
370 #ifdef LIBMESH_HAVE_OPENMP 384 #if defined(LIBMESH_HAVE_MPI) 392 libmesh_call_mpi(MPI_Initialized (&flag));
396 int mpi_thread_provided;
398 MPI_THREAD_FUNNELED :
402 (MPI_Init_thread (&argc, const_cast<char ***>(&argv),
403 mpi_thread_requested, &mpi_thread_provided));
406 (mpi_thread_provided < MPI_THREAD_FUNNELED))
408 libmesh_warning(
"Warning: MPI failed to guarantee MPI_THREAD_FUNNELED\n" 409 <<
"for a threaded run.\n" 410 <<
"Be sure your library is funneled-thread-safe..." 426 libmesh_initialized_mpi =
true;
432 this->
_comm = COMM_WORLD_IN;
440 cast_int<processor_id_type>(this->
comm().
rank());
442 cast_int<processor_id_type>(this->
comm().
size());
464 libmesh_parallel_only(this->
comm());
468 #if defined(LIBMESH_HAVE_PETSC) 473 #
if defined(LIBMESH_HAVE_MPI)
488 ierr = PetscInitialized(&petsc_already_initialized);
490 if (petsc_already_initialized != PETSC_TRUE)
491 libmesh_initialized_petsc =
true;
492 # if defined(LIBMESH_HAVE_SLEPC) 499 if (!SlepcInitializeCalled)
501 ierr = SlepcInitialize (&argc, const_cast<char ***>(&argv),
nullptr,
nullptr);
503 libmesh_initialized_slepc =
true;
506 if (libmesh_initialized_petsc)
508 ierr = PetscInitialize (&argc, const_cast<char ***>(&argv),
nullptr,
nullptr);
512 #if !PETSC_RELEASE_LESS_THAN(3,3,0) 514 #if PETSC_RELEASE_LESS_THAN(3,4,0) 524 #if defined(LIBMESH_HAVE_MPI) && defined(LIBMESH_HAVE_VTK) 540 command_line.reset (
new GetPot (argc, argv));
548 std::ios::sync_with_stdio(
false);
559 std::ostream * newout =
new std::ostream(std::cout.rdbuf());
561 std::ostream * newerr =
new std::ostream(std::cerr.rdbuf());
572 if (cmdline_has_redirect_stdout)
573 libmesh_warning(
"The --redirect-stdout command line option has been deprecated. " 574 "Use '--redirect-output basename' instead.");
580 if (cmdline_has_redirect_stdout || cmdline_has_redirect_output)
582 std::string basename =
"stdout";
585 if (cmdline_has_redirect_output)
588 command_line->search(1,
"--redirect-output");
591 std::string next_string =
"";
592 next_string = command_line->next(next_string);
597 if (next_string.size() > 0 && next_string.find_first_of(
"-") != 0)
598 basename = next_string;
601 std::ostringstream filename;
603 _ofstream.reset (
new std::ofstream (filename.str().c_str()));
630 #ifdef LIBMESH_ENABLE_EXCEPTIONS 676 task_scheduler.reset();
693 #if !defined(LIBMESH_ENABLE_REFERENCE_COUNTING) || defined(NDEBUG) 695 libMesh::err <<
"Compile in DEBUG mode with --enable-reference-counting" 697 <<
"for more information" 737 #ifdef LIBMESH_ENABLE_EXCEPTIONS 747 #if defined(LIBMESH_HAVE_PETSC) 750 #
if defined(LIBMESH_HAVE_MPI)
755 # if defined(LIBMESH_HAVE_SLEPC) 756 if (libmesh_initialized_slepc)
759 if (libmesh_initialized_petsc)
765 #if defined(LIBMESH_HAVE_MPI) && defined(LIBMESH_HAVE_VTK) 770 #if defined(LIBMESH_HAVE_MPI) 776 if (libmesh_initialized_mpi)
780 unsigned int error_code = MPI_Finalize();
781 if (error_code != MPI_SUCCESS)
783 char error_string[MPI_MAX_ERROR_STRING+1];
784 int error_string_len;
785 MPI_Error_string(error_code, error_string,
787 std::cerr <<
"Failure from MPI_Finalize():\n" 788 << error_string << std::endl;
static unsigned int n_objects()
processor_id_type size() const
processor_id_type _n_processors
Parallel::Communicator _comm
MPI_Comm GLOBAL_COMM_WORLD
void reset(streamT &target)
vtkMPIController * _vtk_mpi_controller
PerfLog perflog("libMesh", #ifdef LIBMESH_ENABLE_PERFORMANCE_LOGGING true #else false #endif)
const Parallel::Communicator & comm() const
PetscErrorCode DMCreate_libMesh(DM dm)
tbb::task_scheduler_init task_scheduler_init
processor_id_type rank() const
std::terminate_handler old_terminate_handler
processor_id_type _processor_id
OStreamProxy err(std::cerr)
static void print_info(std::ostream &out=libMesh::out)
streambufT * rdbuf() const
MPI_Errhandler libmesh_errhandler
processor_id_type global_processor_id()
void libMesh_MPI_Handler(MPI_Comm *, int *,...)
bool on_command_line(std::string arg)
T command_line_value(const std::string &name, T value)
static void disable_print_counter_info()
OStreamProxy out(std::cout)
void libmesh_terminate_handler()
const RemoteElem * remote_elem