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

Method WriteHTMLNC

Src/Extern/ProfParser/AMReX_RegionsProfStats.cpp:1096–1311  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

1094
1095// ----------------------------------------------------------------------
1096void RegionsProfStats::WriteHTMLNC(std::ostream &csHTMLFile, int whichProc)
1097{
1098 Vector<std::string> fNumberNames(mFNameNumbersPerProc[whichProc].size());
1099 for(std::map<std::string, int>::const_iterator it = mFNameNumbersPerProc[whichProc].begin();
1100 it != mFNameNumbersPerProc[whichProc].end(); ++it)
1101 {
1102 fNumberNames[it->second] = it->first;
1103 }
1104
1105 // write to html file
1106 std::stack<std::string> listEnds;
1107
1108 csHTMLFile << "<!DOCTYPE html>" << '\n';
1109 csHTMLFile << "<html>" << '\n';
1110 csHTMLFile << "<head>" << '\n';
1111 csHTMLFile << "<title>Call Tree</title>" << '\n';
1112 csHTMLFile << "</head>" << '\n';
1113 csHTMLFile << '\n';
1114
1115 csHTMLFile << "<body>" << '\n';
1116 csHTMLFile << '\n';
1117 csHTMLFile << "<script type=\"text/javascript\">" << '\n';
1118 csHTMLFile << "function collapse(id) {" << '\n';
1119 csHTMLFile << " var elem = document.getElementById(id);" << '\n';
1120 csHTMLFile << " if(elem.style.display == '') {" << '\n';
1121 csHTMLFile << " elem.style.display = 'none';" << '\n';
1122 csHTMLFile << " } else {" << '\n';
1123 csHTMLFile << " elem.style.display = '';" << '\n';
1124 csHTMLFile << " }" << '\n';
1125 csHTMLFile << "}" << '\n';
1126 csHTMLFile << "</script>" << '\n';
1127 csHTMLFile << '\n';
1128
1129 csHTMLFile << "<h3>Function calls "
1130 << "(function number :: function name :: inclusive time :: exclusive time :: 1-e/i % :: ncalls :: callstackdepth)</h3>"
1131 << '\n';
1132
1133 csHTMLFile << "<ul>" << '\n';
1134 listEnds.push("</ul>");
1135
1136// the next two lines will indent the html
1137//#define IcsHTMLFile for(int id(0); id <= listEnds.size(); ++id) csHTMLFile << " "; csHTMLFile
1138//#define IIcsHTMLFile for(int id(0); id < listEnds.size(); ++id) csHTMLFile << " "; csHTMLFile
1139#define IcsHTMLFile csHTMLFile
1140#define IIcsHTMLFile csHTMLFile
1141
1142 CallTreeNode callTree;
1143 callTree.stackDepth = -1;
1144 CallTreeNode *currentCTN(&callTree);
1145 std::map<int, CallTreeNode>::iterator miter;
1146 std::stack<CallTreeNode *> ctStack;
1147 ctStack.push(currentCTN);
1148
1149 int nBlocks(0);
1150 for(int idb(0); idb < dataBlocks.size(); ++idb) {
1151 DataBlock &dBlock = dataBlocks[idb];
1152 if(dBlock.proc == whichProc) {
1153 ++nBlocks;

Callers 1

ProfParserBatchFunctionsFunction · 0.45

Calls 9

CallTreeNodeClass · 0.85
topMethod · 0.80
sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
pushMethod · 0.45
insertMethod · 0.45
popMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected