From 8dba08575daf64e7163d1eaa459aa540368b745b Mon Sep 17 00:00:00 2001 From: bangerth Date: Mon, 26 Sep 2011 12:52:19 +0000 Subject: [PATCH] Move a first batch of MPI-related functions from Utilities::System to Utilities::MPI. git-svn-id: https://svn.dealii.org/trunk@24418 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/doc/news/changes.h | 11 + deal.II/examples/step-17/step-17.cc | 4 +- deal.II/examples/step-18/step-18.cc | 4 +- deal.II/examples/step-32/step-32.cc | 36 ++- deal.II/examples/step-40/step-40.cc | 8 +- deal.II/include/deal.II/base/timer.h | 2 +- deal.II/include/deal.II/base/utilities.h | 170 ++++++---- deal.II/source/base/utilities.cc | 306 ++++++++++-------- deal.II/source/distributed/grid_refinement.cc | 8 +- deal.II/source/distributed/tria.cc | 10 +- deal.II/source/dofs/dof_handler_policy.cc | 2 +- deal.II/source/dofs/dof_renumbering.cc | 4 +- deal.II/source/lac/sparse_direct.cc | 4 +- deal.II/source/lac/sparsity_tools.cc | 6 +- .../count_dofs_per_block_01.cc | 4 +- .../count_dofs_per_component_01.cc | 4 +- .../dof_handler_number_cache.cc | 2 +- tests/mpi/collective_01.cc | 6 +- tests/mpi/collective_02.cc | 6 +- tests/mpi/compute_mean_value.cc | 4 +- tests/mpi/constraint_matrix_trilinos_bug.cc | 4 +- tests/mpi/count_dofs_per_block_01.cc | 4 +- tests/mpi/count_dofs_per_block_02.cc | 4 +- tests/mpi/count_dofs_per_component_01.cc | 4 +- tests/mpi/crash_01.cc | 4 +- tests/mpi/crash_02.cc | 2 +- tests/mpi/crash_03.cc | 2 +- tests/mpi/crash_04.cc | 4 +- tests/mpi/distribute_sp_01.cc | 6 +- tests/mpi/dof_handler_number_cache.cc | 4 +- tests/mpi/extract_constant_modes_01.cc | 8 +- tests/mpi/extract_locally_active_dofs.cc | 4 +- tests/mpi/ghost_01.cc | 10 +- tests/mpi/integrate_difference.cc | 4 +- tests/mpi/interpolate_01.cc | 4 +- tests/mpi/interpolate_02.cc | 4 +- tests/mpi/is_locally_owned.cc | 8 +- tests/mpi/no_flux_constraints.cc | 6 +- tests/mpi/no_flux_constraints_02.cc | 6 +- tests/mpi/no_flux_constraints_03.cc | 6 +- tests/mpi/p4est_2d_coarse_01.cc | 6 +- tests/mpi/p4est_2d_constraintmatrix_01.cc | 12 +- tests/mpi/p4est_2d_constraintmatrix_02.cc | 6 +- tests/mpi/p4est_2d_constraintmatrix_03.cc | 8 +- tests/mpi/p4est_2d_constraintmatrix_04.cc | 6 +- tests/mpi/p4est_2d_constraintmatrix_05.cc | 8 +- tests/mpi/p4est_2d_dofhandler_01.cc | 6 +- tests/mpi/p4est_2d_dofhandler_02.cc | 8 +- tests/mpi/p4est_2d_dofhandler_03.cc | 8 +- tests/mpi/p4est_2d_dofhandler_04.cc | 8 +- tests/mpi/p4est_2d_dofhandler_05.cc | 4 +- tests/mpi/p4est_2d_ghost_01.cc | 8 +- tests/mpi/p4est_2d_ghost_02.cc | 10 +- tests/mpi/p4est_2d_refine_01.cc | 10 +- tests/mpi/p4est_2d_refine_02.cc | 8 +- tests/mpi/p4est_2d_refine_03.cc | 12 +- tests/mpi/p4est_2d_renumber_01.cc | 8 +- tests/mpi/p4est_2d_renumber_02.cc | 18 +- tests/mpi/p4est_2d_simple.cc | 12 +- tests/mpi/p4est_3d_constraintmatrix_01.cc | 12 +- tests/mpi/p4est_3d_constraintmatrix_02.cc | 8 +- tests/mpi/p4est_3d_constraintmatrix_03.cc | 6 +- tests/mpi/p4est_3d_constraintmatrix_04.cc | 10 +- tests/mpi/p4est_3d_ghost_01.cc | 6 +- tests/mpi/p4est_3d_refine_01.cc | 12 +- tests/mpi/p4est_3d_refine_02.cc | 6 +- tests/mpi/p4est_3d_refine_03.cc | 6 +- tests/mpi/p4est_3d_refine_04.cc | 6 +- tests/mpi/p4est_data_out_01.cc | 6 +- tests/mpi/p4est_get_subdomain_association.cc | 6 +- tests/mpi/p4est_max_refine.cc | 10 +- tests/mpi/petsc_01.cc | 6 +- tests/mpi/petsc_02.cc | 6 +- tests/mpi/point_to_point_pattern_01.cc | 12 +- .../refine_and_coarsen_fixed_fraction_01.cc | 10 +- .../refine_and_coarsen_fixed_fraction_02.cc | 10 +- .../refine_and_coarsen_fixed_fraction_03.cc | 6 +- .../refine_and_coarsen_fixed_fraction_04.cc | 4 +- .../refine_and_coarsen_fixed_fraction_05.cc | 4 +- .../refine_and_coarsen_fixed_fraction_06.cc | 4 +- .../mpi/refine_and_coarsen_fixed_number_01.cc | 10 +- .../mpi/refine_and_coarsen_fixed_number_02.cc | 10 +- .../mpi/refine_and_coarsen_fixed_number_03.cc | 6 +- .../mpi/refine_and_coarsen_fixed_number_04.cc | 4 +- .../mpi/refine_and_coarsen_fixed_number_05.cc | 4 +- .../mpi/refine_and_coarsen_fixed_number_06.cc | 6 +- tests/mpi/renumber_z_order_01.cc | 4 +- tests/mpi/renumber_z_order_02.cc | 4 +- tests/mpi/simple_mpi_01.cc | 6 +- tests/mpi/solution_transfer_01.cc | 4 +- tests/mpi/trilinos_compress_bug.cc | 8 +- tests/mpi/trilinos_ghost_01.cc | 12 +- tests/mpi/trilinos_ghost_02.cc | 10 +- tests/mpi/trilinos_ghost_03.cc | 8 +- tests/mpi/trilinos_ghost_03_linfty.cc | 10 +- tests/mpi/trilinos_ghost_04.cc | 6 +- tests/mpi/trilinos_ghost_05.cc | 6 +- tests/mpi/trilinos_sparse_matrix_mmult_01.cc | 6 +- tests/mpi/trilinos_sparse_matrix_print_01.cc | 8 +- tests/mpi/trilinos_vector_reinit.cc | 8 +- 100 files changed, 614 insertions(+), 547 deletions(-) diff --git a/deal.II/doc/news/changes.h b/deal.II/doc/news/changes.h index 9abc392900..0708b484bb 100644 --- a/deal.II/doc/news/changes.h +++ b/deal.II/doc/news/changes.h @@ -103,6 +103,17 @@ changed to use std_cxx1x::_1, std_cxx1x::_2, etc from now on.

