Mesh Oriented datABase  (version 5.4.1)
Array-based unstructured mesh datastructure
moab::ProcConfig Class Reference

Multi-CPU information for parallel MOAB. More...

#include <ProcConfig.hpp>

+ Collaboration diagram for moab::ProcConfig:

Public Member Functions

 ProcConfig (MPI_Comm proc_comm)
 Constructor.
 ~ProcConfig ()
unsigned proc_rank () const
 Get the current processor number.
unsigned proc_size () const
 Get the number of processors.
gs_data::crystal_datacrystal_router (bool construct_if_missing=true)
 get a crystal router for this parallel job
MPI_Comm proc_comm () const
 get/set the communicator for this proc config
void proc_comm (MPI_Comm this_comm)
void proc_rank (unsigned r)
 set rank/size; USED FOR TESTING ONLY!
void proc_size (unsigned s)

Private Attributes

MPI_Comm procComm
 MPI communicator set for this instance.
unsigned procRank
 rank of this processor
unsigned procSize
 number of processors
gs_data::crystal_datacrystalData
 crystal router for this parallel job

Detailed Description

Multi-CPU information for parallel MOAB.

Examples:
CrystalRouterExample.cpp.

Definition at line 31 of file ProcConfig.hpp.


Constructor & Destructor Documentation

Constructor.

Definition at line 23 of file ProcConfig.cpp.

References procComm, procRank, procSize, and size.

                                            : procComm( proc_comm1 ), crystalData( 0 )
{
#ifdef MOAB_HAVE_MPI
    int rank, size;
    MPI_Comm_rank( procComm, &rank );
    procRank = (unsigned int)rank;
    MPI_Comm_size( procComm, &size );
    procSize = (unsigned int)size;
#else
    procRank = 0;
    procSize = 1;
#endif
}

Definition at line 49 of file ProcConfig.cpp.

References crystalData.

{
    if( crystalData )
    {
#ifdef MOAB_HAVE_MPI
        crystalData->reset();
#endif
        delete crystalData;
        crystalData = 0;
    }
}

Member Function Documentation

get/set the communicator for this proc config

Examples:
HelloParMOAB.cpp.

Definition at line 54 of file ProcConfig.hpp.

References procComm.

Referenced by moab::MeshOutputFunctor::assign_global_ids(), moab::ParallelComm::assign_global_ids(), moab::ParallelComm::augment_default_sets_with_ghosts(), moab::ParallelComm::broadcast_entities(), moab::ParallelComm::comm(), moab::WriteHDF5Parallel::communicate_shared_set_data(), moab::WriteHDF5Parallel::communicate_shared_set_ids(), moab::WriteHDF5Parallel::create_dataset(), moab::NCHelperHOMME::create_mesh(), moab::NCHelperMPAS::create_mesh(), moab::WriteHDF5Parallel::create_tag_tables(), moab::WriteHDF5Parallel::debug_barrier_line(), moab::Coupler::do_normalization(), moab::ParallelComm::exchange_all_shared_handles(), moab::ParallelComm::exchange_ghost_cells(), moab::ParallelComm::exchange_owned_mesh(), moab::ParallelComm::exchange_tags(), moab::ReadHDF5::find_sets_containing(), moab::Coupler::get_matching_entities(), iMeshP_getNumOfTopoAll(), iMeshP_getNumOfTypeAll(), iMeshP_getPartitionComm(), moab::Coupler::initialize_tree(), moab::ReadDamsel::load_file(), moab::ReadParallel::load_file(), main(), moab::WriteHDF5Parallel::negotiate_type_list(), moab::WriteHDF5Parallel::parallel_create_file(), moab::ParallelComm::post_irecv(), moab::WriteHDF5Parallel::print_times(), moab::ReadHDF5::print_times(), moab::ReadHDF5::read_all_set_meta(), moab::ParallelComm::recv_buffer(), moab::ParallelComm::recv_entities(), moab::ParallelComm::reduce_tags(), moab::ParallelComm::resolve_shared_sets(), moab::ParallelComm::scatter_entities(), moab::ParallelComm::send_buffer(), moab::ParallelComm::send_recv_entities(), moab::ReadHDF5::set_up_read(), moab::ParallelComm::settle_intersection_points(), and moab::ScdInterface::tag_shared_vertices().

    {
        return procComm;
    }
void moab::ProcConfig::proc_comm ( MPI_Comm  this_comm) [inline]

Definition at line 58 of file ProcConfig.hpp.

References procComm.

    {
        procComm = this_comm;
    }
unsigned moab::ProcConfig::proc_rank ( ) const [inline]

Get the current processor number.

Examples:
CrystalRouterExample.cpp, HelloParMOAB.cpp, and ReadWriteTest.cpp.

Definition at line 39 of file ProcConfig.hpp.

References procRank.

