MOAB: Mesh Oriented datABase  (version 5.4.1)
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 = "unittest/io/eul3x48x96.t.3.nc"
std::string partition_method

Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 20 of file scdpart.cpp.

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

{
    MPI_Init( &argc, &argv );
    int result = 0;

    result += RUN_TEST( test_read_parallel_alljorkori );
    result += RUN_TEST( test_read_parallel_alljkbal );
    result += RUN_TEST( test_read_parallel_sqij );
    result += RUN_TEST( test_read_parallel_sqjk );

    MPI_Finalize();
    return result;
}
void test_read_parallel ( int  nverts)

Definition at line 58 of file scdpart.cpp.

References moab::ParallelComm::check_all_shared_handles(), CHECK_EQUAL, CHECK_ERR, moab::Interface::create_meshset(), ErrorCode, example, moab::ParallelComm::filter_pstatus(), moab::Interface::get_entities_by_type(), moab::ParallelComm::get_pcomm(), moab::Interface::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(), test_read_parallel_sqjk(), test_read_parallel_ucd_trivial(), and test_read_parallel_ucd_trivial_spectral().

{
    Core moab;
    Interface& mb = moab;
    EntityHandle file_set;
    ErrorCode rval;
    rval = mb.create_meshset( MESHSET_SET, file_set );CHECK_ERR( rval );

    std::string opt = std::string( "PARALLEL=READ_PART;PARTITION=;PARTITION_DISTRIBUTE;PARALLEL_RESOLVE_SHARED_ENTS" ) +
                      partition_method;
    rval = mb.load_file( example.c_str(), &file_set, opt.c_str() );CHECK_ERR( rval );

    ParallelComm* pcomm = ParallelComm::get_pcomm( &mb, 0 );

    rval = pcomm->check_all_shared_handles();CHECK_ERR( rval );

    // get the total # owned verts
    Range verts;
    rval = mb.get_entities_by_type( 0, MBVERTEX, verts );CHECK_ERR( rval );
    rval = pcomm->filter_pstatus( verts, PSTATUS_NOT_OWNED, PSTATUS_NOT );CHECK_ERR( rval );
    int my_num = verts.size(), total_verts;
    MPI_Reduce( &my_num, &total_verts, 1, MPI_INT, MPI_SUM, 0, pcomm->proc_config().proc_comm() );

    if( 0 == pcomm->proc_config().proc_rank() ) CHECK_EQUAL( total_verts, num_verts );
}

Definition at line 40 of file scdpart.cpp.

References partition_method, and test_read_parallel().

Referenced by main().

{
    partition_method = std::string( ";PARTITION_METHOD=alljkbal" );
    test_read_parallel( 4704 );
}

Definition at line 34 of file scdpart.cpp.

References partition_method, and test_read_parallel().

Referenced by main().

{
    partition_method = std::string( ";PARTITION_METHOD=alljorkori" );
    test_read_parallel( 4704 );
}

Definition at line 46 of file scdpart.cpp.

References partition_method, and test_read_parallel().

Referenced by main().

{
    partition_method = std::string( ";PARTITION_METHOD=sqij" );
    test_read_parallel( 4704 );
}

Definition at line 52 of file scdpart.cpp.

References partition_method, and test_read_parallel().

Referenced by main().

{
    partition_method = std::string( ";PARTITION_METHOD=sqjk" );
    test_read_parallel( 4704 );
}

Variable Documentation

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

Definition at line 10 of file scdpart.cpp.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines