examples/hdf5_parallel_read.cpp

Go to the documentation of this file.
00001 #include <iostream>
00002 #include "mpi.h"
00003 #include "HDF5ParallelReader.h"
00004 #include "pbe.h"
00005 
00006 using namespace std;
00007 
00008 int main (int argc, char **argv) {
00009 
00010 #ifdef __GNUC__
00011     std::set_terminate (__gnu_cxx::__verbose_terminate_handler);
00012 #endif
00013 
00014     MPI_Comm comm;   
00015     int mpi_rank;
00016     char* inputFile;
00017     char* outputFile;    
00018     
00019     MPI_Init(&argc, &argv);    
00020     comm = MPI_COMM_WORLD;
00021     MPI_Comm_rank(comm, &mpi_rank);      
00022     
00023     
00024     if (argc == 2) {
00025         inputFile = argv[1];
00026     } else if (argc == 3) {
00027         inputFile = argv[1];
00028         outputFile = argv[2];
00029     } else {
00030         if (mpi_rank == 0) 
00031             cout << "Usage: hdf5_parallel_read inputfile.h5 [outputfile.vtk]" << endl;
00032         return 0;
00033     }
00034         
00035     TetMeshBuilder* builder = new TetMeshBuilder(comm);
00036     HDF5ParallelReader* reader = new HDF5ParallelReader(inputFile, builder, comm);
00037     
00038     reader->read();    
00039     
00040     if (argc == 3) 
00041         reader->export_dist(outputFile);
00042         
00043     MPI_Finalize();
00044     
00045     return 0;
00046 }

Generated on Fri Oct 26 13:35:11 2007 for FEMAXX (Finite Element Maxwell Eigensolver) by  doxygen 1.4.7