MCPcopy Create free account
hub / github.com/AMReX-Codes/amrex / WriteHTML

Method WriteHTML

Src/Extern/ProfParser/AMReX_RegionsProfStats.cpp:841–1057  ·  view source on GitHub ↗

----------------------------------------------------------------------

Source from the content-addressed store, hash-verified

839
840// ----------------------------------------------------------------------
841void RegionsProfStats::WriteHTML(std::ostream &csHTMLFile,
842 bool simpleCombine, int whichProc)
843{
844 BLProfiler::CallStats *combCallStats = 0;
845
846 Vector<std::string> fNumberNames(mFNameNumbersPerProc[whichProc].size());
847 for(std::map<std::string, int>::const_iterator it = mFNameNumbersPerProc[whichProc].begin();
848 it != mFNameNumbersPerProc[whichProc].end(); ++it)
849 {
850 fNumberNames[it->second] = it->first;
851 }
852
853 Real rangeRunTime(0.0);
854 for(std::list<TimeRange>::iterator trisum = filterTimeRanges[whichProc].begin();
855 trisum != filterTimeRanges[whichProc].end(); ++trisum)
856 {
857 rangeRunTime += trisum->stopTime - trisum->startTime;
858 }
859 cout << "rangeRunTime = " << rangeRunTime << endl;
860 Real colorLinkPct(0.05), colorLinkTime(rangeRunTime);
861 std::stack<Real> colorLinkTimeStack;
862 colorLinkTimeStack.push(rangeRunTime);
863
864 // write to html file
865 std::stack<std::string> listEnds;
866
867 csHTMLFile << "<!DOCTYPE html>" << '\n';
868 csHTMLFile << "<html>" << '\n';
869 csHTMLFile << "<head>" << '\n';
870 csHTMLFile << "<title>Call Tree</title>" << '\n';
871 csHTMLFile << "</head>" << '\n';
872 csHTMLFile << '\n';
873
874 csHTMLFile << "<body>" << '\n';
875 csHTMLFile << '\n';
876 csHTMLFile << "<script type=\"text/javascript\">" << '\n';
877 csHTMLFile << "function collapse(id) {" << '\n';
878 csHTMLFile << " var elem = document.getElementById(id);" << '\n';
879 csHTMLFile << " if(elem.style.display == '') {" << '\n';
880 csHTMLFile << " elem.style.display = 'none';" << '\n';
881 csHTMLFile << " } else {" << '\n';
882 csHTMLFile << " elem.style.display = '';" << '\n';
883 csHTMLFile << " }" << '\n';
884 csHTMLFile << "}" << '\n';
885 csHTMLFile << "</script>" << '\n';
886 csHTMLFile << '\n';
887
888 csHTMLFile << "<h3>Function call times "
889 << "(function number :: function name :: inclusive time :: exclusive time :: 1-e/i % :: ncalls :: callstackdepth :: call time)</h3>"
890 << '\n';
891
892 csHTMLFile << "<ul>" << '\n';
893 listEnds.push("</ul>");
894
895// the next two lines will indent the html
896//#define IcsHTMLFile for(int id(0); id <= listEnds.size(); ++id) csHTMLFile << " "; csHTMLFile
897//#define IIcsHTMLFile for(int id(0); id < listEnds.size(); ++id) csHTMLFile << " "; csHTMLFile
898#define IcsHTMLFile csHTMLFile

Callers 1

ProfParserBatchFunctionsFunction · 0.45

Calls 7

topMethod · 0.80
sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
pushMethod · 0.45
emptyMethod · 0.45
popMethod · 0.45

Tested by

no test coverage detected