// // Software License for AMDiS // // Copyright (c) 2010 Dresden University of Technology // All rights reserved. // Authors: Simon Vey, Thomas Witkowski et al. // // This file is part of AMDiS // // See also license.opensource.txt in the distribution. #include "AMDiS.h" #include #ifdef HAVE_ZOLTAN #include #endif namespace AMDiS { using namespace std; #if defined(HAVE_PARALLEL_DOMAIN_AMDIS) && defined(HAVE_PARALLEL_MTL4) mtl::par::environment* mtl_environment=NULL; #endif void init(int argc, char **argv) { FUNCNAME("AMDiS::init()"); #ifdef HAVE_PARALLEL_DOMAIN_AMDIS #ifdef HAVE_PARALLEL_MTL4 mtl_environment = new mtl::par::environment(argc, argv); #else PetscInitialize(&argc, &argv, NULL, NULL); mpi::startRand(); #endif #ifdef HAVE_ZOLTAN float zoltanVersion = 0.0; Zoltan_Initialize(argc, argv, &zoltanVersion); #endif #endif TEST_EXIT(argc >= 2)("No init file!\n"); Parameters::init(string(argv[1])); Parameters::readArgv(argc, argv); } void finalize() { FUNCNAME("AMDiS::finalize()"); #ifdef HAVE_PARALLEL_DOMAIN_AMDIS MeshDistributor::globalMeshDistributor->exitParallelization(); #ifdef HAVE_PARALLEL_MTL4 if ( mtl_environment ) delete mtl_environment; #else PetscFinalize(); #endif #endif } }