General

    +
  1. New: There is now a namespace Utilities::MPI that holds some of the MPI-related +functions that were previously part of Utilities::System. Specifically, the following +functions were moved and in part renamed: Utilities::System::get_n_mpi_processes +is now Utilities::MPI::n_mpi_processes; Utilities::System::get_this_mpi_process +is now Utilities::MPI::this_mpi_process; Utilities::System::compute_point_to_point_communication_pattern +is now Utilities::MPI::compute_point_to_point_communication_pattern; +Utilities::System::duplicate_communicator +is now Utilities::MPI::duplicate_communicator. +
    +(Wolfgang Bangerth, 2011/09/26) +
  2. New: When using a new enough version of GCC, debug sections in object files are now compressed using the -Wa,--compress-debug-sections flag, resulting in savings in disk space on the order of 230 MB. diff --git a/deal.II/examples/step-17/step-17.cc b/deal.II/examples/step-17/step-17.cc index 191a0134d5..7ac66c2a26 100644 --- a/deal.II/examples/step-17/step-17.cc +++ b/deal.II/examples/step-17/step-17.cc @@ -314,8 +314,8 @@ namespace Step17 dof_handler (triangulation), fe (FE_Q(1), dim), mpi_communicator (MPI_COMM_WORLD), - n_mpi_processes (Utilities::System::get_n_mpi_processes(mpi_communicator)), - this_mpi_process (Utilities::System::get_this_mpi_process(mpi_communicator)) + n_mpi_processes (Utilities::MPI::n_mpi_processes(mpi_communicator)), + this_mpi_process (Utilities::MPI::this_mpi_process(mpi_communicator)) { pcout.set_condition(this_mpi_process == 0); } diff --git a/deal.II/examples/step-18/step-18.cc b/deal.II/examples/step-18/step-18.cc index bc60888313..e9972f40d7 100644 --- a/deal.II/examples/step-18/step-18.cc +++ b/deal.II/examples/step-18/step-18.cc @@ -1032,8 +1032,8 @@ namespace Step18 dof_handler (triangulation), quadrature_formula (2), mpi_communicator (MPI_COMM_WORLD), - n_mpi_processes (Utilities::System::get_n_mpi_processes(mpi_communicator)), - this_mpi_process (Utilities::System::get_this_mpi_process(mpi_communicator)), + n_mpi_processes (Utilities::MPI::n_mpi_processes(mpi_communicator)), + this_mpi_process (Utilities::MPI::this_mpi_process(mpi_communicator)), pcout (std::cout, this_mpi_process == 0) {} diff --git a/deal.II/examples/step-32/step-32.cc b/deal.II/examples/step-32/step-32.cc index b0056dbae1..6cba888b1a 100644 --- a/deal.II/examples/step-32/step-32.cc +++ b/deal.II/examples/step-32/step-32.cc @@ -297,6 +297,7 @@ namespace Step32 void solve_S(TrilinosWrappers::MPI::Vector &dst, const TrilinosWrappers::MPI::Vector &src) const { +//TODO: shouldn't this be a *relative* tolerance SolverControl cn(5000, 1e-5); TrilinosWrappers::SolverCG solver(cn); @@ -1360,7 +1361,7 @@ namespace Step32 endc = stokes_dof_handler.end(); for (; cell!=endc; ++cell) if (cell->subdomain_id() == - Utilities::System::get_this_mpi_process(MPI_COMM_WORLD)) + Utilities::MPI::this_mpi_process(MPI_COMM_WORLD)) { fe_values.reinit (cell); fe_values[velocities].get_function_values (stokes_solution, @@ -1407,7 +1408,7 @@ namespace Step32 endc = stokes_dof_handler.end(); for (; cell!=endc; ++cell) if (cell->subdomain_id() == - Utilities::System::get_this_mpi_process(MPI_COMM_WORLD)) + Utilities::MPI::this_mpi_process(MPI_COMM_WORLD)) { fe_values.reinit (cell); fe_values[velocities].get_function_values (stokes_solution, @@ -1463,7 +1464,7 @@ namespace Step32 endc = temperature_dof_handler.end(); for (; cell!=endc; ++cell) if (cell->subdomain_id() == - Utilities::System::get_this_mpi_process(MPI_COMM_WORLD)) + Utilities::MPI::this_mpi_process(MPI_COMM_WORLD)) { fe_values.reinit (cell); fe_values.get_function_values (old_temperature_solution, @@ -1553,7 +1554,7 @@ namespace Step32 endc = temperature_dof_handler.end(); for (; cell!=endc; ++cell) if (cell->subdomain_id() == - Utilities::System::get_this_mpi_process(MPI_COMM_WORLD)) + Utilities::MPI::this_mpi_process(MPI_COMM_WORLD)) { fe_values.reinit (cell); fe_values.get_function_values (old_temperature_solution, @@ -1581,7 +1582,7 @@ namespace Step32 endc = temperature_dof_handler.end(); for (; cell!=endc; ++cell) if (cell->subdomain_id() == - Utilities::System::get_this_mpi_process(MPI_COMM_WORLD)) + Utilities::MPI::this_mpi_process(MPI_COMM_WORLD)) { fe_values.reinit (cell); fe_values.get_function_values (old_temperature_solution, @@ -1817,7 +1818,7 @@ namespace Step32 for (; cell!=endc; ++cell) if (cell->subdomain_id() == - Utilities::System::get_this_mpi_process(MPI_COMM_WORLD)) + Utilities::MPI::this_mpi_process(MPI_COMM_WORLD)) { cell->get_dof_indices (local_dof_indices); fe_values.reinit (cell); @@ -2186,7 +2187,7 @@ namespace Step32 IndexSet stokes_relevant_set; { const unsigned int my_id = - Utilities::System::get_this_mpi_process(MPI_COMM_WORLD); + Utilities::MPI::this_mpi_process(MPI_COMM_WORLD); IndexSet stokes_index_set = stokes_dof_handler.locally_owned_dofs(); stokes_partitioning.push_back(stokes_index_set.get_view(0,n_u)); stokes_partitioning.push_back(stokes_index_set.get_view(n_u,n_u+n_p)); @@ -2436,16 +2437,17 @@ namespace Step32 const QGauss quadrature_formula(parameters.stokes_velocity_degree+1); +//todo: define a new filter for locally owned cells typedef FilteredIterator::active_cell_iterator> SubdomainFilter; WorkStream:: run (SubdomainFilter (IteratorFilters::SubdomainEqualTo - (Utilities::System::get_this_mpi_process(MPI_COMM_WORLD)), + (Utilities::MPI::this_mpi_process(MPI_COMM_WORLD)), stokes_dof_handler.begin_active()), SubdomainFilter (IteratorFilters::SubdomainEqualTo - (Utilities::System::get_this_mpi_process(MPI_COMM_WORLD)), + (Utilities::MPI::this_mpi_process(MPI_COMM_WORLD)), stokes_dof_handler.end()), std_cxx1x::bind (&BoussinesqFlowProblem:: local_assemble_stokes_preconditioner, @@ -2649,10 +2651,10 @@ namespace Step32 WorkStream:: run (SubdomainFilter (IteratorFilters::SubdomainEqualTo - (Utilities::System::get_this_mpi_process(MPI_COMM_WORLD)), + (Utilities::MPI::this_mpi_process(MPI_COMM_WORLD)), stokes_dof_handler.begin_active()), SubdomainFilter (IteratorFilters::SubdomainEqualTo - (Utilities::System::get_this_mpi_process(MPI_COMM_WORLD)), + (Utilities::MPI::this_mpi_process(MPI_COMM_WORLD)), stokes_dof_handler.end()), std_cxx1x::bind (&BoussinesqFlowProblem:: local_assemble_stokes_system, @@ -2776,10 +2778,10 @@ namespace Step32 WorkStream:: run (SubdomainFilter (IteratorFilters::SubdomainEqualTo - (Utilities::System::get_this_mpi_process(MPI_COMM_WORLD)), + (Utilities::MPI::this_mpi_process(MPI_COMM_WORLD)), temperature_dof_handler.begin_active()), SubdomainFilter (IteratorFilters::SubdomainEqualTo - (Utilities::System::get_this_mpi_process(MPI_COMM_WORLD)), + (Utilities::MPI::this_mpi_process(MPI_COMM_WORLD)), temperature_dof_handler.end()), std_cxx1x::bind (&BoussinesqFlowProblem:: local_assemble_temperature_matrix, @@ -3073,10 +3075,10 @@ namespace Step32 WorkStream:: run (SubdomainFilter (IteratorFilters::SubdomainEqualTo - (Utilities::System::get_this_mpi_process(MPI_COMM_WORLD)), + (Utilities::MPI::this_mpi_process(MPI_COMM_WORLD)), temperature_dof_handler.begin_active()), SubdomainFilter (IteratorFilters::SubdomainEqualTo - (Utilities::System::get_this_mpi_process(MPI_COMM_WORLD)), + (Utilities::MPI::this_mpi_process(MPI_COMM_WORLD)), temperature_dof_handler.end()), std_cxx1x::bind (&BoussinesqFlowProblem:: local_assemble_temperature_rhs, @@ -3615,10 +3617,10 @@ namespace Step32 std::ofstream output (filename.c_str()); data_out.write_vtu (output); - if (Utilities::System::get_this_mpi_process(MPI_COMM_WORLD) == 0) + if (Utilities::MPI::this_mpi_process(MPI_COMM_WORLD) == 0) { std::vector filenames; - for (unsigned int i=0; i filenames; for (unsigned int i=0; - i T sum (const T &t, const MPI_Comm &mpi_communicator); + + /** + * Return the number of MPI processes + * there exist in the given communicator + * object. If this is a sequential job, + * it returns 1. + */ + unsigned int n_mpi_processes (const MPI_Comm &mpi_communicator); + + /** + * Return the number of the present MPI + * process in the space of processes + * described by the given + * communicator. This will be a unique + * value for each process between zero + * and (less than) the number of all + * processes (given by + * get_n_mpi_processes()). + */ + unsigned int this_mpi_process (const MPI_Comm &mpi_communicator); + + /** + * Consider an unstructured + * communication pattern where + * every process in an MPI + * universe wants to send some + * data to a subset of the other + * processors. To do that, the + * other processors need to know + * who to expect messages + * from. This function computes + * this information. + * + * @param mpi_comm A communicator + * that describes the processors + * that are going to communicate + * with each other. + * + * @param destinations The list + * of processors the current + * process wants to send + * information to. This list need + * not be sorted in any way. If + * it contains duplicate entries + * that means that multiple + * messages are intended for a + * given destination. + * + * @return A list of processors + * that have indicated that they + * want to send something to the + * current processor. The + * resulting list is not + * sorted. It may contain + * duplicate entries if + * processors enter the same + * destination more than once in + * their destinations list. + */ + std::vector + compute_point_to_point_communication_pattern (const MPI_Comm & mpi_comm, + const std::vector & destinations); + + /** + * Given a communicator, generate a new + * communicator that contains the same + * set of processors but that has a + * different, unique identifier. + * + * This functionality can be used to + * ensure that different objects, such as + * distributed matrices, each have unique + * communicators over which they can + * interact without interfering with each + * other. + * + * When no longer needed, the + * communicator created here needs to + * be destroyed using + * MPI_Comm_free. + */ + MPI_Comm duplicate_communicator (const MPI_Comm &mpi_communicator); } /** * A namespace for utility functions that @@ -384,89 +466,39 @@ namespace Utilities bool job_supports_mpi (); /** - * Return the number of MPI processes - * there exist in the given communicator - * object. If this is a sequential job, - * it returns 1. + * This function is an alias for + * Utilities::MPI::n_mpi_processes. + * + * @deprecated */ unsigned int get_n_mpi_processes (const MPI_Comm &mpi_communicator); /** - * Return the number of the present MPI - * process in the space of processes - * described by the given - * communicator. This will be a unique - * value for each process between zero - * and (less than) the number of all - * processes (given by - * get_n_mpi_processes()). + * This function is an alias for + * Utilities::MPI::this_mpi_process. + * + * @deprecated */ unsigned int get_this_mpi_process (const MPI_Comm &mpi_communicator); /** - * Consider an unstructured - * communication pattern where - * every process in an MPI - * universe wants to send some - * data to a subset of the other - * processors. To do that, the - * other processors need to know - * who to expect messages - * from. This function computes - * this information. - * - * @param mpi_comm A communicator - * that describes the processors - * that are going to communicate - * with each other. - * - * @param destinations The list - * of processors the current - * process wants to send - * information to. This list need - * not be sorted in any way. If - * it contains duplicate entries - * that means that multiple - * messages are intended for a - * given destination. - * - * @return A list of processors - * that have indicated that they - * want to send something to the - * current processor. The - * resulting list is not - * sorted. It may contain - * duplicate entries if - * processors enter the same - * destination more than once in - * their destinations list. + * This function is an alias for + * Utilities::MPI::compute_point_to_point_communication_pattern. + * + * @deprecated */ - std::vector - compute_point_to_point_communication_pattern (const MPI_Comm & mpi_comm, - const std::vector & destinations); - + using + Utilities::MPI::compute_point_to_point_communication_pattern; /** - * Given a communicator, generate a new - * communicator that contains the same - * set of processors but that has a - * different, unique identifier. - * - * This functionality can be used to - * ensure that different objects, such as - * distributed matrices, each have unique - * communicators over which they can - * interact without interfering with each - * other. - * - * When no longer needed, the - * communicator created here needs to - * be destroyed using - * MPI_Comm_free. + * This function is an alias for + * Utilities::MPI::duplicate_communicator. + * + * @deprecated */ - MPI_Comm duplicate_communicator (const MPI_Comm &mpi_communicator); + using Utilities::MPI::duplicate_communicator; /** * Data structure to store the result of diff --git a/deal.II/source/base/utilities.cc b/deal.II/source/base/utilities.cc index d4984d80ac..e8432c1f6f 100644 --- a/deal.II/source/base/utilities.cc +++ b/deal.II/source/base/utilities.cc @@ -438,6 +438,157 @@ namespace Utilities } + namespace MPI + { +#ifdef DEAL_II_COMPILER_SUPPORTS_MPI + // Unfortunately, we have to work + // around an oddity in the way PETSc + // and some gcc versions interact. If + // we use PETSc's MPI dummy + // implementation, it expands the + // calls to the two MPI functions + // basically as ``(n_jobs=1, 0)'', + // i.e. it assigns the number one to + // the variable holding the number of + // jobs, and then uses the comma + // operator to let the entire + // expression have the value zero. The + // latter is important, since + // ``MPI_Comm_size'' returns an error + // code that we may want to check (we + // don't here, but one could in + // principle), and the trick with the + // comma operator makes sure that both + // the number of jobs is correctly + // assigned, and the return value is + // zero. Unfortunately, if some recent + // versions of gcc detect that the + // comma expression just stands by + // itself, i.e. the result is not + // assigned to another variable, then + // they warn ``right-hand operand of + // comma has no effect''. This + // unwanted side effect can be + // suppressed by casting the result of + // the entire expression to type + // ``void'' -- not beautiful, but + // helps calming down unwarranted + // compiler warnings... + unsigned int n_mpi_processes (const MPI_Comm &mpi_communicator) + { + int n_jobs=1; + (void) MPI_Comm_size (mpi_communicator, &n_jobs); + + return n_jobs; + } + + + unsigned int this_mpi_process (const MPI_Comm &mpi_communicator) + { + int rank=0; + (void) MPI_Comm_rank (mpi_communicator, &rank); + + return rank; + } + + + MPI_Comm duplicate_communicator (const MPI_Comm &mpi_communicator) + { + MPI_Comm new_communicator; + MPI_Comm_dup (mpi_communicator, &new_communicator); + return new_communicator; + } + + + std::vector + compute_point_to_point_communication_pattern (const MPI_Comm & mpi_comm, + const std::vector & destinations) + { + unsigned int myid = Utilities::MPI::this_mpi_process(mpi_comm); + unsigned int n_procs = Utilities::MPI::n_mpi_processes(mpi_comm); + + for (unsigned int i=0; i my_destinations(max_n_destinations, + numbers::invalid_unsigned_int); + std::copy (destinations.begin(), destinations.end(), + my_destinations.begin()); + + // now exchange these (we could + // communicate less data if we + // used MPI_Allgatherv, but + // we'd have to communicate + // my_n_destinations to all + // processors in this case, + // which is more expensive than + // the reduction operation + // above in MPI_Allreduce) + std::vector all_destinations (max_n_destinations * n_procs); + MPI_Allgather (&my_destinations[0], max_n_destinations, MPI_UNSIGNED, + &all_destinations[0], max_n_destinations, MPI_UNSIGNED, + mpi_comm); + + // now we know who is going to + // communicate with + // whom. collect who is going + // to communicate with us! + std::vector origins; + for (unsigned int i=0; i 0); } - // Unfortunately, we have to work - // around an oddity in the way PETSc - // and some gcc versions interact. If - // we use PETSc's MPI dummy - // implementation, it expands the - // calls to the two MPI functions - // basically as ``(n_jobs=1, 0)'', - // i.e. it assigns the number one to - // the variable holding the number of - // jobs, and then uses the comma - // operator to let the entire - // expression have the value zero. The - // latter is important, since - // ``MPI_Comm_size'' returns an error - // code that we may want to check (we - // don't here, but one could in - // principle), and the trick with the - // comma operator makes sure that both - // the number of jobs is correctly - // assigned, and the return value is - // zero. Unfortunately, if some recent - // versions of gcc detect that the - // comma expression just stands by - // itself, i.e. the result is not - // assigned to another variable, then - // they warn ``right-hand operand of - // comma has no effect''. This - // unwanted side effect can be - // suppressed by casting the result of - // the entire expression to type - // ``void'' -- not beautiful, but - // helps calming down unwarranted - // compiler warnings... - unsigned int get_n_mpi_processes (const MPI_Comm &mpi_communicator) - { - int n_jobs=1; - (void) MPI_Comm_size (mpi_communicator, &n_jobs); - - return n_jobs; - } - - - unsigned int get_this_mpi_process (const MPI_Comm &mpi_communicator) - { - int rank=0; - (void) MPI_Comm_rank (mpi_communicator, &rank); - - return rank; - } - - - MPI_Comm duplicate_communicator (const MPI_Comm &mpi_communicator) - { - MPI_Comm new_communicator; - MPI_Comm_dup (mpi_communicator, &new_communicator); - return new_communicator; - } - namespace { @@ -640,9 +733,9 @@ namespace Utilities MinMaxAvg & result) { const unsigned int my_id - = dealii::Utilities::System::get_this_mpi_process(mpi_communicator); + = dealii::Utilities::MPI::this_mpi_process(mpi_communicator); const unsigned int numproc - = dealii::Utilities::System::get_n_mpi_processes(mpi_communicator); + = dealii::Utilities::MPI::n_mpi_processes(mpi_communicator); MPI_Op op; int ierr = MPI_Op_create((MPI_User_function *)&max_reduce, true, &op); @@ -674,73 +767,6 @@ namespace Utilities } - std::vector - compute_point_to_point_communication_pattern (const MPI_Comm & mpi_comm, - const std::vector & destinations) - { - unsigned int myid = Utilities::System::get_this_mpi_process(mpi_comm); - unsigned int n_procs = Utilities::System::get_n_mpi_processes(mpi_comm); - - for (unsigned int i=0; i my_destinations(max_n_destinations, - numbers::invalid_unsigned_int); - std::copy (destinations.begin(), destinations.end(), - my_destinations.begin()); - - // now exchange these (we could - // communicate less data if we - // used MPI_Allgatherv, but - // we'd have to communicate - // my_n_destinations to all - // processors in this case, - // which is more expensive than - // the reduction operation - // above in MPI_Allreduce) - std::vector all_destinations (max_n_destinations * n_procs); - MPI_Allgather (&my_destinations[0], max_n_destinations, MPI_UNSIGNED, - &all_destinations[0], max_n_destinations, MPI_UNSIGNED, - mpi_comm); - - // now we know who is going to - // communicate with - // whom. collect who is going - // to communicate with us! - std::vector origins; - for (unsigned int i=0; i (smooth_grid, false), - mpi_communicator (Utilities::System:: + mpi_communicator (Utilities::MPI:: duplicate_communicator(mpi_communicator)), - my_subdomain (Utilities::System::get_this_mpi_process (this->mpi_communicator)), + my_subdomain (Utilities::MPI::this_mpi_process (this->mpi_communicator)), triangulation_has_content (false), connectivity (0), parallel_forest (0), @@ -1819,7 +1819,7 @@ namespace parallel dealii::internal::p4est::InitFinalize::do_initialize (); number_cache.n_locally_owned_active_cells - .resize (Utilities::System::get_n_mpi_processes (mpi_communicator)); + .resize (Utilities::MPI::n_mpi_processes (mpi_communicator)); } @@ -2474,7 +2474,7 @@ namespace parallel { const unsigned int total_local_cells = this->n_active_cells(); - if (Utilities::System::get_n_mpi_processes (mpi_communicator) == 1) + if (Utilities::MPI::n_mpi_processes (mpi_communicator) == 1) Assert (static_cast(parallel_forest->local_num_quadrants) == total_local_cells, ExcInternalError()) @@ -2655,7 +2655,7 @@ namespace parallel { Assert (number_cache.n_locally_owned_active_cells.size() == - Utilities::System::get_n_mpi_processes (mpi_communicator), + Utilities::MPI::n_mpi_processes (mpi_communicator), ExcInternalError()); std::fill (number_cache.n_locally_owned_active_cells.begin(), diff --git a/deal.II/source/dofs/dof_handler_policy.cc b/deal.II/source/dofs/dof_handler_policy.cc index 2473219c1c..ed5c2ea32a 100644 --- a/deal.II/source/dofs/dof_handler_policy.cc +++ b/deal.II/source/dofs/dof_handler_policy.cc @@ -1068,7 +1068,7 @@ namespace internal Assert (tr != 0, ExcInternalError()); const unsigned int - n_cpus = Utilities::System::get_n_mpi_processes (tr->get_communicator()); + n_cpus = Utilities::MPI::n_mpi_processes (tr->get_communicator()); //* 1. distribute on own //* subdomain diff --git a/deal.II/source/dofs/dof_renumbering.cc b/deal.II/source/dofs/dof_renumbering.cc index 45cbff5082..2fdac32cbc 100644 --- a/deal.II/source/dofs/dof_renumbering.cc +++ b/deal.II/source/dofs/dof_renumbering.cc @@ -833,7 +833,7 @@ namespace DoFRenumbering // gather information from all CPUs std::vector all_dof_counts(fe_collection.n_components() * - Utilities::System::get_n_mpi_processes (tria->get_communicator())); + Utilities::MPI::n_mpi_processes (tria->get_communicator())); MPI_Allgather ( &local_dof_count[0], n_buckets, MPI_UNSIGNED, &all_dof_counts[0], n_buckets, MPI_UNSIGNED, tria->get_communicator()); @@ -851,7 +851,7 @@ namespace DoFRenumbering shifts[c]=cumulated; for (types::subdomain_id_t i=0; ilocally_owned_subdomain(); ++i) shifts[c] += all_dof_counts[c+n_buckets*i]; - for (unsigned int i=0; iget_communicator()); ++i) + for (unsigned int i=0; iget_communicator()); ++i) cumulated += all_dof_counts[c+n_buckets*i]; } #else diff --git a/deal.II/source/lac/sparse_direct.cc b/deal.II/source/lac/sparse_direct.cc index b003870bf4..c01cb5d900 100644 --- a/deal.II/source/lac/sparse_direct.cc +++ b/deal.II/source/lac/sparse_direct.cc @@ -1934,7 +1934,7 @@ void SparseDirectMUMPS::initialize (const Matrix& matrix, dmumps_c (&id); // Hand over matrix and right-hand side - if (Utilities::System::get_this_mpi_process (MPI_COMM_WORLD) == 0) + if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0) { // Objects denoting a MUMPS data structure: @@ -2007,7 +2007,7 @@ void SparseDirectMUMPS::solve (Vector& vector) dmumps_c (&id); // Copy solution into the given vector - if (Utilities::System::get_this_mpi_process (MPI_COMM_WORLD) == 0) + if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0) { for (unsigned int i=0; i start_index(rows_per_cpu.size()+1); start_index[0]=0; for (unsigned int i=0;ifirst); num_receive = - Utilities::System:: + Utilities::MPI:: compute_point_to_point_communication_pattern(mpi_comm, send_to).size(); } diff --git a/tests/distributed_grids/count_dofs_per_block_01.cc b/tests/distributed_grids/count_dofs_per_block_01.cc index a3f1a1f632..c71b90b63d 100644 --- a/tests/distributed_grids/count_dofs_per_block_01.cc +++ b/tests/distributed_grids/count_dofs_per_block_01.cc @@ -91,7 +91,7 @@ void test() == dof_handler.n_dofs(), ExcInternalError()); - unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); if (myid == 0) { deallog << "Total number of dofs: " << dof_handler.n_dofs() << std::endl; @@ -112,7 +112,7 @@ int main(int argc, char *argv[]) (void)argv; #endif - unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); if (myid == 0) { std::ofstream logfile("count_dofs_per_block_01/output"); diff --git a/tests/distributed_grids/count_dofs_per_component_01.cc b/tests/distributed_grids/count_dofs_per_component_01.cc index c72c365d9e..cc1ee60b5c 100644 --- a/tests/distributed_grids/count_dofs_per_component_01.cc +++ b/tests/distributed_grids/count_dofs_per_component_01.cc @@ -58,7 +58,7 @@ void test() == dof_handler.n_dofs(), ExcInternalError()); - unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); if (myid == 0) { deallog << "Total number of dofs: " << dof_handler.n_dofs() << std::endl; @@ -78,7 +78,7 @@ int main(int argc, char *argv[]) (void)argv; #endif - unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); if (myid == 0) { std::ofstream logfile("count_dofs_per_component_01/output"); diff --git a/tests/distributed_grids/dof_handler_number_cache.cc b/tests/distributed_grids/dof_handler_number_cache.cc index 48ba5ea3e6..7ac6578cd2 100644 --- a/tests/distributed_grids/dof_handler_number_cache.cc +++ b/tests/distributed_grids/dof_handler_number_cache.cc @@ -114,7 +114,7 @@ int main(int argc, char *argv[]) (void)argv; #endif - unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); if (myid == 0) { std::ofstream logfile("dof_handler_number_cache/output"); diff --git a/tests/mpi/collective_01.cc b/tests/mpi/collective_01.cc index 3ae3b349e2..e6b9de327f 100644 --- a/tests/mpi/collective_01.cc +++ b/tests/mpi/collective_01.cc @@ -32,8 +32,8 @@ void test() { Assert( Utilities::System::job_supports_mpi(), ExcInternalError()); - unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); - const unsigned int numprocs = Utilities::System::get_n_mpi_processes (MPI_COMM_WORLD); + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); + const unsigned int numprocs = Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD); if (myid==0) deallog << "Running on " << numprocs << " CPU(s)." << std::endl; @@ -91,7 +91,7 @@ int main(int argc, char *argv[]) #endif - if (Utilities::System::get_this_mpi_process (MPI_COMM_WORLD) == 0) + if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0) { std::ofstream logfile(output_file_for_mpi("collective_01").c_str()); deallog.attach(logfile); diff --git a/tests/mpi/collective_02.cc b/tests/mpi/collective_02.cc index a0e97f1983..b37b0c37d1 100644 --- a/tests/mpi/collective_02.cc +++ b/tests/mpi/collective_02.cc @@ -21,8 +21,8 @@ void test() { - unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); - const unsigned int numprocs = Utilities::System::get_n_mpi_processes (MPI_COMM_WORLD); + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); + const unsigned int numprocs = Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD); int int_sum, uint_sum, double_sum, float_sum; int_sum @@ -58,7 +58,7 @@ int main(int argc, char *argv[]) #endif - if (Utilities::System::get_this_mpi_process (MPI_COMM_WORLD) == 0) + if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0) { std::ofstream logfile(output_file_for_mpi("collective_02").c_str()); deallog.attach(logfile); diff --git a/tests/mpi/compute_mean_value.cc b/tests/mpi/compute_mean_value.cc index abd9893b01..108f4d2e4a 100644 --- a/tests/mpi/compute_mean_value.cc +++ b/tests/mpi/compute_mean_value.cc @@ -78,7 +78,7 @@ void test() const double mean = VectorTools::compute_mean_value (dofh, QGauss(2), x_rel, 0); - if (Utilities::System::get_this_mpi_process (MPI_COMM_WORLD) == 0) + if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0) deallog << "mean=" << mean << std::endl; @@ -95,7 +95,7 @@ int main(int argc, char *argv[]) (void)argv; #endif - unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); deallog.push(Utilities::int_to_string(myid)); diff --git a/tests/mpi/constraint_matrix_trilinos_bug.cc b/tests/mpi/constraint_matrix_trilinos_bug.cc index e398dbbad0..6a4761b0c9 100644 --- a/tests/mpi/constraint_matrix_trilinos_bug.cc +++ b/tests/mpi/constraint_matrix_trilinos_bug.cc @@ -94,7 +94,7 @@ class FilteredDataOut : public DataOut template void test() { - unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); parallel::distributed::Triangulation tr(MPI_COMM_WORLD); @@ -195,7 +195,7 @@ int main(int argc, char *argv[]) (void)argv; #endif - unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); deallog.push(Utilities::int_to_string(myid)); diff --git a/tests/mpi/count_dofs_per_block_01.cc b/tests/mpi/count_dofs_per_block_01.cc index 81e6bb8366..28379afdf1 100644 --- a/tests/mpi/count_dofs_per_block_01.cc +++ b/tests/mpi/count_dofs_per_block_01.cc @@ -54,7 +54,7 @@ void test() std::vector dofs_per_block (fe.n_blocks()); DoFTools::count_dofs_per_block (dof_handler, dofs_per_block); - if (Utilities::System::get_this_mpi_process (MPI_COMM_WORLD) == 0) + if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0) for (unsigned int i=0; i void test() { - unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); parallel::distributed::Triangulation tr(MPI_COMM_WORLD); std::vector sub(2); - sub[0] = Utilities::System::get_n_mpi_processes (MPI_COMM_WORLD); + sub[0] = Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD); sub[1] = 1; GridGenerator::subdivided_hyper_rectangle(static_cast&>(tr), sub, Point<2>(0,0), Point<2>(1,1)); @@ -54,7 +54,7 @@ void test() DoFHandler dofh(tr); dofh.distribute_dofs (fe); - if (Utilities::System::get_this_mpi_process (MPI_COMM_WORLD) == 0) + if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0) deallog << "Total dofs=" << dofh.n_dofs() << std::endl; // extract constant modes and print @@ -105,7 +105,7 @@ int main(int argc, char *argv[]) (void)argv; #endif - unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); deallog.push(Utilities::int_to_string(myid)); diff --git a/tests/mpi/extract_locally_active_dofs.cc b/tests/mpi/extract_locally_active_dofs.cc index e971ae8bb8..5671733592 100644 --- a/tests/mpi/extract_locally_active_dofs.cc +++ b/tests/mpi/extract_locally_active_dofs.cc @@ -60,7 +60,7 @@ void test() // tr.locally_owned_subdomain()), // ExcInternalError()); - if (Utilities::System::get_this_mpi_process (MPI_COMM_WORLD) == 0) + if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0) { deallog << locally_active.size() << ' ' << locally_active.n_elements() << std::endl; @@ -82,7 +82,7 @@ int main(int argc, char *argv[]) (void)argv; #endif - unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); deallog.push(Utilities::int_to_string(myid)); diff --git a/tests/mpi/ghost_01.cc b/tests/mpi/ghost_01.cc index a506aa75c8..637ae4755e 100644 --- a/tests/mpi/ghost_01.cc +++ b/tests/mpi/ghost_01.cc @@ -25,8 +25,8 @@ void test () { - unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); - unsigned int numproc = Utilities::System::get_n_mpi_processes (MPI_COMM_WORLD); + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); + unsigned int numproc = Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD); if (myid==0) deallog << "numproc=" << numproc << std::endl; @@ -52,7 +52,7 @@ void test () // check local values - if (Utilities::System::get_this_mpi_process (MPI_COMM_WORLD) == 0) + if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0) { deallog << myid*2 << ":" << v(myid*2) << std::endl; deallog << myid*2+1 << ":" << v(myid*2+1) << std::endl; @@ -63,7 +63,7 @@ void test () // check ghost values - if (Utilities::System::get_this_mpi_process (MPI_COMM_WORLD) == 0) + if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0) deallog << "ghost: " << v(1) << std::endl; Assert(v(1) == 2.0, ExcInternalError()); @@ -77,7 +77,7 @@ void test () int main (int argc, char **argv) { PetscInitialize(&argc,&argv,0,0); - unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); deallog.push(Utilities::int_to_string(myid)); diff --git a/tests/mpi/integrate_difference.cc b/tests/mpi/integrate_difference.cc index 5d0fd5ce73..4cc19def80 100644 --- a/tests/mpi/integrate_difference.cc +++ b/tests/mpi/integrate_difference.cc @@ -91,7 +91,7 @@ void test() MPI_SUM, tr.get_communicator()); - if (Utilities::System::get_this_mpi_process (MPI_COMM_WORLD) == 0) + if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0) deallog << "difference = " << std::sqrt(global) << std::endl; @@ -116,7 +116,7 @@ int main(int argc, char *argv[]) (void)argv; #endif - unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); deallog.push(Utilities::int_to_string(myid)); diff --git a/tests/mpi/interpolate_01.cc b/tests/mpi/interpolate_01.cc index 31f5e35e16..a32030d19e 100644 --- a/tests/mpi/interpolate_01.cc +++ b/tests/mpi/interpolate_01.cc @@ -49,7 +49,7 @@ template void test() { - unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); // create a mesh so that all but one // processor are empty @@ -86,7 +86,7 @@ int main(int argc, char *argv[]) compile_time_error; #endif - unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); deallog.push(Utilities::int_to_string(myid)); diff --git a/tests/mpi/interpolate_02.cc b/tests/mpi/interpolate_02.cc index 78719f7540..ebf565159a 100644 --- a/tests/mpi/interpolate_02.cc +++ b/tests/mpi/interpolate_02.cc @@ -50,7 +50,7 @@ template void test() { - unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); // create a mesh so that all but one // processor are empty @@ -80,7 +80,7 @@ int main(int argc, char *argv[]) { PetscInitialize(&argc,&argv,0,0); - unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); deallog.push(Utilities::int_to_string(myid)); if (myid == 0) diff --git a/tests/mpi/is_locally_owned.cc b/tests/mpi/is_locally_owned.cc index d48d7bc973..bb9983b384 100644 --- a/tests/mpi/is_locally_owned.cc +++ b/tests/mpi/is_locally_owned.cc @@ -33,10 +33,10 @@ template void test() { - unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); - unsigned int numprocs = Utilities::System::get_n_mpi_processes (MPI_COMM_WORLD); + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); + unsigned int numprocs = Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD); - if (Utilities::System::get_this_mpi_process (MPI_COMM_WORLD) == 0) + if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0) deallog << "hyper_cube" << std::endl; parallel::distributed::Triangulation tr(MPI_COMM_WORLD); @@ -88,7 +88,7 @@ int main(int argc, char *argv[]) (void)argv; #endif - unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); deallog.push(Utilities::int_to_string(myid)); diff --git a/tests/mpi/no_flux_constraints.cc b/tests/mpi/no_flux_constraints.cc index f66155fb7f..03779140cb 100644 --- a/tests/mpi/no_flux_constraints.cc +++ b/tests/mpi/no_flux_constraints.cc @@ -40,8 +40,8 @@ template void test() { Assert (dim == 3, ExcNotImplemented()); - unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); - unsigned int numprocs = Utilities::System::get_n_mpi_processes (MPI_COMM_WORLD); + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); + unsigned int numprocs = Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD); parallel::distributed::Triangulation triangulation(MPI_COMM_WORLD); @@ -168,7 +168,7 @@ int main(int argc, char *argv[]) { { Utilities::System::MPI_InitFinalize mpi_init (argc, argv); - unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); deallog.push(Utilities::int_to_string(myid)); diff --git a/tests/mpi/no_flux_constraints_02.cc b/tests/mpi/no_flux_constraints_02.cc index 5001a20aeb..4547a6569f 100644 --- a/tests/mpi/no_flux_constraints_02.cc +++ b/tests/mpi/no_flux_constraints_02.cc @@ -43,8 +43,8 @@ template void test() { Assert (dim == 3, ExcNotImplemented()); - unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); - unsigned int numprocs = Utilities::System::get_n_mpi_processes (MPI_COMM_WORLD); + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); + unsigned int numprocs = Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD); parallel::distributed::Triangulation triangulation(MPI_COMM_WORLD); @@ -203,7 +203,7 @@ int main(int argc, char *argv[]) { { Utilities::System::MPI_InitFinalize mpi_init (argc, argv); - unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); deallog.push(Utilities::int_to_string(myid)); diff --git a/tests/mpi/no_flux_constraints_03.cc b/tests/mpi/no_flux_constraints_03.cc index 55e04eb3de..c7aadf82b9 100644 --- a/tests/mpi/no_flux_constraints_03.cc +++ b/tests/mpi/no_flux_constraints_03.cc @@ -41,8 +41,8 @@ template void test() { Assert (dim == 3, ExcNotImplemented()); - unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); - unsigned int numprocs = Utilities::System::get_n_mpi_processes (MPI_COMM_WORLD); + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); + unsigned int numprocs = Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD); parallel::distributed::Triangulation triangulation(MPI_COMM_WORLD); @@ -174,7 +174,7 @@ int main(int argc, char *argv[]) { { Utilities::System::MPI_InitFinalize mpi_init (argc, argv); - unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); deallog.push(Utilities::int_to_string(myid)); diff --git a/tests/mpi/p4est_2d_coarse_01.cc b/tests/mpi/p4est_2d_coarse_01.cc index fecedb8136..b58a3c424e 100644 --- a/tests/mpi/p4est_2d_coarse_01.cc +++ b/tests/mpi/p4est_2d_coarse_01.cc @@ -34,7 +34,7 @@ template void test() { - unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); if (true) { @@ -78,7 +78,7 @@ void test() } - if (Utilities::System::get_this_mpi_process (MPI_COMM_WORLD) == 0) + if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0) deallog << "OK" << std::endl; } @@ -92,7 +92,7 @@ int main(int argc, char *argv[]) (void)argv; #endif - unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); deallog.push(Utilities::int_to_string(myid)); diff --git a/tests/mpi/p4est_2d_constraintmatrix_01.cc b/tests/mpi/p4est_2d_constraintmatrix_01.cc index fe7136dd72..9b072569aa 100644 --- a/tests/mpi/p4est_2d_constraintmatrix_01.cc +++ b/tests/mpi/p4est_2d_constraintmatrix_01.cc @@ -39,10 +39,10 @@ template void test() { - unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); - unsigned int numproc = Utilities::System::get_n_mpi_processes (MPI_COMM_WORLD); + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); + unsigned int numproc = Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD); - if (Utilities::System::get_this_mpi_process (MPI_COMM_WORLD) == 0) + if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0) deallog << "hyper_cube" << std::endl; parallel::distributed::Triangulation tr(MPI_COMM_WORLD); @@ -66,7 +66,7 @@ void test() DoFTools::make_hanging_node_constraints (dofh, cm2); { - std::ofstream file((std::string("p4est_2d_constraintmatrix_01/ncpu_") + Utilities::int_to_string(Utilities::System::get_n_mpi_processes (MPI_COMM_WORLD)) + "/dat." + Utilities::int_to_string(myid)).c_str()); + std::ofstream file((std::string("p4est_2d_constraintmatrix_01/ncpu_") + Utilities::int_to_string(Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD)) + "/dat." + Utilities::int_to_string(myid)).c_str()); file << "**** proc " << myid << std::endl; cm.print(file); file << "****" << std::endl; @@ -82,7 +82,7 @@ void test() { for (unsigned int i=0;i void test() { - unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); parallel::distributed::Triangulation tr(MPI_COMM_WORLD); @@ -47,7 +47,7 @@ void test() for (int i=0;i<12;++i) { - if (Utilities::System::get_this_mpi_process (MPI_COMM_WORLD) == 0) + if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0) deallog << "step " << i << std::endl; @@ -98,7 +98,7 @@ int main(int argc, char *argv[]) (void)argv; #endif - unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); deallog.push(Utilities::int_to_string(myid)); diff --git a/tests/mpi/p4est_2d_constraintmatrix_03.cc b/tests/mpi/p4est_2d_constraintmatrix_03.cc index 04dc8d9238..c4cbc6e2a5 100644 --- a/tests/mpi/p4est_2d_constraintmatrix_03.cc +++ b/tests/mpi/p4est_2d_constraintmatrix_03.cc @@ -93,7 +93,7 @@ class FilteredDataOut : public DataOut template void test() { - unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); parallel::distributed::Triangulation tr(MPI_COMM_WORLD); @@ -205,7 +205,7 @@ void test() if (myid==0) { - std::ofstream file((std::string("p4est_2d_constraintmatrix_03/ncpu_") + Utilities::int_to_string(Utilities::System::get_n_mpi_processes (MPI_COMM_WORLD)) + "/dat." + Utilities::int_to_string(myid)).c_str()); + std::ofstream file((std::string("p4est_2d_constraintmatrix_03/ncpu_") + Utilities::int_to_string(Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD)) + "/dat." + Utilities::int_to_string(myid)).c_str()); file << "**** proc " << myid << std::endl; x_dub.print(file); } @@ -214,7 +214,7 @@ void test() if (myid==0) { - cat_file((std::string("p4est_2d_constraintmatrix_03/ncpu_") + Utilities::int_to_string(Utilities::System::get_n_mpi_processes (MPI_COMM_WORLD)) + "/dat." + Utilities::int_to_string(0)).c_str()); + cat_file((std::string("p4est_2d_constraintmatrix_03/ncpu_") + Utilities::int_to_string(Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD)) + "/dat." + Utilities::int_to_string(0)).c_str()); } tr.set_boundary (0); @@ -231,7 +231,7 @@ int main(int argc, char *argv[]) (void)argv; #endif - unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); deallog.push(Utilities::int_to_string(myid)); diff --git a/tests/mpi/p4est_2d_constraintmatrix_04.cc b/tests/mpi/p4est_2d_constraintmatrix_04.cc index b2d022d761..c3c8ad97bf 100644 --- a/tests/mpi/p4est_2d_constraintmatrix_04.cc +++ b/tests/mpi/p4est_2d_constraintmatrix_04.cc @@ -297,7 +297,7 @@ void test() x_ref -= x; double err = x_ref.linfty_norm(); if (err>1.0e-12) - if (Utilities::System::get_this_mpi_process (MPI_COMM_WORLD) == 0) + if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0) deallog << "err:" << err << std::endl; // x_rel=x_ref; //uncomment to output error @@ -319,7 +319,7 @@ void test() tr.set_boundary (0); tr.set_boundary (1); - if (Utilities::System::get_this_mpi_process (MPI_COMM_WORLD) == 0) + if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0) deallog << "OK" << std::endl; } @@ -333,7 +333,7 @@ int main(int argc, char *argv[]) (void)argv; #endif - unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); deallog.push(Utilities::int_to_string(myid)); diff --git a/tests/mpi/p4est_2d_constraintmatrix_05.cc b/tests/mpi/p4est_2d_constraintmatrix_05.cc index 3f13136452..ea08617f98 100644 --- a/tests/mpi/p4est_2d_constraintmatrix_05.cc +++ b/tests/mpi/p4est_2d_constraintmatrix_05.cc @@ -73,7 +73,7 @@ void test() x1 -= x_ref; double err = x1.linfty_norm(); if (err>1.0e-12) - if (Utilities::System::get_this_mpi_process (MPI_COMM_WORLD) == 0) + if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0) deallog << "err:" << err << std::endl; // now test the same thing with a fresh vector @@ -85,10 +85,10 @@ void test() x2 -= x_ref; err = x2.linfty_norm(); if (err>1.0e-12) - if (Utilities::System::get_this_mpi_process (MPI_COMM_WORLD) == 0) + if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0) deallog << "err:" << err << std::endl; - if (Utilities::System::get_this_mpi_process (MPI_COMM_WORLD) == 0) + if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0) deallog << "OK" << std::endl; } @@ -102,7 +102,7 @@ int main(int argc, char *argv[]) (void)argv; #endif - unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); deallog.push(Utilities::int_to_string(myid)); diff --git a/tests/mpi/p4est_2d_dofhandler_01.cc b/tests/mpi/p4est_2d_dofhandler_01.cc index 8e5df855b1..d7ba97de59 100644 --- a/tests/mpi/p4est_2d_dofhandler_01.cc +++ b/tests/mpi/p4est_2d_dofhandler_01.cc @@ -37,9 +37,9 @@ template void test() { - unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); - if (Utilities::System::get_this_mpi_process (MPI_COMM_WORLD) == 0) + if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0) deallog << "hyper_cube" << std::endl; parallel::distributed::Triangulation tr(MPI_COMM_WORLD); @@ -89,7 +89,7 @@ int main(int argc, char *argv[]) (void)argv; #endif - unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); deallog.push(Utilities::int_to_string(myid)); diff --git a/tests/mpi/p4est_2d_dofhandler_02.cc b/tests/mpi/p4est_2d_dofhandler_02.cc index 09cc81bf62..842de09e93 100644 --- a/tests/mpi/p4est_2d_dofhandler_02.cc +++ b/tests/mpi/p4est_2d_dofhandler_02.cc @@ -37,9 +37,9 @@ template void test() { - unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); - if (Utilities::System::get_this_mpi_process (MPI_COMM_WORLD) == 0) + if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0) deallog << "hyper_cube" << std::endl; parallel::distributed::Triangulation tr(MPI_COMM_WORLD); @@ -74,7 +74,7 @@ void test() } tr.execute_coarsening_and_refinement (); - if (Utilities::System::get_this_mpi_process (MPI_COMM_WORLD) == 0) + if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0) deallog << "#local cells:" << tr.n_locally_owned_active_cells() << std::endl; DoFHandler dofh(tr); @@ -102,7 +102,7 @@ int main(int argc, char *argv[]) (void)argv; #endif - unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); deallog.push(Utilities::int_to_string(myid)); diff --git a/tests/mpi/p4est_2d_dofhandler_03.cc b/tests/mpi/p4est_2d_dofhandler_03.cc index 5735bcbab4..e0899ca4c1 100644 --- a/tests/mpi/p4est_2d_dofhandler_03.cc +++ b/tests/mpi/p4est_2d_dofhandler_03.cc @@ -38,9 +38,9 @@ template void test() { - unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); - if (Utilities::System::get_this_mpi_process (MPI_COMM_WORLD) == 0) + if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0) deallog << "hyper_cube" << std::endl; parallel::distributed::Triangulation tr(MPI_COMM_WORLD); @@ -75,7 +75,7 @@ void test() } tr.execute_coarsening_and_refinement (); - if (Utilities::System::get_this_mpi_process (MPI_COMM_WORLD) == 0) + if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0) deallog << "#local cells:" << tr.n_locally_owned_active_cells() << std::endl; DoFHandler dofh(tr); @@ -121,7 +121,7 @@ int main(int argc, char *argv[]) (void)argv; #endif - unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); deallog.push(Utilities::int_to_string(myid)); diff --git a/tests/mpi/p4est_2d_dofhandler_04.cc b/tests/mpi/p4est_2d_dofhandler_04.cc index dbf32369a7..6b128e26be 100644 --- a/tests/mpi/p4est_2d_dofhandler_04.cc +++ b/tests/mpi/p4est_2d_dofhandler_04.cc @@ -38,9 +38,9 @@ template void test() { - unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); - if (Utilities::System::get_this_mpi_process (MPI_COMM_WORLD) == 0) + if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0) deallog << "hyper_cube" << std::endl; parallel::distributed::Triangulation tr(MPI_COMM_WORLD); @@ -75,7 +75,7 @@ void test() } tr.execute_coarsening_and_refinement (); - if (Utilities::System::get_this_mpi_process (MPI_COMM_WORLD) == 0) + if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0) deallog << "#local cells:" << tr.n_locally_owned_active_cells() << std::endl; DoFHandler dofh(tr); @@ -130,7 +130,7 @@ int main(int argc, char *argv[]) (void)argv; #endif - unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); deallog.push(Utilities::int_to_string(myid)); diff --git a/tests/mpi/p4est_2d_dofhandler_05.cc b/tests/mpi/p4est_2d_dofhandler_05.cc index e5a7f966a4..b5caac414c 100644 --- a/tests/mpi/p4est_2d_dofhandler_05.cc +++ b/tests/mpi/p4est_2d_dofhandler_05.cc @@ -55,7 +55,7 @@ void test() dofh.distribute_dofs (fe); } - if (Utilities::System::get_this_mpi_process (MPI_COMM_WORLD) == 0) + if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0) deallog << "OK" << std::endl; } @@ -69,7 +69,7 @@ int main(int argc, char *argv[]) (void)argv; #endif - unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); deallog.push(Utilities::int_to_string(myid)); diff --git a/tests/mpi/p4est_2d_ghost_01.cc b/tests/mpi/p4est_2d_ghost_01.cc index 55c5dc139a..543a80d78d 100644 --- a/tests/mpi/p4est_2d_ghost_01.cc +++ b/tests/mpi/p4est_2d_ghost_01.cc @@ -33,12 +33,12 @@ template void test() { - unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); - unsigned int numprocs = Utilities::System::get_n_mpi_processes (MPI_COMM_WORLD); + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); + unsigned int numprocs = Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD); if (true) { - if (Utilities::System::get_this_mpi_process (MPI_COMM_WORLD) == 0) + if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0) deallog << "hyper_cube" << std::endl; parallel::distributed::Triangulation tr(MPI_COMM_WORLD); @@ -116,7 +116,7 @@ int main(int argc, char *argv[]) (void)argv; #endif - unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); deallog.push(Utilities::int_to_string(myid)); diff --git a/tests/mpi/p4est_2d_ghost_02.cc b/tests/mpi/p4est_2d_ghost_02.cc index a016a43acf..b3e601f9f7 100644 --- a/tests/mpi/p4est_2d_ghost_02.cc +++ b/tests/mpi/p4est_2d_ghost_02.cc @@ -33,11 +33,11 @@ template void test() { - unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); if (true) { - if (Utilities::System::get_this_mpi_process (MPI_COMM_WORLD) == 0) + if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0) deallog << "hyper_cube" << std::endl; parallel::distributed::Triangulation tr(MPI_COMM_WORLD); @@ -46,7 +46,7 @@ void test() for (int i=0;i<5;++i) { - if (Utilities::System::get_this_mpi_process (MPI_COMM_WORLD) == 0) + if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0) deallog << "refine loop:" << i << std::endl; tr.refine_global(1); @@ -103,7 +103,7 @@ void test() } } - if (Utilities::System::get_this_mpi_process (MPI_COMM_WORLD) == 0) + if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0) deallog << "OK" << std::endl; } @@ -117,7 +117,7 @@ int main(int argc, char *argv[]) (void)argv; #endif - unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); std::cout << myid << ":" << getpid() << std::endl; //system("sleep 20"); diff --git a/tests/mpi/p4est_2d_refine_01.cc b/tests/mpi/p4est_2d_refine_01.cc index e39ac25705..bcc6961ca7 100644 --- a/tests/mpi/p4est_2d_refine_01.cc +++ b/tests/mpi/p4est_2d_refine_01.cc @@ -33,11 +33,11 @@ template void test() { - unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); if (true) { - if (Utilities::System::get_this_mpi_process (MPI_COMM_WORLD) == 0) + if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0) deallog << "hyper_cube" << std::endl; parallel::distributed::Triangulation tr(MPI_COMM_WORLD); @@ -49,7 +49,7 @@ void test() cell_subd.resize(tr.n_active_cells()); GridTools::get_subdomain_association(tr, cell_subd); - if (Utilities::System::get_this_mpi_process (MPI_COMM_WORLD) == 0) + if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0) { for (unsigned int i=0;i void test() { - unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); if (true) { - if (Utilities::System::get_this_mpi_process (MPI_COMM_WORLD) == 0) + if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0) deallog << "hyper_cube" << std::endl; parallel::distributed::Triangulation tr(MPI_COMM_WORLD); @@ -59,7 +59,7 @@ void test() } - if (Utilities::System::get_this_mpi_process (MPI_COMM_WORLD) == 0) + if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0) deallog << "OK" << std::endl; } @@ -73,7 +73,7 @@ int main(int argc, char *argv[]) (void)argv; #endif - unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); deallog.push(Utilities::int_to_string(myid)); diff --git a/tests/mpi/p4est_2d_refine_03.cc b/tests/mpi/p4est_2d_refine_03.cc index bc759fa9be..2a232f525f 100644 --- a/tests/mpi/p4est_2d_refine_03.cc +++ b/tests/mpi/p4est_2d_refine_03.cc @@ -32,11 +32,11 @@ template void test() { - unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); if (true) { - if (Utilities::System::get_this_mpi_process (MPI_COMM_WORLD) == 0) + if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0) deallog << "hyper_cube" << std::endl; parallel::distributed::Triangulation tr(MPI_COMM_WORLD); @@ -44,9 +44,9 @@ void test() GridGenerator::hyper_cube(tr); tr.refine_global(1); - while (tr.n_global_active_cells() < 20000/Utilities::System::get_n_mpi_processes(MPI_COMM_WORLD)) + while (tr.n_global_active_cells() < 20000/Utilities::MPI::n_mpi_processes(MPI_COMM_WORLD)) { - if (Utilities::System::get_this_mpi_process (MPI_COMM_WORLD) == 0) + if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0) deallog << "refine_loop..." << std::endl; std::vector flags (tr.n_active_cells(), false); @@ -79,7 +79,7 @@ void test() } } - if (Utilities::System::get_this_mpi_process (MPI_COMM_WORLD) == 0) + if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0) deallog << "OK" << std::endl; } @@ -93,7 +93,7 @@ int main(int argc, char *argv[]) (void)argv; #endif - unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); deallog.push(Utilities::int_to_string(myid)); diff --git a/tests/mpi/p4est_2d_renumber_01.cc b/tests/mpi/p4est_2d_renumber_01.cc index 66b6faacd7..c106b4ccc7 100644 --- a/tests/mpi/p4est_2d_renumber_01.cc +++ b/tests/mpi/p4est_2d_renumber_01.cc @@ -41,7 +41,7 @@ template void test() { - unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); parallel::distributed::Triangulation tr(MPI_COMM_WORLD); GridGenerator::hyper_cube(tr); @@ -85,7 +85,7 @@ void test() typename DoFHandler::active_cell_iterator cell, endc = dofh.end(); - if (Utilities::System::get_this_mpi_process (MPI_COMM_WORLD) == 0) + if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0) for (cell = dofh.begin_active(); cell != endc; ++cell) if (!cell->is_artificial() && !cell->is_ghost()) { @@ -107,7 +107,7 @@ void test() } - if (Utilities::System::get_this_mpi_process (MPI_COMM_WORLD) == 0) + if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0) deallog << "OK" << std::endl; } @@ -121,7 +121,7 @@ int main(int argc, char *argv[]) (void)argv; #endif - unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); deallog.push(Utilities::int_to_string(myid)); diff --git a/tests/mpi/p4est_2d_renumber_02.cc b/tests/mpi/p4est_2d_renumber_02.cc index 0c8c5634e8..b6c07eae1b 100644 --- a/tests/mpi/p4est_2d_renumber_02.cc +++ b/tests/mpi/p4est_2d_renumber_02.cc @@ -44,11 +44,11 @@ template void test() { - unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); parallel::distributed::Triangulation tr(MPI_COMM_WORLD); std::vector sub(2); - sub[0] = Utilities::System::get_n_mpi_processes (MPI_COMM_WORLD); + sub[0] = Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD); sub[1] = 1; GridGenerator::subdivided_hyper_rectangle(static_cast&>(tr), sub, Point<2>(0,0), Point<2>(1,1)); @@ -58,17 +58,17 @@ void test() DoFHandler dofh(tr); dofh.distribute_dofs (fe); - if (Utilities::System::get_this_mpi_process (MPI_COMM_WORLD) == 0) + if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0) deallog << "Total dofs=" << dofh.n_dofs() << std::endl; { IndexSet dof_set; DoFTools::extract_locally_active_dofs (dofh, dof_set); - if (Utilities::System::get_this_mpi_process (MPI_COMM_WORLD) == 0) + if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0) dof_set.print(deallog); } - if (Utilities::System::get_this_mpi_process (MPI_COMM_WORLD) == 0) + if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0) deallog << "****" << std::endl; DoFRenumbering::component_wise(dofh); @@ -76,10 +76,10 @@ void test() IndexSet dof_set; DoFTools::extract_locally_active_dofs (dofh, dof_set); - if (Utilities::System::get_this_mpi_process (MPI_COMM_WORLD) == 0) + if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0) { dof_set.print(deallog); - for (unsigned int i=0; i::active_cell_iterator cell, endc = dofh.end(); - if (Utilities::System::get_this_mpi_process (MPI_COMM_WORLD) == 0) + if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0) for (cell = dofh.begin_active(); cell != endc; ++cell) if (!cell->is_artificial() && !cell->is_ghost()) { @@ -118,7 +118,7 @@ int main(int argc, char *argv[]) (void)argv; #endif - unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); deallog.push(Utilities::int_to_string(myid)); diff --git a/tests/mpi/p4est_2d_simple.cc b/tests/mpi/p4est_2d_simple.cc index 63d11aff49..f23366836b 100644 --- a/tests/mpi/p4est_2d_simple.cc +++ b/tests/mpi/p4est_2d_simple.cc @@ -32,12 +32,12 @@ template void test() { - unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); - unsigned int numproc = Utilities::System::get_n_mpi_processes (MPI_COMM_WORLD); + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); + unsigned int numproc = Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD); if (true) { - if (Utilities::System::get_this_mpi_process (MPI_COMM_WORLD) == 0) + if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0) deallog << "hyper_cube" << std::endl; parallel::distributed::Triangulation tr(MPI_COMM_WORLD); @@ -47,7 +47,7 @@ void test() Assert(tr.n_active_cells()==1, ExcInternalError()); - if (Utilities::System::get_this_mpi_process (MPI_COMM_WORLD) == 0) + if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0) deallog << "subdomainid = " << tr.begin_active()->subdomain_id() << std::endl; if (myid == numproc-1) @@ -66,7 +66,7 @@ void test() } - if (Utilities::System::get_this_mpi_process (MPI_COMM_WORLD) == 0) + if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0) deallog << "OK" << std::endl; } @@ -80,7 +80,7 @@ int main(int argc, char *argv[]) (void)argv; #endif - unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); if (myid == 0) { diff --git a/tests/mpi/p4est_3d_constraintmatrix_01.cc b/tests/mpi/p4est_3d_constraintmatrix_01.cc index b553a89731..eb2d4d4189 100644 --- a/tests/mpi/p4est_3d_constraintmatrix_01.cc +++ b/tests/mpi/p4est_3d_constraintmatrix_01.cc @@ -39,10 +39,10 @@ template void test() { - unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); - unsigned int numproc = Utilities::System::get_n_mpi_processes (MPI_COMM_WORLD); + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); + unsigned int numproc = Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD); - if (Utilities::System::get_this_mpi_process (MPI_COMM_WORLD) == 0) + if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0) deallog << "hyper_cube" << std::endl; parallel::distributed::Triangulation tr(MPI_COMM_WORLD); @@ -76,7 +76,7 @@ void test() DoFTools::make_hanging_node_constraints (dofh, cm2); { - std::ofstream file((std::string("p4est_3d_constraintmatrix_01/ncpu_") + Utilities::int_to_string(Utilities::System::get_n_mpi_processes (MPI_COMM_WORLD)) + "/dat." + Utilities::int_to_string(myid)).c_str()); + std::ofstream file((std::string("p4est_3d_constraintmatrix_01/ncpu_") + Utilities::int_to_string(Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD)) + "/dat." + Utilities::int_to_string(myid)).c_str()); file << "**** proc " << myid << std::endl; cm.print(file); file << "****" << std::endl; @@ -92,7 +92,7 @@ void test() { for (unsigned int i=0;i void test() { - unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); - unsigned int numproc = Utilities::System::get_n_mpi_processes (MPI_COMM_WORLD); + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); + unsigned int numproc = Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD); - if (Utilities::System::get_this_mpi_process (MPI_COMM_WORLD) == 0) + if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0) deallog << "hyper_cube" << std::endl; parallel::distributed::Triangulation tr(MPI_COMM_WORLD); @@ -139,7 +139,7 @@ int main(int argc, char *argv[]) (void)argv; #endif - unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); deallog.push(Utilities::int_to_string(myid)); diff --git a/tests/mpi/p4est_3d_constraintmatrix_03.cc b/tests/mpi/p4est_3d_constraintmatrix_03.cc index 9628e548f0..c2153bdf81 100644 --- a/tests/mpi/p4est_3d_constraintmatrix_03.cc +++ b/tests/mpi/p4est_3d_constraintmatrix_03.cc @@ -293,7 +293,7 @@ void test() x_ref -= x; double err = x_ref.linfty_norm(); if (err>1.0e-12) - if (Utilities::System::get_this_mpi_process (MPI_COMM_WORLD) == 0) + if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0) deallog << "err:" << err << std::endl; // x_rel=x_ref; //uncomment to output error @@ -316,7 +316,7 @@ void test() tr.set_boundary (0); tr.set_boundary (1); - if (Utilities::System::get_this_mpi_process (MPI_COMM_WORLD) == 0) + if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0) deallog << "OK" << std::endl; } @@ -330,7 +330,7 @@ int main(int argc, char *argv[]) (void)argv; #endif - unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); deallog.push(Utilities::int_to_string(myid)); diff --git a/tests/mpi/p4est_3d_constraintmatrix_04.cc b/tests/mpi/p4est_3d_constraintmatrix_04.cc index 3ca799f46a..28f41d9490 100644 --- a/tests/mpi/p4est_3d_constraintmatrix_04.cc +++ b/tests/mpi/p4est_3d_constraintmatrix_04.cc @@ -64,12 +64,12 @@ void test () // print out constraints for each // processor. - const unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); - const unsigned int numproc = Utilities::System::get_n_mpi_processes (MPI_COMM_WORLD); + const unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); + const unsigned int numproc = Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD); IndexSet locally_active (dof.n_dofs()); DoFTools::extract_locally_active_dofs (dof, locally_active); - std::ofstream file((std::string("p4est_3d_constraintmatrix_04/ncpu_") + Utilities::int_to_string(Utilities::System::get_n_mpi_processes (MPI_COMM_WORLD)) + "/dat." + Utilities::int_to_string(myid)).c_str()); + std::ofstream file((std::string("p4est_3d_constraintmatrix_04/ncpu_") + Utilities::int_to_string(Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD)) + "/dat." + Utilities::int_to_string(myid)).c_str()); file << "**** proc " << myid << ": \n\n"; file << "Constraints:\n"; constraints.print(file); @@ -84,7 +84,7 @@ void test () { for (unsigned int i=0;i void test() { - unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); if (true) { - if (Utilities::System::get_this_mpi_process (MPI_COMM_WORLD) == 0) + if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0) deallog << "hyper_cube" << std::endl; parallel::distributed::Triangulation tr(MPI_COMM_WORLD); @@ -127,7 +127,7 @@ int main(int argc, char *argv[]) (void)argv; #endif - unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); std::cout << myid << ":" << getpid() << std::endl; //system("sleep 20"); diff --git a/tests/mpi/p4est_3d_refine_01.cc b/tests/mpi/p4est_3d_refine_01.cc index 6092936a2c..7505391c0f 100644 --- a/tests/mpi/p4est_3d_refine_01.cc +++ b/tests/mpi/p4est_3d_refine_01.cc @@ -32,11 +32,11 @@ template void test() { - unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); if (true) { - if (Utilities::System::get_this_mpi_process (MPI_COMM_WORLD) == 0) + if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0) deallog << "hyper_cube" << std::endl; parallel::distributed::Triangulation tr(MPI_COMM_WORLD); @@ -44,9 +44,9 @@ void test() GridGenerator::hyper_cube(tr); tr.refine_global(1); - while (tr.n_active_cells() < 20000/Utilities::System::get_n_mpi_processes(MPI_COMM_WORLD)) + while (tr.n_active_cells() < 20000/Utilities::MPI::n_mpi_processes(MPI_COMM_WORLD)) { - if (Utilities::System::get_this_mpi_process (MPI_COMM_WORLD) == 0) + if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0) deallog << "refine_loop..." << std::endl; std::vector flags (tr.n_active_cells(), false); @@ -108,7 +108,7 @@ void test() } } - if (Utilities::System::get_this_mpi_process (MPI_COMM_WORLD) == 0) + if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0) deallog << "OK" << std::endl; } @@ -122,7 +122,7 @@ int main(int argc, char *argv[]) (void)argv; #endif - unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); deallog.push(Utilities::int_to_string(myid)); diff --git a/tests/mpi/p4est_3d_refine_02.cc b/tests/mpi/p4est_3d_refine_02.cc index c6a7a16089..e9a6b95202 100644 --- a/tests/mpi/p4est_3d_refine_02.cc +++ b/tests/mpi/p4est_3d_refine_02.cc @@ -38,7 +38,7 @@ template void test() { - unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); parallel::distributed::Triangulation tr(MPI_COMM_WORLD); GridGenerator::hyper_shell (tr, @@ -69,7 +69,7 @@ void test() << std::endl; } - if (Utilities::System::get_this_mpi_process (MPI_COMM_WORLD) == 0) + if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0) deallog << "OK" << std::endl; } @@ -83,7 +83,7 @@ int main(int argc, char *argv[]) (void)argv; #endif - unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); deallog.push(Utilities::int_to_string(myid)); diff --git a/tests/mpi/p4est_3d_refine_03.cc b/tests/mpi/p4est_3d_refine_03.cc index db7585730c..95a4a2f9b5 100644 --- a/tests/mpi/p4est_3d_refine_03.cc +++ b/tests/mpi/p4est_3d_refine_03.cc @@ -50,7 +50,7 @@ template void test() { - unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); parallel::distributed::Triangulation tr(MPI_COMM_WORLD); GridGenerator::hyper_cube(tr); @@ -66,7 +66,7 @@ void test() << std::endl; } - if (Utilities::System::get_this_mpi_process (MPI_COMM_WORLD) == 0) + if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0) deallog << "OK" << std::endl; } @@ -80,7 +80,7 @@ int main(int argc, char *argv[]) (void)argv; #endif - unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); deallog.push(Utilities::int_to_string(myid)); diff --git a/tests/mpi/p4est_3d_refine_04.cc b/tests/mpi/p4est_3d_refine_04.cc index e5e63c1e69..3e753d56bf 100644 --- a/tests/mpi/p4est_3d_refine_04.cc +++ b/tests/mpi/p4est_3d_refine_04.cc @@ -38,7 +38,7 @@ template void test() { - unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); if (true) { @@ -106,7 +106,7 @@ void test() << std::endl; } - if (Utilities::System::get_this_mpi_process (MPI_COMM_WORLD) == 0) + if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0) deallog << "OK" << std::endl; } @@ -120,7 +120,7 @@ int main(int argc, char *argv[]) (void)argv; #endif - unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); deallog.push(Utilities::int_to_string(myid)); diff --git a/tests/mpi/p4est_data_out_01.cc b/tests/mpi/p4est_data_out_01.cc index 855ecf5531..e841cd60df 100644 --- a/tests/mpi/p4est_data_out_01.cc +++ b/tests/mpi/p4est_data_out_01.cc @@ -41,9 +41,9 @@ template void test() { - unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); - if (Utilities::System::get_this_mpi_process (MPI_COMM_WORLD) == 0) + if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0) deallog << "hyper_cube" << std::endl; parallel::distributed::Triangulation tr(MPI_COMM_WORLD); @@ -82,7 +82,7 @@ int main(int argc, char *argv[]) (void)argv; #endif - unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); deallog.push(Utilities::int_to_string(myid)); diff --git a/tests/mpi/p4est_get_subdomain_association.cc b/tests/mpi/p4est_get_subdomain_association.cc index 8f717f23e6..26702ff53c 100644 --- a/tests/mpi/p4est_get_subdomain_association.cc +++ b/tests/mpi/p4est_get_subdomain_association.cc @@ -41,9 +41,9 @@ template void test() { - unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); - if (Utilities::System::get_this_mpi_process (MPI_COMM_WORLD) == 1) + if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 1) deallog << "hyper_cube" << std::endl; parallel::distributed::Triangulation tr(MPI_COMM_WORLD); @@ -81,7 +81,7 @@ int main(int argc, char *argv[]) (void)argv; #endif - unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); deallog.push(Utilities::int_to_string(myid)); diff --git a/tests/mpi/p4est_max_refine.cc b/tests/mpi/p4est_max_refine.cc index 6ae3f4727f..07526696bb 100644 --- a/tests/mpi/p4est_max_refine.cc +++ b/tests/mpi/p4est_max_refine.cc @@ -32,11 +32,11 @@ template void test() { - unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); if (true) { - if (Utilities::System::get_this_mpi_process (MPI_COMM_WORLD) == 0) + if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0) deallog << "hyper_cube" << std::endl; parallel::distributed::Triangulation tr(MPI_COMM_WORLD); @@ -48,7 +48,7 @@ void test() for (int i=0;i<29;++i) { - if (Utilities::System::get_this_mpi_process (MPI_COMM_WORLD) == 0) + if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0) deallog << "refine_loop... level=" << level << std::endl; if (myid==0) @@ -68,7 +68,7 @@ void test() } } - if (Utilities::System::get_this_mpi_process (MPI_COMM_WORLD) == 0) + if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0) deallog << "OK" << std::endl; } @@ -82,7 +82,7 @@ int main(int argc, char *argv[]) (void)argv; #endif - unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); deallog.push(Utilities::int_to_string(myid)); diff --git a/tests/mpi/petsc_01.cc b/tests/mpi/petsc_01.cc index 06700a4ce0..8f2b54b34a 100644 --- a/tests/mpi/petsc_01.cc +++ b/tests/mpi/petsc_01.cc @@ -31,8 +31,8 @@ void test() { - unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); - unsigned int numprocs = Utilities::System::get_n_mpi_processes (MPI_COMM_WORLD); + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); + unsigned int numprocs = Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD); if (myid==0) deallog << "Running on " << numprocs << " CPU(s)." << std::endl; @@ -82,7 +82,7 @@ int main(int argc, char *argv[]) { PetscInitialize(&argc,&argv,0,0); - if (Utilities::System::get_this_mpi_process (MPI_COMM_WORLD) == 0) + if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0) { std::ofstream logfile(output_file_for_mpi("petsc_01").c_str()); deallog.attach(logfile); diff --git a/tests/mpi/petsc_02.cc b/tests/mpi/petsc_02.cc index 52ceeda37a..f7ef9c358b 100644 --- a/tests/mpi/petsc_02.cc +++ b/tests/mpi/petsc_02.cc @@ -30,8 +30,8 @@ void test() { - unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); - unsigned int numprocs = Utilities::System::get_n_mpi_processes (MPI_COMM_WORLD); + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); + unsigned int numprocs = Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD); if (myid==0) deallog << "Running on " << numprocs << " CPU(s)." << std::endl; @@ -61,7 +61,7 @@ int main(int argc, char *argv[]) { PetscInitialize(&argc,&argv,0,0); - if (Utilities::System::get_this_mpi_process (MPI_COMM_WORLD) == 0) + if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0) { std::ofstream logfile(output_file_for_mpi("petsc_02").c_str()); deallog.attach(logfile); diff --git a/tests/mpi/point_to_point_pattern_01.cc b/tests/mpi/point_to_point_pattern_01.cc index 97b9f52b2c..af5ce58319 100644 --- a/tests/mpi/point_to_point_pattern_01.cc +++ b/tests/mpi/point_to_point_pattern_01.cc @@ -2,7 +2,7 @@ // $Id$ // Version: $Name$ // -// Copyright (C) 2009, 2010 by the deal.II authors +// Copyright (C) 2009, 2010, 2011 by the deal.II authors // // This file is subject to QPL and may not be distributed // without copyright and license information. Please refer @@ -26,8 +26,8 @@ void test_mpi() { Assert( Utilities::System::job_supports_mpi(), ExcInternalError()); - unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); - const unsigned int numprocs = Utilities::System::get_n_mpi_processes (MPI_COMM_WORLD); + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); + const unsigned int numprocs = Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD); // select a few destinations std::vector destinations; @@ -69,8 +69,8 @@ void test_mpi() deallog << "Exchanging data..." << std::endl; std::vector origins - = Utilities::System::compute_point_to_point_communication_pattern (MPI_COMM_WORLD, - destinations); + = Utilities::MPI::compute_point_to_point_communication_pattern (MPI_COMM_WORLD, + destinations); if (myid == 0) { @@ -114,7 +114,7 @@ int main(int argc, char *argv[]) #endif - if (Utilities::System::get_this_mpi_process (MPI_COMM_WORLD) == 0) + if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0) { std::ofstream logfile(output_file_for_mpi("point_to_point_pattern_01").c_str()); deallog.attach(logfile); diff --git a/tests/mpi/refine_and_coarsen_fixed_fraction_01.cc b/tests/mpi/refine_and_coarsen_fixed_fraction_01.cc index 1a2a2b8e18..7d10c4277a 100644 --- a/tests/mpi/refine_and_coarsen_fixed_fraction_01.cc +++ b/tests/mpi/refine_and_coarsen_fixed_fraction_01.cc @@ -35,12 +35,12 @@ void test() { - unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); parallel::distributed::Triangulation<2> tr(MPI_COMM_WORLD); std::vector sub(2); - sub[0] = 5*Utilities::System::get_n_mpi_processes (MPI_COMM_WORLD); + sub[0] = 5*Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD); sub[1] = 1; GridGenerator::subdivided_hyper_rectangle(static_cast&>(tr), sub, Point<2>(0,0), Point<2>(1,1)); @@ -108,10 +108,10 @@ void test() // since that would make 'make' delete the output file without us // ever seeing what we want to see if things go wrong // Assert (n_refined == -// 4*Utilities::System::get_n_mpi_processes (MPI_COMM_WORLD), +// 4*Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD), // ExcInternalError()); // Assert (n_coarsened == -// 4*Utilities::System::get_n_mpi_processes (MPI_COMM_WORLD), +// 4*Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD), // ExcInternalError()); } @@ -131,7 +131,7 @@ int main(int argc, char *argv[]) (void)argv; #endif - unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); deallog.push(Utilities::int_to_string(myid)); diff --git a/tests/mpi/refine_and_coarsen_fixed_fraction_02.cc b/tests/mpi/refine_and_coarsen_fixed_fraction_02.cc index fc34967585..4a82d9a6e3 100644 --- a/tests/mpi/refine_and_coarsen_fixed_fraction_02.cc +++ b/tests/mpi/refine_and_coarsen_fixed_fraction_02.cc @@ -39,12 +39,12 @@ void test() { - unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); parallel::distributed::Triangulation<2> tr(MPI_COMM_WORLD); std::vector sub(2); - sub[0] = 5*Utilities::System::get_n_mpi_processes (MPI_COMM_WORLD); + sub[0] = 5*Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD); sub[1] = 1; GridGenerator::subdivided_hyper_rectangle(static_cast&>(tr), sub, Point<2>(0,0), Point<2>(1,1)); @@ -118,10 +118,10 @@ void test() // since that would make 'make' delete the output file without us // ever seeing what we want to see if things go wrong // Assert (n_refined == -// 4*Utilities::System::get_n_mpi_processes (MPI_COMM_WORLD), +// 4*Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD), // ExcInternalError()); // Assert (n_coarsened == -// 4*Utilities::System::get_n_mpi_processes (MPI_COMM_WORLD), +// 4*Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD), // ExcInternalError()); } @@ -141,7 +141,7 @@ int main(int argc, char *argv[]) (void)argv; #endif - unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); deallog.push(Utilities::int_to_string(myid)); diff --git a/tests/mpi/refine_and_coarsen_fixed_fraction_03.cc b/tests/mpi/refine_and_coarsen_fixed_fraction_03.cc index e9a080728a..a2bc78a526 100644 --- a/tests/mpi/refine_and_coarsen_fixed_fraction_03.cc +++ b/tests/mpi/refine_and_coarsen_fixed_fraction_03.cc @@ -44,12 +44,12 @@ void test() { - unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); parallel::distributed::Triangulation<2> tr(MPI_COMM_WORLD); std::vector sub(2); - sub[0] = 5*Utilities::System::get_n_mpi_processes (MPI_COMM_WORLD); + sub[0] = 5*Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD); sub[1] = 1; GridGenerator::subdivided_hyper_rectangle(static_cast&>(tr), sub, Point<2>(0,0), Point<2>(1,1)); @@ -120,7 +120,7 @@ int main(int argc, char *argv[]) (void)argv; #endif - unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); deallog.push(Utilities::int_to_string(myid)); diff --git a/tests/mpi/refine_and_coarsen_fixed_fraction_04.cc b/tests/mpi/refine_and_coarsen_fixed_fraction_04.cc index cbe3826993..93e113149b 100644 --- a/tests/mpi/refine_and_coarsen_fixed_fraction_04.cc +++ b/tests/mpi/refine_and_coarsen_fixed_fraction_04.cc @@ -37,7 +37,7 @@ void test() { - const unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); + const unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); parallel::distributed::Triangulation<2> tr(MPI_COMM_WORLD); @@ -138,7 +138,7 @@ int main(int argc, char *argv[]) (void)argv; #endif - unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); deallog.push(Utilities::int_to_string(myid)); diff --git a/tests/mpi/refine_and_coarsen_fixed_fraction_05.cc b/tests/mpi/refine_and_coarsen_fixed_fraction_05.cc index 22a6ac1676..6bf9648901 100644 --- a/tests/mpi/refine_and_coarsen_fixed_fraction_05.cc +++ b/tests/mpi/refine_and_coarsen_fixed_fraction_05.cc @@ -34,7 +34,7 @@ void test() { - const unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); + const unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); parallel::distributed::Triangulation<2> tr(MPI_COMM_WORLD); @@ -135,7 +135,7 @@ int main(int argc, char *argv[]) (void)argv; #endif - unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); deallog.push(Utilities::int_to_string(myid)); diff --git a/tests/mpi/refine_and_coarsen_fixed_fraction_06.cc b/tests/mpi/refine_and_coarsen_fixed_fraction_06.cc index a5640c9164..5a29a463fe 100644 --- a/tests/mpi/refine_and_coarsen_fixed_fraction_06.cc +++ b/tests/mpi/refine_and_coarsen_fixed_fraction_06.cc @@ -41,7 +41,7 @@ namespace EquationData void test() { - const unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); + const unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); parallel::distributed::Triangulation<2> tr(MPI_COMM_WORLD); @@ -153,7 +153,7 @@ int main(int argc, char *argv[]) (void)argv; #endif - unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); deallog.push(Utilities::int_to_string(myid)); diff --git a/tests/mpi/refine_and_coarsen_fixed_number_01.cc b/tests/mpi/refine_and_coarsen_fixed_number_01.cc index 3b22eeaba9..09572af197 100644 --- a/tests/mpi/refine_and_coarsen_fixed_number_01.cc +++ b/tests/mpi/refine_and_coarsen_fixed_number_01.cc @@ -35,12 +35,12 @@ void test() { - unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); parallel::distributed::Triangulation<2> tr(MPI_COMM_WORLD); std::vector sub(2); - sub[0] = 5*Utilities::System::get_n_mpi_processes (MPI_COMM_WORLD); + sub[0] = 5*Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD); sub[1] = 1; GridGenerator::subdivided_hyper_rectangle(static_cast&>(tr), sub, Point<2>(0,0), Point<2>(1,1)); @@ -96,10 +96,10 @@ void test() // since that would make 'make' delete the output file without us // ever seeing what we want to see if things go wrong // Assert (n_refined == -// 4*Utilities::System::get_n_mpi_processes (MPI_COMM_WORLD), +// 4*Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD), // ExcInternalError()); // Assert (n_coarsened == -// 4*Utilities::System::get_n_mpi_processes (MPI_COMM_WORLD), +// 4*Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD), // ExcInternalError()); } @@ -119,7 +119,7 @@ int main(int argc, char *argv[]) (void)argv; #endif - unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); deallog.push(Utilities::int_to_string(myid)); diff --git a/tests/mpi/refine_and_coarsen_fixed_number_02.cc b/tests/mpi/refine_and_coarsen_fixed_number_02.cc index 94dc865eda..771abc8c9a 100644 --- a/tests/mpi/refine_and_coarsen_fixed_number_02.cc +++ b/tests/mpi/refine_and_coarsen_fixed_number_02.cc @@ -36,12 +36,12 @@ void test() { - unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); parallel::distributed::Triangulation<2> tr(MPI_COMM_WORLD); std::vector sub(2); - sub[0] = 5*Utilities::System::get_n_mpi_processes (MPI_COMM_WORLD); + sub[0] = 5*Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD); sub[1] = 1; GridGenerator::subdivided_hyper_rectangle(static_cast&>(tr), sub, Point<2>(0,0), Point<2>(1,1)); @@ -97,10 +97,10 @@ void test() // since that would make 'make' delete the output file without us // ever seeing what we want to see if things go wrong // Assert (n_refined == -// 4*Utilities::System::get_n_mpi_processes (MPI_COMM_WORLD), +// 4*Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD), // ExcInternalError()); // Assert (n_coarsened == -// 4*Utilities::System::get_n_mpi_processes (MPI_COMM_WORLD), +// 4*Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD), // ExcInternalError()); } @@ -120,7 +120,7 @@ int main(int argc, char *argv[]) (void)argv; #endif - unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); deallog.push(Utilities::int_to_string(myid)); diff --git a/tests/mpi/refine_and_coarsen_fixed_number_03.cc b/tests/mpi/refine_and_coarsen_fixed_number_03.cc index 5a5ddc3502..af6613208b 100644 --- a/tests/mpi/refine_and_coarsen_fixed_number_03.cc +++ b/tests/mpi/refine_and_coarsen_fixed_number_03.cc @@ -33,12 +33,12 @@ void test() { - const unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); + const unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); parallel::distributed::Triangulation<2> tr(MPI_COMM_WORLD); std::vector sub(2); - sub[0] = 5*Utilities::System::get_n_mpi_processes (MPI_COMM_WORLD); + sub[0] = 5*Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD); sub[1] = 1; GridGenerator::subdivided_hyper_rectangle(static_cast&>(tr), sub, Point<2>(0,0), Point<2>(1,1)); @@ -109,7 +109,7 @@ int main(int argc, char *argv[]) (void)argv; #endif - unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); deallog.push(Utilities::int_to_string(myid)); diff --git a/tests/mpi/refine_and_coarsen_fixed_number_04.cc b/tests/mpi/refine_and_coarsen_fixed_number_04.cc index a21692f5db..3943b9017f 100644 --- a/tests/mpi/refine_and_coarsen_fixed_number_04.cc +++ b/tests/mpi/refine_and_coarsen_fixed_number_04.cc @@ -37,7 +37,7 @@ void test() { - const unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); + const unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); parallel::distributed::Triangulation<2> tr(MPI_COMM_WORLD); @@ -138,7 +138,7 @@ int main(int argc, char *argv[]) (void)argv; #endif - unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); deallog.push(Utilities::int_to_string(myid)); diff --git a/tests/mpi/refine_and_coarsen_fixed_number_05.cc b/tests/mpi/refine_and_coarsen_fixed_number_05.cc index 6079e887ff..0a4be632f1 100644 --- a/tests/mpi/refine_and_coarsen_fixed_number_05.cc +++ b/tests/mpi/refine_and_coarsen_fixed_number_05.cc @@ -34,7 +34,7 @@ void test() { - const unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); + const unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); parallel::distributed::Triangulation<2> tr(MPI_COMM_WORLD); @@ -135,7 +135,7 @@ int main(int argc, char *argv[]) (void)argv; #endif - unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); deallog.push(Utilities::int_to_string(myid)); diff --git a/tests/mpi/refine_and_coarsen_fixed_number_06.cc b/tests/mpi/refine_and_coarsen_fixed_number_06.cc index 0b0326654d..b0210956d2 100644 --- a/tests/mpi/refine_and_coarsen_fixed_number_06.cc +++ b/tests/mpi/refine_and_coarsen_fixed_number_06.cc @@ -37,8 +37,8 @@ template void test() { - unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); - unsigned int numprocs = Utilities::System::get_n_mpi_processes (MPI_COMM_WORLD); + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); + unsigned int numprocs = Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD); parallel::distributed::Triangulation triangulation(MPI_COMM_WORLD); GridGenerator::hyper_cube (triangulation); @@ -73,7 +73,7 @@ int main(int argc, char *argv[]) (void)argv; #endif - if (Utilities::System::get_this_mpi_process (MPI_COMM_WORLD) == 0) + if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0) { std::ofstream logfile(output_file_for_mpi("refine_and_coarsen_fixed_number_06").c_str()); deallog.attach(logfile); diff --git a/tests/mpi/renumber_z_order_01.cc b/tests/mpi/renumber_z_order_01.cc index 0f710cb509..8da60e8cca 100644 --- a/tests/mpi/renumber_z_order_01.cc +++ b/tests/mpi/renumber_z_order_01.cc @@ -45,7 +45,7 @@ template void test() { - unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); parallel::distributed::Triangulation tr (MPI_COMM_WORLD); @@ -125,7 +125,7 @@ int main (int argc, char *argv[]) (void) argv; #endif - unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); deallog.push (Utilities::int_to_string (myid)); diff --git a/tests/mpi/renumber_z_order_02.cc b/tests/mpi/renumber_z_order_02.cc index fd1860ab45..8d264ae85f 100644 --- a/tests/mpi/renumber_z_order_02.cc +++ b/tests/mpi/renumber_z_order_02.cc @@ -47,7 +47,7 @@ template void test() { - unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); parallel::distributed::Triangulation tr (MPI_COMM_WORLD); @@ -132,7 +132,7 @@ int main (int argc, char *argv[]) (void) argv; #endif - unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); deallog.push (Utilities::int_to_string (myid)); diff --git a/tests/mpi/simple_mpi_01.cc b/tests/mpi/simple_mpi_01.cc index 5c52f7c811..ccb9e9a042 100644 --- a/tests/mpi/simple_mpi_01.cc +++ b/tests/mpi/simple_mpi_01.cc @@ -27,8 +27,8 @@ void test_mpi() Assert( Utilities::System::job_supports_mpi(), ExcInternalError()); - unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); - const unsigned int numprocs = Utilities::System::get_n_mpi_processes (MPI_COMM_WORLD); + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); + const unsigned int numprocs = Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD); if (myid==0) deallog << "Running on " << numprocs << " CPU(s)." << std::endl; @@ -71,7 +71,7 @@ int main(int argc, char *argv[]) #endif - if (Utilities::System::get_this_mpi_process (MPI_COMM_WORLD) == 0) + if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0) { std::ofstream logfile(output_file_for_mpi("simple_mpi_01").c_str()); deallog.attach(logfile); diff --git a/tests/mpi/solution_transfer_01.cc b/tests/mpi/solution_transfer_01.cc index a9b2750397..09da6d3e4b 100644 --- a/tests/mpi/solution_transfer_01.cc +++ b/tests/mpi/solution_transfer_01.cc @@ -95,7 +95,7 @@ void test() // hanging MPI_Barrier (MPI_COMM_WORLD); - if (Utilities::System::get_this_mpi_process (MPI_COMM_WORLD) == 0) + if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0) deallog << "OK" << std::endl; } @@ -105,7 +105,7 @@ int main(int argc, char *argv[]) PetscInitialize(&argc,&argv,0,0); - unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); deallog.push(Utilities::int_to_string(myid)); diff --git a/tests/mpi/trilinos_compress_bug.cc b/tests/mpi/trilinos_compress_bug.cc index f13def69f4..fcf912dad9 100644 --- a/tests/mpi/trilinos_compress_bug.cc +++ b/tests/mpi/trilinos_compress_bug.cc @@ -29,8 +29,8 @@ void test () { - unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); - unsigned int numproc = Utilities::System::get_n_mpi_processes (MPI_COMM_WORLD); + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); + unsigned int numproc = Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD); if (myid==0) deallog << "numproc=" << numproc << std::endl; @@ -81,7 +81,7 @@ void test () Assert(test(locally_owned.nth_index_in_set(5)) == 7, ExcInternalError()); } - if (Utilities::System::get_this_mpi_process (MPI_COMM_WORLD) == 0) + if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0) deallog << "OK" << std::endl; } @@ -91,7 +91,7 @@ int main (int argc, char **argv) { Utilities::System::MPI_InitFinalize mpi_initialization(argc, argv); - unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); deallog.push(Utilities::int_to_string(myid)); if (myid == 0) diff --git a/tests/mpi/trilinos_ghost_01.cc b/tests/mpi/trilinos_ghost_01.cc index 510e2aaad0..b31462140f 100644 --- a/tests/mpi/trilinos_ghost_01.cc +++ b/tests/mpi/trilinos_ghost_01.cc @@ -26,8 +26,8 @@ void test () { - unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); - unsigned int numproc = Utilities::System::get_n_mpi_processes (MPI_COMM_WORLD); + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); + unsigned int numproc = Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD); if (myid==0) deallog << "numproc=" << numproc << std::endl; @@ -51,7 +51,7 @@ void test () v.compress(); v*=2.0; - if (Utilities::System::get_this_mpi_process (MPI_COMM_WORLD) == 0) + if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0) { deallog << myid*2 << ":" << v(myid*2) << std::endl; deallog << myid*2+1 << ":" << v(myid*2+1) << std::endl; @@ -63,11 +63,11 @@ void test () v_tmp.reinit(v,false,true); // check ghost values - if (Utilities::System::get_this_mpi_process (MPI_COMM_WORLD) == 0) + if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0) deallog << "ghost: " << v_tmp(1) << std::endl; Assert(v_tmp(1) == 2.0, ExcInternalError()); - if (Utilities::System::get_this_mpi_process (MPI_COMM_WORLD) == 0) + if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0) deallog << "OK" << std::endl; } @@ -77,7 +77,7 @@ int main (int argc, char **argv) { Utilities::System::MPI_InitFinalize mpi_initialization(argc, argv); - unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); deallog.push(Utilities::int_to_string(myid)); if (myid == 0) diff --git a/tests/mpi/trilinos_ghost_02.cc b/tests/mpi/trilinos_ghost_02.cc index 9c0b875989..8d07f85fa7 100644 --- a/tests/mpi/trilinos_ghost_02.cc +++ b/tests/mpi/trilinos_ghost_02.cc @@ -25,8 +25,8 @@ void test () { - unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); - unsigned int numproc = Utilities::System::get_n_mpi_processes (MPI_COMM_WORLD); + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); + unsigned int numproc = Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD); if (myid==0) deallog << "numproc=" << numproc << std::endl; @@ -53,11 +53,11 @@ void test () // assignment with transfer to ghost v_tmp = v; // check ghost values - if (Utilities::System::get_this_mpi_process (MPI_COMM_WORLD) == 0) + if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0) deallog << "ghost: " << v_tmp(1) << std::endl; Assert(v_tmp(1) == 1.0, ExcInternalError()); - if (Utilities::System::get_this_mpi_process (MPI_COMM_WORLD) == 0) + if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0) deallog << "OK" << std::endl; } @@ -67,7 +67,7 @@ int main (int argc, char **argv) { Utilities::System::MPI_InitFinalize mpi_initialization(argc, argv); - unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); deallog.push(Utilities::int_to_string(myid)); if (myid == 0) diff --git a/tests/mpi/trilinos_ghost_03.cc b/tests/mpi/trilinos_ghost_03.cc index 92c9e3016c..bdae6fbac4 100644 --- a/tests/mpi/trilinos_ghost_03.cc +++ b/tests/mpi/trilinos_ghost_03.cc @@ -26,8 +26,8 @@ void test () { - unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); - unsigned int numproc = Utilities::System::get_n_mpi_processes (MPI_COMM_WORLD); + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); + unsigned int numproc = Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD); if (myid==0) deallog << "numproc=" << numproc << std::endl; @@ -64,7 +64,7 @@ void test () { } - if (Utilities::System::get_this_mpi_process (MPI_COMM_WORLD) == 0) + if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0) deallog << "OK" << std::endl; } @@ -74,7 +74,7 @@ int main (int argc, char **argv) { Utilities::System::MPI_InitFinalize mpi_initialization(argc, argv); - unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); deallog.push(Utilities::int_to_string(myid)); if (myid == 0) diff --git a/tests/mpi/trilinos_ghost_03_linfty.cc b/tests/mpi/trilinos_ghost_03_linfty.cc index b9d3de1e23..8788326f59 100644 --- a/tests/mpi/trilinos_ghost_03_linfty.cc +++ b/tests/mpi/trilinos_ghost_03_linfty.cc @@ -26,8 +26,8 @@ void test () { - unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); - unsigned int numproc = Utilities::System::get_n_mpi_processes (MPI_COMM_WORLD); + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); + unsigned int numproc = Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD); if (myid==0) deallog << "numproc=" << numproc << std::endl; @@ -66,9 +66,9 @@ void test () } Assert (exc == false, ExcInternalError()); - Assert (norm == 2.*Utilities::System::get_n_mpi_processes (MPI_COMM_WORLD)-1, + Assert (norm == 2.*Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD)-1, ExcInternalError()); - if (Utilities::System::get_this_mpi_process (MPI_COMM_WORLD) == 0) + if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0) { deallog << norm << std::endl; deallog << "OK" << std::endl; @@ -81,7 +81,7 @@ int main (int argc, char **argv) { Utilities::System::MPI_InitFinalize mpi_initialization(argc, argv); - unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); deallog.push(Utilities::int_to_string(myid)); if (myid == 0) diff --git a/tests/mpi/trilinos_ghost_04.cc b/tests/mpi/trilinos_ghost_04.cc index ca632ffdc1..aa61d0c8b9 100644 --- a/tests/mpi/trilinos_ghost_04.cc +++ b/tests/mpi/trilinos_ghost_04.cc @@ -28,8 +28,8 @@ void test () { - unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); - unsigned int numproc = Utilities::System::get_n_mpi_processes (MPI_COMM_WORLD); + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); + unsigned int numproc = Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD); if (myid==0) deallog << "numproc=" << numproc << std::endl; @@ -77,7 +77,7 @@ int main (int argc, char **argv) { Utilities::System::MPI_InitFinalize mpi_initialization(argc, argv); - unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); deallog.push(Utilities::int_to_string(myid)); if (myid == 0) diff --git a/tests/mpi/trilinos_ghost_05.cc b/tests/mpi/trilinos_ghost_05.cc index e6946d5892..7b554c9314 100644 --- a/tests/mpi/trilinos_ghost_05.cc +++ b/tests/mpi/trilinos_ghost_05.cc @@ -26,8 +26,8 @@ void test () { - unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); - unsigned int numproc = Utilities::System::get_n_mpi_processes (MPI_COMM_WORLD); + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); + unsigned int numproc = Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD); if (myid==0) deallog << "numproc=" << numproc << std::endl; @@ -82,7 +82,7 @@ int main (int argc, char **argv) { Utilities::System::MPI_InitFinalize mpi_initialization(argc, argv); - unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); deallog.push(Utilities::int_to_string(myid)); if (myid == 0) diff --git a/tests/mpi/trilinos_sparse_matrix_mmult_01.cc b/tests/mpi/trilinos_sparse_matrix_mmult_01.cc index e184058ddc..a2a3344ca0 100644 --- a/tests/mpi/trilinos_sparse_matrix_mmult_01.cc +++ b/tests/mpi/trilinos_sparse_matrix_mmult_01.cc @@ -26,8 +26,8 @@ void test () { - const unsigned int n_procs = Utilities::System::get_n_mpi_processes(MPI_COMM_WORLD); - const unsigned int my_id = Utilities::System::get_this_mpi_process(MPI_COMM_WORLD); + const unsigned int n_procs = Utilities::MPI::n_mpi_processes(MPI_COMM_WORLD); + const unsigned int my_id = Utilities::MPI::this_mpi_process(MPI_COMM_WORLD); const unsigned int n_rows = 2; const unsigned int n_cols = 2; @@ -148,7 +148,7 @@ int main (int argc, char **argv) { Utilities::System::MPI_InitFinalize mpi_initialization(argc, argv); - unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); deallog.push(Utilities::int_to_string(myid)); if (myid == 0) diff --git a/tests/mpi/trilinos_sparse_matrix_print_01.cc b/tests/mpi/trilinos_sparse_matrix_print_01.cc index 468854026b..537d7b98d7 100644 --- a/tests/mpi/trilinos_sparse_matrix_print_01.cc +++ b/tests/mpi/trilinos_sparse_matrix_print_01.cc @@ -26,8 +26,8 @@ void test () { - const unsigned int n_procs = Utilities::System::get_n_mpi_processes(MPI_COMM_WORLD); - const unsigned int my_id = Utilities::System::get_this_mpi_process(MPI_COMM_WORLD); + const unsigned int n_procs = Utilities::MPI::n_mpi_processes(MPI_COMM_WORLD); + const unsigned int my_id = Utilities::MPI::this_mpi_process(MPI_COMM_WORLD); const unsigned int n_rows = 3; const unsigned int n_cols = 4; @@ -82,8 +82,8 @@ int main (int argc, char **argv) { Utilities::System::MPI_InitFinalize mpi_initialization(argc, argv); - const unsigned int n_procs = Utilities::System::get_n_mpi_processes(MPI_COMM_WORLD); - unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); + const unsigned int n_procs = Utilities::MPI::n_mpi_processes(MPI_COMM_WORLD); + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); deallog.push(Utilities::int_to_string(myid)); // let processor 1 speak if we run diff --git a/tests/mpi/trilinos_vector_reinit.cc b/tests/mpi/trilinos_vector_reinit.cc index 05945a1c11..09fcbe8546 100644 --- a/tests/mpi/trilinos_vector_reinit.cc +++ b/tests/mpi/trilinos_vector_reinit.cc @@ -25,8 +25,8 @@ void test () { - unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); - unsigned int numproc = Utilities::System::get_n_mpi_processes (MPI_COMM_WORLD); + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); + unsigned int numproc = Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD); if (myid==0) deallog << "numproc=" << numproc << std::endl; @@ -50,7 +50,7 @@ void test () Assert (test1.vector_partitioner().SameAs(test2.vector_partitioner()), ExcInternalError()); - if (Utilities::System::get_this_mpi_process (MPI_COMM_WORLD) == 0) + if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0) deallog << "OK" << std::endl; } @@ -60,7 +60,7 @@ int main (int argc, char **argv) { Utilities::System::MPI_InitFinalize mpi_initialization(argc, argv); - unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD); + unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); deallog.push(Utilities::int_to_string(myid)); if (myid == 0) -- 2.39.5