proginfo.cc

Go to the documentation of this file.
00001 //  $Id: proginfo.cc,v 3.2 2008/05/30 18:21:26 edwards Exp $
00002 /*! \file
00003  *  \brief Print out basic info about this program
00004  */
00005 
00006 #include "chroma_config.h"
00007 #include "chromabase.h"
00008 #include "util/info/printgeom.h"
00009 #include "util/info/proginfo.h"
00010 #include <ctime>
00011 
00012 
00013 namespace Chroma  
00014 {
00015 
00016   //! Print out basic information about this program
00017   /*!
00018    * \ingroup info
00019    *
00020    *
00021    *  \param xml          The XML stream to which to write the information.
00022    */
00023 
00024   void proginfo(XMLWriter& xml)
00025   {
00026     START_CODE();
00027 
00028     push(xml,"ProgramInfo");
00029 
00030     push(xml,"code_version");
00031     write(xml, "chroma", CHROMA_PACKAGE_VERSION);
00032     write(xml, "qdp", QDP_PACKAGE_VERSION);
00033     write(xml, "basePrecision", BASE_PRECISION);
00034     pop(xml);
00035 
00036     std::time_t now;
00037 
00038     if(std::time(&now)==-1)
00039     {
00040       QDPIO::cerr<<"proginfo: Cannot get the time.\n";
00041       return;
00042     }
00043     std::tm *tp = std::localtime(&now);
00044 
00045     char date[64];
00046     std::strftime(date, 63, "%d %b %y %X %Z", tp);
00047     write(xml,"run_date", date);
00048 
00049     printgeom(xml);
00050     pop(xml);
00051 
00052     END_CODE();
00053   }
00054 
00055 }  // end namespace Chroma

Generated on Sun Nov 22 04:33:40 2009 for CHROMA by  doxygen 1.4.7