Skip to content
Snippets Groups Projects
Select Git revision
  • 50e9cfba56997fc966a052013adf52e2d64e4f16
  • 2016-PippingKornhuberRosenauOncken default
  • 2014-Dissertation-Pipping
  • 2013-PippingSanderKornhuber
4 results

dune_tectonic.cc

Blame
  • user avatar
    Elias Pipping authored and Elias Pipping committed
    50dd7251
    History
    Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    dune_tectonic.cc 821 B
    #ifdef HAVE_CONFIG_H
    #include "config.h"
    #endif
    #include <iostream>
    #include "dune/common/mpihelper.hh"  // An initializer of MPI
    #include "dune/common/exceptions.hh" // We use exceptions
    
    int main(int argc, char** argv) {
      try {
        // Maybe initialize Mpi
        Dune::MPIHelper& helper = Dune::MPIHelper::instance(argc, argv);
        std::cout << "Hello World! This is dune-tectonic." << std::endl;
        if (Dune::MPIHelper::isFake)
          std::cout << "This is a sequential program." << std::endl;
        else
          std::cout << "I am rank " << helper.rank() << " of " << helper.size()
                    << " processes!" << std::endl;
        return 0;
      }
      catch (Dune::Exception& e) {
        std::cerr << "Dune reported error: " << e << std::endl;
      }
      catch (...) {
        std::cerr << "Unknown exception thrown!" << std::endl;
      }
    }