initinfo.c

Go to the documentation of this file.
00001 /*
00002     This file is part of magpar.
00003 
00004     Copyright (C) 2002-2010 Werner Scholz
00005 
00006     www:   http://www.magpar.net/
00007     email: magpar(at)magpar.net
00008 
00009     magpar is free software; you can redistribute it and/or modify
00010     it under the terms of the GNU General Public License as published by
00011     the Free Software Foundation; either version 2 of the License, or
00012     (at your option) any later version.
00013 
00014     magpar is distributed in the hope that it will be useful,
00015     but WITHOUT ANY WARRANTY; without even the implied warranty of
00016     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017     GNU General Public License for more details.
00018 
00019     You should have received a copy of the GNU General Public License
00020     along with magpar; if not, write to the Free Software
00021     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00022 */
00023 
00024 static char const Id[] = "$Id: initinfo.c 3013 2010-03-26 16:12:31Z scholz $\n\n";
00025 static char const Td[] = "$Today: " __FILE__ "  " __DATE__ "  "  __TIME__  " $\n\n";
00026 
00027 #include "magpar_version.h"
00028 #include "init.h"
00029 
00030 #ifdef METIS
00031 EXTERN_C_BEGIN
00032 #include "metis.h"
00033 EXTERN_C_END
00034 #endif
00035 
00036 #ifdef SUNDIALS_VERSION
00037 #include "llg/llg.h"
00038 #endif
00039 
00040 #ifdef PNG
00041 #include "png.h"
00042 #endif
00043 
00044 #ifdef ZLIB
00045 #include "zlib.h"
00046 #endif
00047 
00048 #ifdef ADDONS
00049 #include "addons/addons.h"
00050 #endif
00051 
00052 int InitInfo()
00053 {
00054   MagparFunctionLogBegin;
00055 
00056   int rank,size;
00057   ierr = MPI_Comm_size(PETSC_COMM_WORLD,&size);CHKERRQ(ierr);
00058   ierr = MPI_Comm_rank(PETSC_COMM_WORLD,&rank);CHKERRQ(ierr);
00059 
00060   PetscPrintf(PETSC_COMM_WORLD,"\nmagpar compiled with...\n");
00061 #ifdef __GNUC__
00062   PetscPrintf(PETSC_COMM_WORLD," - GNU C(++) version "__VERSION__"\n");
00063 #endif
00064 #if defined(_WIN32) || defined (__CYGWIN32__)
00065   PetscPrintf(PETSC_COMM_WORLD," - Cygwin environment\n");
00066 #endif
00067 
00068   PetscPrintf(PETSC_COMM_WORLD," - assert checks ");
00069 #ifdef NDEBUG
00070   PetscPrintf(PETSC_COMM_WORLD,"disabled (NDEBUG defined)\n");
00071 #else
00072   PetscPrintf(PETSC_COMM_WORLD,"enabled (NDEBUG undefined)\n");
00073 #endif
00074 
00075 #ifdef UNIPROC
00076   PetscPrintf(PETSC_COMM_WORLD," - uniprocessor support only (by PETSc configuration)\n");
00077 #else
00078   PetscPrintf(PETSC_COMM_WORLD," - MPI for parallelization on multiple processors\n");
00079 #endif
00080 
00081   PetscPrintf(PETSC_COMM_WORLD," - X11 support ");
00082 #ifdef PETSC_HAVE_X11
00083   PetscPrintf(PETSC_COMM_WORLD,"enabled for visualizing matrix structures\n");
00084 #else
00085   PetscPrintf(PETSC_COMM_WORLD,"disabled\n");
00086 #endif
00087 
00088   PetscPrintf(PETSC_COMM_WORLD," - EXCH ");
00089 #ifdef EXCH
00090   PetscPrintf(PETSC_COMM_WORLD,"defined\n");
00091 #else
00092   PetscPrintf(PETSC_COMM_WORLD,"undefined\n");
00093 #endif
00094 
00095   PetscPrintf(PETSC_COMM_WORLD," - floating point data/operations using ");
00096 #ifdef PETSC_USE_SINGLE
00097   PetscPrintf(PETSC_COMM_WORLD,"single precision\n");
00098   if (2*sizeof(PetscReal)!=sizeof(double)) PetscPrintf(PETSC_COMM_WORLD,"Warning: 2*sizeof(PetscReal)!=sizeof(double)\n");
00099 #else
00100   PetscPrintf(PETSC_COMM_WORLD,"double precision\n");
00101   if (sizeof(PetscReal)!=sizeof(double)) PetscPrintf(PETSC_COMM_WORLD,"Warning: sizeof(PetscReal)!=sizeof(double)\n");
00102 #endif
00103   PetscPrintf(PETSC_COMM_WORLD,"   (see also data type sizes below)\n");
00104 
00105 #ifdef ADDONS
00106   PetscPrintf(PETSC_COMM_WORLD," - add-ons included\n");
00107   PetscPrintf(PETSC_COMM_WORLD," - dense boundary matrix and MF+ approximation\n");
00108 #else
00109   PetscPrintf(PETSC_COMM_WORLD," - dense boundary matrix for demagnetizing field\n");
00110 #endif
00111 
00112   PetscPrintf(PETSC_COMM_WORLD,"\nLinked libraries:\n");
00113 
00114   PetscPrintf(PETSC_COMM_WORLD," - PETSc    (version %i.%i.%ipl%i): core library (parallel data structures, solvers)\n",
00115     PETSC_VERSION_MAJOR,PETSC_VERSION_MINOR,PETSC_VERSION_SUBMINOR,PETSC_VERSION_PATCH);
00116 
00117 #ifndef UNIPROC
00118   PetscPrintf(PETSC_COMM_WORLD," - MPI      (version %i.%i): message passing standard\n",
00119     MPI_VERSION,MPI_SUBVERSION);
00120 #ifdef MPICH_VERSION
00121   PetscPrintf(PETSC_COMM_WORLD," - MPICH    (version %s): message passing library\n",
00122     MPICH_VERSION);
00123 #elif defined(MPICH2)
00124   PetscPrintf(PETSC_COMM_WORLD," - MPICH    (version %i): message passing library\n",
00125     MPICH2);
00126 #endif
00127 #ifdef LAM_MPI
00128   PetscPrintf(PETSC_COMM_WORLD," - LAM/MPI  (version %s): message passing library\n",
00129     LAM_VERSION);
00130 #endif
00131 #endif
00132 
00133 #ifdef METIS
00134   PetscPrintf(PETSC_COMM_WORLD," - ParMetis (version ");
00135 #ifdef PARMETIS_MAJOR_VERSION
00136   PetscPrintf(PETSC_COMM_WORLD,"%i",PARMETIS_MAJOR_VERSION);
00137 #endif
00138 #ifdef PARMETIS_MINOR_VERSION
00139   PetscPrintf(PETSC_COMM_WORLD,".%i",PARMETIS_MINOR_VERSION);
00140 #endif
00141 #ifdef PARMETIS_SUBMINOR_VERSION
00142   PetscPrintf(PETSC_COMM_WORLD,".%i",PARMETIS_SUBMINOR_VERSION);
00143 #endif
00144   PetscPrintf(PETSC_COMM_WORLD,"): mesh partitioning\n");
00145   PetscPrintf(PETSC_COMM_WORLD,"   using within:");
00146   PetscPrintf(PETSC_COMM_WORLD,METISTITLE);
00147 #else
00148   PetscPrintf(PETSC_COMM_WORLD," - ParMetis not linked - mesh partitioning unavailable.\n");
00149 #endif
00150 
00151 #ifdef SUNDIALS_VERSION
00152 #if SUNDIALS_VERSION < 230
00153 #error "SUNDIALS versions lower/older than 2.3.0 are not supported"
00154 #endif
00155   PetscPrintf(PETSC_COMM_WORLD," - SUNDIALS (version %s): time integration of LLG\n",
00156     SUNDIALS_PACKAGE_VERSION);
00157 #else
00158   PetscPrintf(PETSC_COMM_WORLD," - PVODE time integration not available\n");
00159 #endif
00160 
00161 #ifdef TAO
00162   PetscPrintf(PETSC_COMM_WORLD," - TAO      (version %s): energy minimization\n",TAO_VERSION_NUMBER);
00163   PetscPrintf(PETSC_COMM_WORLD,"   This product includes software produced by UChicago Argonne, LLC\n");
00164   PetscPrintf(PETSC_COMM_WORLD,"   under Contract No. DE-AC02-06CH11357 with the Department of Energy.\n");
00165 #else
00166   PetscPrintf(PETSC_COMM_WORLD," - TAO energy minimization not available\n");
00167 #endif
00168 
00169 #ifdef PNG
00170   PetscPrintf(PETSC_COMM_WORLD," - libpng   (version %s): png graphics output\n",
00171     PNG_LIBPNG_VER_STRING);
00172 #else
00173   PetscPrintf(PETSC_COMM_WORLD," - PNG output not available\n");
00174 #endif
00175 
00176 #ifdef ZLIB
00177   PetscPrintf(PETSC_COMM_WORLD," - zlib     (version %s): compression of output files\n",ZLIB_VERSION);
00178 #else
00179   PetscPrintf(PETSC_COMM_WORLD," - zlib compression not available\n");
00180 #endif
00181 
00182 #ifdef PETSC_HAVE_SUPERLU_DIST
00183   PetscPrintf(PETSC_COMM_WORLD," - SuperLU available for parallel direct LU solver\n");
00184 #endif
00185 
00186 #ifdef PETSC_HAVE_UMFPACK
00187   PetscPrintf(PETSC_COMM_WORLD," - UMFPACK available for sequential direct LU solver\n");
00188 #endif
00189 
00190 #ifdef PETSC_HAVE_HYPRE
00191   PetscPrintf(PETSC_COMM_WORLD," - hypre available for preconditioning\n");
00192 #endif
00193 
00194 #ifdef PYTHON
00195   const char *pythonversion;
00196   pythonversion=Py_GetVersion();
00197   PetscPrintf(PETSC_COMM_WORLD," - Python    version %s\n",pythonversion);
00198 #endif
00199 
00200   PetscPrintf(PETSC_COMM_WORLD,
00201     "\ndata type sizes (bytes):\n"
00202     "int         %i\n"
00203     "PetscInt    %i\n"
00204     "double      %i\n"
00205     "PetscReal   %i\n"
00206     "size_t      %i\n"
00207     "D_EPS       %g\n",
00208     sizeof(int),
00209     sizeof(PetscInt),
00210     sizeof(double),
00211     sizeof(PetscReal),
00212     sizeof(size_t),
00213     D_EPS
00214   );
00215 
00216   PetscPrintf(PETSC_COMM_WORLD,"\nmagpar running with...\n");
00217   PetscTruth profile;
00218   PetscOptionsHasName(PETSC_NULL,"-profile",&profile);
00219   PetscPrintf(PETSC_COMM_WORLD," - profiling ");
00220   if (profile) {
00221     PetscPrintf(PETSC_COMM_WORLD,"enabled\n");
00222   }
00223   else {
00224     PetscPrintf(PETSC_COMM_WORLD,"disabled\n");
00225   }
00226   PetscTruth info;
00227   PetscOptionsHasName(PETSC_NULL,"-info",&info);
00228   PetscPrintf(PETSC_COMM_WORLD," - PetscInfo (debugging,profiling output) ");
00229   if (info) {
00230     PetscPrintf(PETSC_COMM_WORLD,"enabled\n");
00231   }
00232   else {
00233     PetscPrintf(PETSC_COMM_WORLD,"disabled\n");
00234   }
00235   PetscPrintf(PETSC_COMM_WORLD,"\n");
00236 
00237 
00238   PetscPrintf(PETSC_COMM_WORLD,
00239     "--------------------------------------------------------------------------\n"
00240     "magpar running on %i processor%s\n\n", size, size>1 ? "s" : ""
00241   );
00242   char hostname[256];
00243   ierr = PetscGetHostName(hostname,255);
00244   PetscSynchronizedPrintf(PETSC_COMM_WORLD,
00245     "Hello world from processor %i on host %s!\n",rank,hostname
00246   );
00247   PetscSynchronizedFlush(PETSC_COMM_WORLD);
00248   PetscPrintf(PETSC_COMM_WORLD,"\n");
00249 
00250   MagparFunctionLogReturn(0);
00251 }

magpar - Parallel Finite Element Micromagnetics Package
Copyright (C) 2002-2010 Werner Scholz