|
Teuchos Package Browser (Single Doxygen Collection)
Version of the Day
|
00001 // @HEADER 00002 // *********************************************************************** 00003 // 00004 // Teuchos: Common Tools Package 00005 // Copyright (2004) Sandia Corporation 00006 // 00007 // Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive 00008 // license for use of this work by or on behalf of the U.S. Government. 00009 // 00010 // Redistribution and use in source and binary forms, with or without 00011 // modification, are permitted provided that the following conditions are 00012 // met: 00013 // 00014 // 1. Redistributions of source code must retain the above copyright 00015 // notice, this list of conditions and the following disclaimer. 00016 // 00017 // 2. Redistributions in binary form must reproduce the above copyright 00018 // notice, this list of conditions and the following disclaimer in the 00019 // documentation and/or other materials provided with the distribution. 00020 // 00021 // 3. Neither the name of the Corporation nor the names of the 00022 // contributors may be used to endorse or promote products derived from 00023 // this software without specific prior written permission. 00024 // 00025 // THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY 00026 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 00027 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 00028 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE 00029 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 00030 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 00031 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 00032 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 00033 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 00034 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 00035 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00036 // 00037 // Questions? Contact Michael A. Heroux (maherou@sandia.gov) 00038 // 00039 // *********************************************************************** 00040 // @HEADER 00041 00042 #ifndef TEUCHOS_XMLPERFTESTARCHIVE_HPP 00043 #define TEUCHOS_XMLPERFTESTARCHIVE_HPP 00044 00047 00048 #include <Teuchos_ConfigDefs.hpp> 00049 #include <Teuchos_FileInputSource.hpp> 00050 #include <Teuchos_XMLObject.hpp> 00051 #include <sstream> 00052 00053 //---------------------------------------------------------------------------- 00054 //-------- Identify Compiler Version ----------------------------------------- 00055 //---------------------------------------------------------------------------- 00056 00057 #if defined __ECC || defined __ICC || defined __INTEL_COMPILER 00058 #define TEUCHOS_COMPILER_NAME "Intel C++" 00059 #if defined __ICC 00060 #define TEUCHOS_COMPILER_VERSION __ICC 00061 #else 00062 #if defined __INTEL_COMPILER 00063 #define TEUCHOS_COMPILER_VERSION __INTEL_COMPILER 00064 #else 00065 #define TEUCHOS_COMPILER_VERSION __ECC 00066 #endif 00067 #endif 00068 #define TEUCHOS_COMPILER_INTEL 1 00069 #endif 00070 00071 #if defined __IBMC__ || defined __IBMCPP__ 00072 #define TEUCHOS_COMPILER_NAME "IBM C++" 00073 #if defined __IBMC__ 00074 #define TEUCHOS_COMPILER_VERSION __IBMC__ 00075 #else 00076 #define TEUCHOS_COMPILER_VERSION __IBMCPP__ 00077 #endif 00078 #define TEUCHOS_COMPILER_IBM 1 00079 #endif 00080 00081 #if defined __APPLE_CC__ 00082 /* Apple uses GNU as compiler */ 00083 #define TEUCHOS_COMPILER_APPLECC 1 00084 #endif 00085 00086 #if defined __clang__ 00087 #define TEUCHOS_COMPILER_NAME "Clang" 00088 #define TEUCHOS_COMPILER_VERSION __clang_major__*100+__clang_minor__*10+__clang_patchlevel__ 00089 #define TEUCHOS_COMPILER_CLANG 1 00090 #endif 00091 00092 #if defined __GNUC__ && !defined TEUCHOS_COMPILER_NAME && !defined __clang__ 00093 #define TEUCHOS_COMPILER_NAME "Gnu GCC" 00094 #define TEUCHOS_COMPILER_VERSION __GNUC__*100+__GNUC_MINOR__*10+__GNUC_PATCHLEVEL__ 00095 #define TEUCHOS_COMPILER_GCC 1 00096 #endif 00097 00098 #if defined __PGIC__ && !defined TEUCHOS_COMPILER_NAME 00099 #define TEUCHOS_COMPILER_NAME "PGI C++" 00100 #define TEUCHOS_COMPILER_VERSION __PGIC__*100+__PGIC_MINOR__*10+__PGIC_PATCHLEVEL__ 00101 #define TEUCHOS_COMPILER_PGI 1 00102 #endif 00103 00104 #if defined __NVCC__ 00105 #define TEUCHOS_DEVICE_COMPILER_NAME "NVIDIA NVCC" 00106 #define TEUCHOS_DEVICE_COMPILER_VERSION __NVCC__ 00107 #endif 00108 00109 #if !defined TEUCHOS_COMPILER_NAME 00110 #define TEUCHOS_COMPILER_NAME "Unknown compiler" 00111 #endif 00112 00113 #if !defined TEUCHOS_COMPILER_VERSION 00114 #define TEUCHOS_COMPILER_VERSION 0 00115 #endif 00116 00117 #if !defined TEUCHOS_DEVICE_COMPILER_NAME 00118 #define TEUCHOS_DEVICE_COMPILER_NAME TEUCHOS_COMPILER_NAME 00119 #endif 00120 00121 #if !defined TEUCHOS_DEVICE_COMPILER_VERSION 00122 #define TEUCHOS_DEVICE_COMPILER_VERSION TEUCHOS_COMPILER_VERSION 00123 #endif 00124 00125 namespace Teuchos { 00131 struct ValueTolerance { 00132 double value; 00133 double lower; 00134 double upper; 00135 double tolerance; 00136 bool use_tolerance; 00137 00138 ValueTolerance(); 00139 ValueTolerance(double val, double tol); 00140 ValueTolerance(double val, double low, double up); 00141 00142 ValueTolerance(std::string str); 00143 00144 bool operator ==(ValueTolerance& rhs); 00145 00146 std::string as_string(); 00147 void from_string(const std::string& valtol_str); 00148 }; 00149 00150 00159 class XMLTestNode : public XMLObject { 00160 public: 00161 XMLTestNode(); 00162 XMLTestNode(const std::string &tag); 00163 XMLTestNode(XMLObjectImplem *ptr); 00164 XMLTestNode(XMLObject obj); 00165 void addDouble (const std::string& name, double val); 00166 void addInt (const std::string& name, int val); 00167 void addBool (const std::string& name, bool val); 00168 void addValueTolerance(const std::string& name, ValueTolerance val); 00169 void addString (const std::string& name, std::string val); 00170 00171 template<class T> 00172 void addAttribute (const std::string& name, T val) { 00173 for (size_t i = 0; i < name.length (); i++) { 00174 if (name[i] == ' ') { 00175 return; 00176 } 00177 } 00178 std::ostringstream strs; 00179 strs << val; 00180 XMLTestNode entry (name); 00181 entry.addContent (strs.str ()); 00182 XMLObject::addChild (entry); 00183 } 00184 00185 bool hasChild(const std::string &name) const; 00186 00187 void appendContentLine(const size_t& i, const std::string &str); 00188 00189 XMLTestNode getChild(const std::string &name) const; 00190 00191 XMLTestNode getChild(const int &i) const; 00192 00193 const XMLObject* xml_object() const; 00194 00195 bool hasSameElements(XMLTestNode const & lhs) const; 00196 }; 00197 00214 XMLTestNode PerfTest_MachineConfig(); 00215 00219 enum PerfTestResult {PerfTestFailed, PerfTestPassed, 00220 PerfTestNewMachine, PerfTestNewConfiguration, 00221 PerfTestNewTest, PerfTestNewTestConfiguration, 00222 PerfTestUpdatedTest}; 00223 00270 PerfTestResult 00271 PerfTest_CheckOrAdd_Test (XMLTestNode machine_config, 00272 XMLTestNode new_test, 00273 const std::string filename, 00274 const std::string ext_hostname = std::string ()); 00275 00276 } // namespace Teuchos 00277 00278 #endif
1.7.6.1