MOAB: Mesh Oriented datABase  (version 5.5.0)
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

◆ main()

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

Definition at line 288 of file mhdf_parallel.c.

289 {
290 #ifdef H5_HAVE_PARALLEL
291  int rval;
292  void* data;
293  herr_t err;
294 
295 #if defined( H5Eget_auto_vers ) && H5Eget_auto_vers > 1
296  err = H5Eget_auto( H5E_DEFAULT, &default_handler, &data );
297 #else
298  err = H5Eget_auto( &default_handler, &data );
299 #endif
300  if( err >= 0 )
301  {
302 #if defined( H5Eset_auto_vers ) && H5Eset_auto_vers > 1
303  H5Eset_auto( H5E_DEFAULT, &handle_hdf5_error, data );
304 #else
305  H5Eset_auto( &handle_hdf5_error, data );
306 #endif
307  }
308 
309  rval = MPI_Init( &argc, &argv );
310  if( rval ) return rval;
311  rval = MPI_Comm_rank( MPI_COMM_WORLD, &RANK );
312  if( rval ) return rval;
313  rval = MPI_Comm_size( MPI_COMM_WORLD, &NUM_PROC );
314  if( rval ) return rval;
315 
316  if( RANK == 0 ) create_file();
317 
318  /* Wait for rank 0 to finish creating the file, otherwise rank 1 may find it to be invalid */
319  rval = MPI_Barrier( MPI_COMM_WORLD );
320  if( rval ) return rval;
321 
322  write_file_data();
323 
324  MPI_Finalize();
325 #endif
326  return 0;
327 }

References moab::handle_hdf5_error(), and MPI_COMM_WORLD.