MOAB: Mesh Oriented datABase  (version 5.4.1)
TestErrorHandlingPar.cpp File Reference
#include "moab/Core.hpp"
#include <iostream>
+ Include dependency graph for TestErrorHandlingPar.cpp:

Go to the source code of this file.

Functions

ErrorCode TestErrorHandlingPar_1 ()
ErrorCode TestErrorHandlingPar_2 ()
int main (int argc, char **argv)

Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 59 of file TestErrorHandlingPar.cpp.

References ErrorCode, MB_CHK_ERR, MB_SUCCESS, moab::MBErrorHandler_Finalize(), moab::MBErrorHandler_Init(), TestErrorHandlingPar_1(), and TestErrorHandlingPar_2().

{
    if( argc < 2 )
    {
        cout << "Usage: " << argv[0] << " <test_case_num(1 to 2>" << endl;
        return 0;
    }

#ifdef MOAB_HAVE_MPI
    MPI_Init( &argc, &argv );
#endif

    // Initialize error handler, optional for this example (using moab instances)
    MBErrorHandler_Init();

    ErrorCode rval = MB_SUCCESS;

    int test_case_num = atoi( argv[1] );
    switch( test_case_num )
    {
        case 1:
            rval = TestErrorHandlingPar_1();MB_CHK_ERR( rval );
            break;
        case 2:
            rval = TestErrorHandlingPar_2();MB_CHK_ERR( rval );
            break;
        default:
            break;
    }

    // Finalize error handler, optional for this example (using moab instances)
    MBErrorHandler_Finalize();

#ifdef MOAB_HAVE_MPI
    MPI_Finalize();
#endif

    return 0;
}
Examples:
TestErrorHandlingPar.cpp.

Definition at line 19 of file TestErrorHandlingPar.cpp.

References ErrorCode, moab::Interface::load_file(), mb, MB_CHK_ERR, MB_SUCCESS, and MESH_DIR.

Referenced by main().

{
    Core moab;
    Interface& mb = moab;

    string opts = ";;";
#ifdef MOAB_HAVE_MPI
    // Use parallel options
    opts += "PARALLEL=READ_PART;PARTITION_METHOD=SQIJ";
#endif

    // Load a CAM-FV file and read a variable on edges (not supported yet)
    string test_file = string( MESH_DIR ) + string( "/io/fv3x46x72.t.3.nc" );
    opts += ";VARIABLE=US";
    ErrorCode rval = mb.load_file( test_file.c_str(), NULL, opts.c_str() );MB_CHK_ERR( rval );

    return MB_SUCCESS;
}
Examples:
TestErrorHandlingPar.cpp.

Definition at line 40 of file TestErrorHandlingPar.cpp.

References ErrorCode, moab::Interface::load_file(), mb, MB_CHK_ERR, MB_SUCCESS, and MESH_DIR.

Referenced by main().

{
    Core moab;
    Interface& mb = moab;

    string opts = ";;";
#ifdef MOAB_HAVE_MPI
    // Use parallel options
    opts += "PARALLEL=READ_PART;PARTITION_METHOD=UNKNOWN";
#endif

    // Load a CAM-FV file with an unknown partition method specified
    string test_file = string( MESH_DIR ) + string( "/io/fv3x46x72.t.3.nc" );
    opts += ";VARIABLE=T";
    ErrorCode rval = mb.load_file( test_file.c_str(), NULL, opts.c_str() );MB_CHK_ERR( rval );

    return MB_SUCCESS;
}
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines