MOAB: Mesh Oriented datABase  (version 5.5.0)
scdpart.cpp File Reference
+ Include dependency graph for scdpart.cpp:

Go to the source code of this file.

Functions

void test_read_parallel (int nverts)
 
void test_read_parallel_alljorkori ()
 
void test_read_parallel_alljkbal ()
 
void test_read_parallel_sqij ()
 
void test_read_parallel_sqjk ()
 
int main (int argc, char **argv)
 

Variables

std::string example = TestDir + "unittest/io/eul3x48x96.t.3.nc"
 
std::string partition_method
 

Function Documentation

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 20 of file scdpart.cpp.

21 {
22  MPI_Init( &argc, &argv );
23  int result = 0;
24 
27  result += RUN_TEST( test_read_parallel_sqij );
28  result += RUN_TEST( test_read_parallel_sqjk );
29 
30  MPI_Finalize();
31  return result;
32 }

References RUN_TEST, test_read_parallel_alljkbal(), test_read_parallel_alljorkori(), test_read_parallel_sqij(), and test_read_parallel_sqjk().

◆ test_read_parallel()

void test_read_parallel ( int  nverts)

Definition at line 58 of file scdpart.cpp.

59 {
60  Core moab;
61  Interface& mb = moab;
62  EntityHandle file_set;
63  ErrorCode rval;
64  rval = mb.create_meshset( MESHSET_SET, file_set );CHECK_ERR( rval );
65 
66  std::string opt = std::string( "PARALLEL=READ_PART;PARTITION=;PARTITION_DISTRIBUTE;PARALLEL_RESOLVE_SHARED_ENTS" ) +
68  rval = mb.load_file( example.c_str(), &file_set, opt.c_str() );CHECK_ERR( rval );
69 
70  ParallelComm* pcomm = ParallelComm::get_pcomm( &mb, 0 );
71 
72  rval = pcomm->check_all_shared_handles();CHECK_ERR( rval );
73 
74  // get the total # owned verts
75  Range verts;
76  rval = mb.get_entities_by_type( 0, MBVERTEX, verts );CHECK_ERR( rval );
77  rval = pcomm->filter_pstatus( verts, PSTATUS_NOT_OWNED, PSTATUS_NOT );CHECK_ERR( rval );
78  int my_num = verts.size(), total_verts;
79  MPI_Reduce( &my_num, &total_verts, 1, MPI_INT, MPI_SUM, 0, pcomm->proc_config().proc_comm() );
80 
81  if( 0 == pcomm->proc_config().proc_rank() ) CHECK_EQUAL( total_verts, num_verts );
82 }

References moab::ParallelComm::check_all_shared_handles(), CHECK_EQUAL, CHECK_ERR, moab::Core::create_meshset(), ErrorCode, example, moab::ParallelComm::filter_pstatus(), moab::Core::get_entities_by_type(), moab::ParallelComm::get_pcomm(), moab::Core::load_file(), mb, MBVERTEX, MESHSET_SET, partition_method, moab::ProcConfig::proc_comm(), moab::ParallelComm::proc_config(), moab::ProcConfig::proc_rank(), PSTATUS_NOT, PSTATUS_NOT_OWNED, and moab::Range::size().

Referenced by test_read_parallel_alljkbal(), test_read_parallel_alljorkori(), test_read_parallel_sqij(), and test_read_parallel_sqjk().

◆ test_read_parallel_alljkbal()

void test_read_parallel_alljkbal ( )

Definition at line 40 of file scdpart.cpp.

41 {
42  partition_method = std::string( ";PARTITION_METHOD=alljkbal" );
43  test_read_parallel( 4704 );
44 }

References partition_method, and test_read_parallel().

Referenced by main().

◆ test_read_parallel_alljorkori()

void test_read_parallel_alljorkori ( )

Definition at line 34 of file scdpart.cpp.

35 {
36  partition_method = std::string( ";PARTITION_METHOD=alljorkori" );
37  test_read_parallel( 4704 );
38 }

References partition_method, and test_read_parallel().

Referenced by main().

◆ test_read_parallel_sqij()

void test_read_parallel_sqij ( )

Definition at line 46 of file scdpart.cpp.

47 {
48  partition_method = std::string( ";PARTITION_METHOD=sqij" );
49  test_read_parallel( 4704 );
50 }

References partition_method, and test_read_parallel().

Referenced by main().

◆ test_read_parallel_sqjk()

void test_read_parallel_sqjk ( )

Definition at line 52 of file scdpart.cpp.

53 {
54  partition_method = std::string( ";PARTITION_METHOD=sqjk" );
55  test_read_parallel( 4704 );
56 }

References partition_method, and test_read_parallel().

Referenced by main().

Variable Documentation

◆ example

std::string example = TestDir + "unittest/io/eul3x48x96.t.3.nc"

Definition at line 10 of file scdpart.cpp.

Referenced by test_read_parallel().

◆ partition_method