From 288e6aab14cc12e604bd1a12f0cba20d88edf54f Mon Sep 17 00:00:00 2001 From: Desire NUENTSA Date: Mon, 3 Sep 2012 10:33:39 +0200 Subject: Insert XSL styles into output XML files --- bench/spbench/spbench.xsl | 83 ------------------------------------ bench/spbench/spbenchsolver.cpp | 2 +- bench/spbench/spbenchsolver.h | 62 +++++++++++++-------------- bench/spbench/spbenchstyle.h | 94 +++++++++++++++++++++++++++++++++++++++++ 4 files changed, 126 insertions(+), 115 deletions(-) delete mode 100644 bench/spbench/spbench.xsl create mode 100644 bench/spbench/spbenchstyle.h (limited to 'bench/spbench') diff --git a/bench/spbench/spbench.xsl b/bench/spbench/spbench.xsl deleted file mode 100644 index 7727542f8..000000000 --- a/bench/spbench/spbench.xsl +++ /dev/null @@ -1,83 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Matrix N NNZ Sym SPD - - - - -
Compute Time
Solve Time
Total Time
Error - - ( - - ) -
- - -
- -
\ No newline at end of file diff --git a/bench/spbench/spbenchsolver.cpp b/bench/spbench/spbenchsolver.cpp index ff0ce4c7d..4acd0039c 100644 --- a/bench/spbench/spbenchsolver.cpp +++ b/bench/spbench/spbenchsolver.cpp @@ -14,7 +14,7 @@ void bench_printhelp() cout<< " OPTIONS : \n"; cout<< " -h or --help \n print this help and return\n\n"; cout<< " -d matrixdir \n Use matrixdir as the matrix folder instead of the one specified in the environment variable EIGEN_MATRIXDIR\n\n"; - cout<< " -o outputfile.html \n Output the statistics to a html file \n\n"; + cout<< " -o outputfile.xml \n Output the statistics to a xml file \n\n"; cout<< " --eps Sets the relative tolerance for iterative solvers (default 1e-08) \n\n"; cout<< " --maxits Sets the maximum number of iterations (default 1000) \n\n"; diff --git a/bench/spbench/spbenchsolver.h b/bench/spbench/spbenchsolver.h index 99f05aabc..c48ed7aa7 100644 --- a/bench/spbench/spbenchsolver.h +++ b/bench/spbench/spbenchsolver.h @@ -10,7 +10,7 @@ #include #include -#include "Eigen/SparseCore" +#include #include #include #include @@ -22,6 +22,8 @@ #include #include +#include "spbenchstyle.h" + #ifdef EIGEN_CHOLMOD_SUPPORT #include #endif @@ -85,103 +87,103 @@ void printStatheader(std::ofstream& out) // Print XML header // NOTE It would have been much easier to write these XML documents using external libraries like tinyXML or Xerces-C++. - out << " \n"; - out << " \n"; - out << " \n"; - out << "\n\n"; - + out << " \n"; + out << " \n"; + out << "\n]>"; + out << "\n\n\n"; - // Write the root XML element - out << "\n \n" ; + out << "\n \n" ; //root XML element + // Print the xsl style section + printBenchStyle(out); // List all available solvers out << " \n"; #ifdef EIGEN_UMFPACK_SUPPORT - out <<" \n"; + out <<" \n"; out << " LU \n"; out << " UMFPACK \n"; out << " \n"; #endif #ifdef EIGEN_SUPERLU_SUPPORT - out <<" \n"; + out <<" \n"; out << " LU \n"; out << " SUPERLU \n"; out << " \n"; #endif #ifdef EIGEN_CHOLMOD_SUPPORT - out <<" \n"; + out <<" \n"; out << " LLT SP \n"; out << " CHOLMOD \n"; out << " \n"; - out <<" \n"; + out <<" \n"; out << " LLT \n"; out << " CHOLMOD \n"; out << " \n"; - out <<" \n"; + out <<" \n"; out << " LDLT \n"; out << " CHOLMOD \n"; out << " \n"; #endif #ifdef EIGEN_PARDISO_SUPPORT - out <<" \n"; + out <<" \n"; out << " LU \n"; out << " PARDISO \n"; out << " \n"; - out <<" \n"; + out <<" \n"; out << " LLT \n"; out << " PARDISO \n"; out << " \n"; - out <<" \n"; + out <<" \n"; out << " LDLT \n"; out << " PARDISO \n"; out << " \n"; #endif #ifdef EIGEN_PASTIX_SUPPORT - out <<" \n"; + out <<" \n"; out << " LU \n"; out << " PASTIX \n"; out << " \n"; - out <<" \n"; + out <<" \n"; out << " LLT \n"; out << " PASTIX \n"; out << " \n"; - out <<" \n"; + out <<" \n"; out << " LDLT \n"; out << " PASTIX \n"; out << " \n"; #endif - out <<" \n"; + out <<" \n"; out << " BICGSTAB \n"; out << " EIGEN \n"; out << " \n"; - out <<" \n"; + out <<" \n"; out << " BICGSTAB_ILUT \n"; out << " EIGEN \n"; out << " \n"; - out <<" \n"; + out <<" \n"; out << " GMRES_ILUT \n"; out << " EIGEN \n"; out << " \n"; - out <<" \n"; + out <<" \n"; out << " LDLT \n"; out << " EIGEN \n"; out << " \n"; - out <<" \n"; + out <<" \n"; out << " LLT \n"; out << " EIGEN \n"; out << " \n"; - out <<" \n"; + out <<" \n"; out << " CG \n"; out << " EIGEN \n"; out << " \n"; @@ -260,7 +262,7 @@ template void call_directsolver(Solver& solver, const int solver_id, const typename Solver::MatrixType& A, const Matrix& b, const Matrix& refX, std::string& statFile) { std::ofstream statbuf(statFile.c_str(), std::ios::app); - statbuf << " \n"; + statbuf << " \n"; call_solver(solver, solver_id, A, b, refX,statbuf); statbuf << " \n"; statbuf.close(); @@ -273,7 +275,7 @@ void call_itersolver(Solver &solver, const int solver_id, const typename Solver: solver.setMaxIterations(MaximumIters); std::ofstream statbuf(statFile.c_str(), std::ios::app); - statbuf << " \n"; + statbuf << " \n"; call_solver(solver, solver_id, A, b, refX,statbuf); statbuf << " "<< solver.iterations() << "\n"; statbuf << " \n"; @@ -303,7 +305,6 @@ void SelectSolvers(const SparseMatrix&A, unsigned int sym, Matrix solver; call_directsolver(solver, EIGEN_SUPERLU, A, b, refX,statFile); - printStatItem(stat, best_time_id, best_time_val); } #endif @@ -448,7 +449,6 @@ void SelectSolvers(const SparseMatrix&A, unsigned int sym, Matrix solver; // call_itersolver(solver,EIGEN_CG_PRECOND, A, b, refX,statFile); -// printStatItem(stat, best_time_id, best_time_val); // } } // End SPD matrices } @@ -504,8 +504,8 @@ void Browse_Matrices(const string folder, bool statFileExists, std::string& stat if(statFileExists) { std::ofstream statbuf(statFile.c_str(), std::ios::app); - statbuf << " \n"; + statbuf << " \n"; statbuf << " \n"; statbuf.close(); } diff --git a/bench/spbench/spbenchstyle.h b/bench/spbench/spbenchstyle.h new file mode 100644 index 000000000..17a05ce71 --- /dev/null +++ b/bench/spbench/spbenchstyle.h @@ -0,0 +1,94 @@ +// This file is part of Eigen, a lightweight C++ template library +// for linear algebra. +// +// Copyright (C) 2012 Désiré Nuentsa-Wakam +// +// This Source Code Form is subject to the terms of the Mozilla +// Public License v. 2.0. If a copy of the MPL was not distributed +// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + +#ifndef SPBENCHSTYLE_H +#define SPBENCHSTYLE_H + +void printBenchStyle(std::ofstream& out) +{ + out << "\n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + "; + out<<"\n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + "; + + out<<" \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + "; + out<<" \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + "; + out<<" \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ + \n \ +
Matrix N NNZ Sym SPD \n \ + \n \ + \n \ + \n \ + \n \ +
Compute Time
Solve Time
Total Time
Error \n \ + \n \ + (\n \ + \n \ + )\n \ +
\n \ + \n \ + \n \ +
\n \ +
\n\n"; + +} +#endif \ No newline at end of file -- cgit v1.2.3