Mesh Oriented datABase  (version 5.5.1)
An array-based unstructured mesh library
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. More...
 
 ~ProcConfig ()
 
unsigned proc_rank () const
 Get the current processor number. More...
 
unsigned proc_size () const
 Get the number of processors. More...
 
gs_data::crystal_datacrystal_router (bool construct_if_missing=true)
 get a crystal router for this parallel job More...
 
MPI_Comm proc_comm () const
 get/set the communicator for this proc config More...
 
void proc_comm (MPI_Comm this_comm)
 
void proc_rank (unsigned r)
 set rank/size; USED FOR TESTING ONLY! More...
 
void proc_size (unsigned s)
 

Private Attributes

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

Detailed Description

Multi-CPU information for parallel MOAB.

Definition at line 31 of file ProcConfig.hpp.

Constructor & Destructor Documentation

◆ ProcConfig()

moab::ProcConfig::ProcConfig ( MPI_Comm  proc_comm)

Constructor.

Definition at line 23 of file ProcConfig.cpp.

23  : procComm( proc_comm1 ), crystalData( 0 )
24 {
25 #ifdef MOAB_HAVE_MPI
26  int rank, size;
27  MPI_Comm_rank( procComm, &rank );
28  procRank = (unsigned int)rank;
29  MPI_Comm_size( procComm, &size );
30  procSize = (unsigned int)size;
31 #else
32  procRank = 0;
33  procSize = 1;
34 #endif
35 }

References procComm, procRank, procSize, and size.

◆ ~ProcConfig()

moab::ProcConfig::~ProcConfig ( )

Definition at line 49 of file ProcConfig.cpp.

50 {
51  if( crystalData )
52  {
53 #ifdef MOAB_HAVE_MPI
54  crystalData->reset();
55 #endif
56  delete crystalData;
57  crystalData = 0;
58  }
59 }

References crystalData.

Member Function Documentation

◆ crystal_router()

gs_data::crystal_data * moab::ProcConfig::crystal_router ( bool  construct_if_missing = true)

get a crystal router for this parallel job

Definition at line 37 of file ProcConfig.cpp.

38 {
39 #ifdef MOAB_HAVE_MPI
40  if( !crystalData && construct_if_missing )
41  {
42  crystalData = new gs_data::crystal_data( procComm );
43  }
44 #endif
45 
46  return crystalData;
47 }

References crystalData, and procComm.

Referenced by moab::ParallelComm::augment_default_sets_with_ghosts(), moab::ParCommGraph::compute_partition(), moab::ParallelComm::delete_entities(), iMOAB_SetDoubleTagStorageWithGid(), moab::Coupler::interpolate(), moab::DataCoupler::interpolate(), moab::Coupler::locate_points(), main(), moab::ParallelComm::resolve_shared_ents(), and moab::ParallelComm::resolve_shared_sets().

◆ proc_comm() [1/2]

MPI_Comm moab::ProcConfig::proc_comm ( ) const
inline

get/set the communicator for this proc config

Definition at line 54 of file ProcConfig.hpp.

55  {
56  return procComm;
57  }

References procComm.

Referenced by 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(), moab::Coupler::initialize_tree(), moab::ReadParallel::load_file(), moab::ReadDamsel::load_file(), main(), moab::WriteHDF5Parallel::negotiate_type_list(), moab::WriteHDF5Parallel::parallel_create_file(), moab::ParallelComm::post_irecv(), moab::ReadHDF5::print_times(), moab::WriteHDF5Parallel::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().

◆ proc_comm() [2/2]

void moab::ProcConfig::proc_comm ( MPI_Comm  this_comm)
inline

Definition at line 58 of file ProcConfig.hpp.

59  {
60  procComm = this_comm;
61  }

References procComm.

◆ proc_rank() [1/2]

unsigned moab::ProcConfig::proc_rank ( ) const
inline

Get the current processor number.

Definition at line 39 of file ProcConfig.hpp.

40  {
41  return procRank;
42  }

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(), moab::WriteHDF5Parallel::create_dataset(), moab::ParallelComm::create_interface_sets(), moab::NCHelperDomain::create_mesh(), moab::NCHelperESMF::create_mesh(), moab::NCHelperGCRM::create_mesh(), moab::NCHelperHOMME::create_mesh(), moab::NCHelperMPAS::create_mesh(), moab::NCHelperScrip::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::NCHelperEuler::init_mesh_vals(), moab::NCHelperFV::init_mesh_vals(), moab::ParallelComm::initialize(), moab::Coupler::initialize_tree(), 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::ReadHDF5::print_times(), moab::WriteHDF5Parallel::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::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(), moab::ParallelComm::unpack_entities(), moab::ParallelComm::update_remote_data_old(), and moab::NCWriteHelper::write_set_variables().

◆ proc_rank() [2/2]

void moab::ProcConfig::proc_rank ( unsigned  r)
inline

set rank/size; USED FOR TESTING ONLY!

Definition at line 64 of file ProcConfig.hpp.

65  {
66  procRank = r;
67  }

References procRank.

◆ proc_size() [1/2]

◆ proc_size() [2/2]

void moab::ProcConfig::proc_size ( unsigned  s)
inline

Definition at line 68 of file ProcConfig.hpp.

69  {
70  procSize = s;
71  }

References procSize.

Member Data Documentation

◆ crystalData

gs_data::crystal_data* moab::ProcConfig::crystalData
private

crystal router for this parallel job

Definition at line 84 of file ProcConfig.hpp.

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

◆ procComm

MPI_Comm moab::ProcConfig::procComm
private

MPI communicator set for this instance.

Definition at line 75 of file ProcConfig.hpp.

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

◆ procRank

unsigned moab::ProcConfig::procRank
private

rank of this processor

Definition at line 78 of file ProcConfig.hpp.

Referenced by proc_rank(), and ProcConfig().

◆ procSize

unsigned moab::ProcConfig::procSize
private

number of processors

Definition at line 81 of file ProcConfig.hpp.

Referenced by proc_size(), and ProcConfig().


The documentation for this class was generated from the following files: