00001
00002
00003
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
00017
00018
00019
00020
00021
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 }