MOAB: Mesh Oriented datABase  (version 5.4.1)
mhdf_parallel.c File Reference
#include "mhdf.h"
#include <time.h>
#include <stdlib.h>
#include <stdio.h>
#include <assert.h>
#include <H5Ppublic.h>
#include <H5Tpublic.h>
#include <H5Epublic.h>
#include <H5FDmpi.h>
#include <H5FDmpio.h>
+ Include dependency graph for mhdf_parallel.c:

Go to the source code of this file.

Functions

int main (int argc, char *argv[])

Function Documentation

int main ( int  argc,
char *  argv[] 
)

Definition at line 288 of file mhdf_parallel.c.

References moab::handle_hdf5_error(), and MPI_COMM_WORLD.

{
#ifdef H5_HAVE_PARALLEL
    int rval;
    void* data;
    herr_t err;

#if defined( H5Eget_auto_vers ) && H5Eget_auto_vers > 1
    err = H5Eget_auto( H5E_DEFAULT, &default_handler, &data );
#else
    err = H5Eget_auto( &default_handler, &data );
#endif
    if( err >= 0 )
    {
#if defined( H5Eset_auto_vers ) && H5Eset_auto_vers > 1
        H5Eset_auto( H5E_DEFAULT, &handle_hdf5_error, data );
#else
        H5Eset_auto( &handle_hdf5_error, data );
#endif
    }

    rval = MPI_Init( &argc, &argv );
    if( rval ) return rval;
    rval = MPI_Comm_rank( MPI_COMM_WORLD, &RANK );
    if( rval ) return rval;
    rval = MPI_Comm_size( MPI_COMM_WORLD, &NUM_PROC );
    if( rval ) return rval;

    if( RANK == 0 ) create_file();

    /* Wait for rank 0 to finish creating the file, otherwise rank 1 may find it to be invalid */
    rval = MPI_Barrier( MPI_COMM_WORLD );
    if( rval ) return rval;

    write_file_data();

    MPI_Finalize();
#endif
    return 0;
}
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines