confinfo.h

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////
00002 ///
00003 /// @file confinfo.h
00004 ///
00005 /// Writing configuration settings to an output stream.
00006 /// This file contains the definition of a function which gathers
00007 /// various configuration parameters and outputs them to a stream
00008 /// in a nice text format.
00009 ///
00010 /// @author Pawel Pilarczyk
00011 ///
00012 /////////////////////////////////////////////////////////////////////////////
00013 
00014 // Copyright (C) 1997-2008 by Pawel Pilarczyk.
00015 //
00016 // This file is part of my research software package.  This is free software;
00017 // you can redistribute it and/or modify it under the terms of the GNU
00018 // General Public License as published by the Free Software Foundation;
00019 // either version 2 of the License, or (at your option) any later version.
00020 //
00021 // This software is distributed in the hope that it will be useful,
00022 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00023 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00024 // GNU General Public License for more details.
00025 //
00026 // You should have received a copy of the GNU General Public License along
00027 // with this software; see the file "license.txt".  If not, write to the
00028 // Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
00029 // MA 02111-1307, USA.
00030 
00031 // Started on April 10, 2008. Last revision: April 10, 2008.
00032 
00033 
00034 #ifndef _CMGRAPHS_CONFINFO_H_
00035 #define _CMGRAPHS_CONFINFO_H_
00036 
00037 
00038 // include some standard C++ header files
00039 #include <ostream>
00040 
00041 // include local header files
00042 #include "config.h"
00043 
00044 
00045 // --------------------------------------------------
00046 // ---------------- SHOW CONFIG INFO ----------------
00047 // --------------------------------------------------
00048 
00049 /// Writes the configuration information to the given output stream.
00050 /// Precedes each line with the prefix provided.
00051 /// If the array "maxIter" is given then includes the information
00052 /// on the chunks of the parameter space that will be sent to workers.
00053 inline void showConfigInfo (std::ostream &f, const char *prefix,
00054         const parCoord *maxIter)
00055 {
00056         if (!prefix)
00057                 prefix = "";
00058 
00059         f << prefix << "=================================\n";
00060         f << prefix << "Configuration of the computations\n";
00061         f << prefix << "=================================\n";
00062         f << prefix << "\n";
00063 
00064         f << prefix << "THE PHASE SPACE:\n";
00065         f << prefix << "dim = " << spaceDim << "\n";
00066         f << prefix << "depth: from " << initialDepth << " to " <<
00067                 finalDepth << "\n";
00068 
00069         f << prefix << "offset:";
00070         for (int i = 0; i < spaceDim; ++ i)
00071                 f << (i ? ", " : " ") << spaceOffset [i];
00072         f << "\n";
00073 
00074         f << prefix << "width:";
00075         for (int i = 0; i < spaceDim; ++ i)
00076                 f << (i ? " x " : " ") << spaceWidth [i];
00077         f << "\n";
00078 
00079         f << prefix << "size in cubes:";
00080         for (int i = 0; i < spaceDim; ++ i)
00081                 f << (i ? " x " : " ") << (1 << finalDepth);
00082         f << "\n";
00083         f << prefix << "\n";
00084 
00085         f << prefix << "THE PARAMETER SPACE:\n";
00086         f << prefix << "dim = " << paramDim << "\n";
00087 
00088         f << prefix << "subdivisions:";
00089         for (int i = 0; i < paramDim; ++ i)
00090                 f << (i ? " x " : " ") << paramSubdiv [i];
00091         f << "\n";
00092 
00093         if (maxIter)
00094         {
00095                 f << prefix << "no. of tasks:";
00096                 int nTasks = 1;
00097                 for (int i = 0; i < paramDim; ++ i)
00098                 {
00099                         f << (i ? " x " : " ") << maxIter [i];
00100                         nTasks *= maxIter [i];
00101                 }
00102                 f << " = " << nTasks << "\n";
00103         }
00104 
00105         f << prefix << "selected parameters (see below):";
00106         for (int i = 0; i < paramDim; ++ i)
00107                 f << (i ? ", " : " ") << paramSelect [i];
00108         f << "\n";
00109 
00110         f << prefix << "total number of parameters: " <<
00111                 paramCount << "\n";
00112 
00113         f << prefix << "ranges:";
00114         for (int i = 0; i < paramCount; ++ i)
00115                 f << (i ? " x " : " ") << "[" << paramLeft [i] << "," <<
00116                         paramRight [i] << "]";
00117         f << "\n";
00118         f << prefix << "\n";
00119 
00120         f << prefix << "LIMITATIONS:\n";
00121         f << prefix << "max refine depth = " << refineDepth << "\n";
00122         f << prefix << "max refine size 0 = " << maxRefineSize0 << "\n";
00123         f << prefix << "max refine size 1 = " << maxRefineSize1 << "\n";
00124         f << prefix << "max image diameter = " << maxImageDiameter << "\n";
00125         f << prefix << "max image volume = " << maxImageVolume << "\n";
00126         f << prefix << "max index pair size = " << maxIndexPairSize << "\n";
00127         f << prefix << "\n";
00128 
00129         f << prefix << "OTHER PARAMETERS:\n";
00130         f << prefix << "max join size = " << maxJoinSize << "\n";
00131         f << prefix << "max join connection = " << maxJoinConnection << "\n";
00132         f << prefix << "max join distance = " << maxJoinDistance << "\n";
00133         f << prefix << "compare Morse ordering = " <<
00134                 compareMorseOrdering << "\n";
00135         f << prefix << "ignore isol. for cont. = " <<
00136                 ignoreIsolationForContinuation << "\n";
00137         f << prefix << "\n";
00138 
00139         f << prefix << "=================================\n";
00140         return;
00141 } /* showConfigInfo */
00142 
00143 
00144 #endif // _CMGRAPHS_CONFINFO_H_
00145 

Generated on Sun Mar 28 17:47:57 2010 for The Conley-Morse Graphs Software by  doxygen 1.5.3