Referenced by moab::ParallelComm::assign_global_ids(), moab::ParallelComm::broadcast_entities(), moab::ParallelComm::build_sharedhps_list(), moab::ParallelComm::check_all_shared_handles(), moab::ParallelComm::check_clean_iface(), moab::ParallelComm::check_local_shared(), moab::NCWriteGCRM::collect_mesh_info(), moab::NCWriteHOMME::collect_mesh_info(), moab::NCWriteMPAS::collect_mesh_info(), moab::WriteHDF5Parallel::communicate_shared_set_data(), moab::WriteHDF5Parallel::communicate_shared_set_ids(), create_coarse_mesh(), moab::WriteHDF5Parallel::create_dataset(), create_fine_mesh(), moab::ParallelComm::create_interface_sets(), moab::NCHelperScrip::create_mesh(), moab::NCHelperHOMME::create_mesh(), moab::NCHelperGCRM::create_mesh(), moab::NCHelperMPAS::create_mesh(), moab::WriteHDF5Parallel::create_meshset_tables(), moab::ParallelComm::create_part(), moab::ReadParallel::create_partition_sets(), moab::WriteHDF5Parallel::create_tag_tables(), moab::ReadParallel::delete_nonlocal_entities(), moab::WriteHDF5Parallel::exchange_file_ids(), moab::ParallelComm::exchange_ghost_cells(), moab::ParallelComm::exchange_owned_mesh(), moab::ParallelComm::exchange_tags(), moab::ReadHDF5::find_sets_containing(), moab::ParallelComm::get_buffers(), moab::ParallelComm::get_interface_procs(), moab::ParallelData::get_interface_sets(), moab::ParallelComm::get_owner_handle(), moab::ParallelComm::get_owning_part(), moab::ParallelComm::get_part_id(), moab::ParallelComm::get_proc_nvecs(), moab::ParallelComm::get_remote_handles(), moab::ScdInterface::get_shared_vertices(), moab::ParallelComm::get_sharing_parts(), moab::NCHelperDomain::init_mesh_vals(), moab::NCHelperFV::init_mesh_vals(), moab::NCHelperEuler::init_mesh_vals(), moab::ParallelComm::initialize(), moab::Coupler::initialize_tree(), intersection_at_level(), moab::ReadParallel::load_file(), moab::Coupler::locate_points(), main(), moab::WriteHDF5Parallel::negotiate_type_list(), moab::WriteHDF5Parallel::parallel_create_file(), moab::ParallelComm::ParallelComm(), moab::ParallelComm::post_irecv(), moab::ParallelComm::print_buffer(), moab::WriteHDF5Parallel::print_times(), moab::ReadHDF5::print_times(), moab::ParallelComm::rank(), moab::ReadHDF5::read_all_set_meta(), moab::ReadParallel::ReadParallel(), moab::ParallelComm::recv_buffer(), moab::ParallelComm::recv_entities(), moab::ParallelComm::recv_messages(), moab::ParallelComm::recv_remote_handle_messages(), moab::ParallelComm::reduce_tags(), moab::RefinerTagManager::RefinerTagManager(), moab::ParallelComm::resolve_shared_ents(), moab::ParallelComm::resolve_shared_sets(), moab::ParallelComm::scatter_entities(), moab::ParallelComm::send_buffer(), moab::ParallelComm::send_entities(), moab::ParallelComm::send_recv_entities(), moab::ParallelComm::set_rank(), moab::ParallelComm::set_sharing_data(), moab::ReadHDF5::set_up_read(), moab::ParallelComm::settle_intersection_points(), moab::ParallelComm::tag_shared_verts(), test_intx_in_parallel_elem_based(), moab::ParallelComm::unpack_entities(), moab::ParallelComm::update_remote_data_old(), and moab::NCWriteHelper::write_set_variables().

    {
        return procRank;
    }
void moab::ProcConfig::proc_rank ( unsigned  r) [inline]

set rank/size; USED FOR TESTING ONLY!

Definition at line 64 of file ProcConfig.hpp.

References procRank.

    {
        procRank = r;
    }
void moab::ProcConfig::proc_size ( unsigned  s) [inline]

Definition at line 68 of file ProcConfig.hpp.

References procSize.

    {
        procSize = s;
    }

Member Data Documentation

crystal router for this parallel job

Definition at line 84 of file ProcConfig.hpp.

Referenced by crystal_router(), and ~ProcConfig().

MPI communicator set for this instance.

Definition at line 75 of file ProcConfig.hpp.

Referenced by crystal_router(), proc_comm(), and ProcConfig().

unsigned moab::ProcConfig::procRank [private]

rank of this processor

Definition at line 78 of file ProcConfig.hpp.

Referenced by proc_rank(), and ProcConfig().

unsigned moab::ProcConfig::procSize [private]

number of processors

Definition at line 81 of file ProcConfig.hpp.

Referenced by proc_size(), and ProcConfig().

List of all members.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines