Skip to content
Snippets Groups Projects
Commit bfce937f authored by Heldmann, Tim's avatar Heldmann, Tim
Browse files

Fix bug in metacg usage and demo script

parent b0b9f35d
Branches
No related tags found
No related merge requests found
......@@ -42,6 +42,9 @@ bool FunctionFinderVisitor::VisitFunctionDecl(clang::FunctionDecl *functionDecl)
//std::cout<<functionDecl->getNameAsString()<<col2str(possibleNames," All possible manglings are:(",",",")")<<"\n";
for(const auto& name : possibleNames){
assert(callgraph->hasNode(name));
// we should find every node in the whole program callgraph
if(!callgraph->hasNode(name)){
SPDLOG_WARN("Node {} is not in the call-graph. Graph might be wrong or incomplete!",name);
......
......@@ -208,14 +208,9 @@ int main(int argc, const char **argv) {
}
auto &mcgManager = metacg::graph::MCGManager::get();
mcgManager.addToManagedGraphs("emptyGraph", std::make_unique<metacg::Callgraph>());
nlohmann::json j = fs.get().at("_CG");
std::cout<<j.dump(4);
metacg::io::VersionTwoMetaCGReader::upgradeV2FormatToV3Format(j);
std::cout<<j.dump(4);
mcgReader->read();
mcgManager.addToManagedGraphs("activeGraph",mcgReader->read());
auto &cg = *mcgManager.getCallgraph();
std::cout<<cg.size()<<"\n";
//Add extraction point gotten via the CLI
for(const auto& extractionFunc : extractionPoints){
......@@ -230,8 +225,6 @@ int main(int argc, const char **argv) {
markFunctionsAlongCallpaths(cg);
tool.run(clang::tooling::newFrontendActionFactory<CTUApexFrontendAction>(
new CTUApexFrontendAction(*mcgManager.getCallgraph())).get());
return 0;
......
......@@ -43,11 +43,11 @@ if (WITH_SILO)
endif()
set(LULESH_SOURCES
lulesh-comm.mini.cc
lulesh-init.mini.cc
lulesh-util.mini.cc
lulesh-viz.mini.cc
lulesh.mini.cc)
lulesh-comm.cc
lulesh-init.cc
lulesh-util.cc
lulesh-viz.cc
lulesh.cc)
set(LULESH_EXEC lulesh2.0)
......
# this is the cgcollector from metacg
cgcollector --metacg-format-version=2 lulesh.cc
cgcollector --metacg-format-version=2 lulesh-init.cc
cgcollector --metacg-format-version=2 lulesh-comm.cc
cgcollector --metacg-format-version=2 lulesh-util.cc
cgcollector --metacg-format-version=2 lulesh-viz.cc
cgcollector -p build --metacg-format-version=2 lulesh.cc
cgcollector -p build --metacg-format-version=2 lulesh-init.cc
cgcollector -p build --metacg-format-version=2 lulesh-comm.cc
cgcollector -p build --metacg-format-version=2 lulesh-util.cc
cgcollector -p build --metacg-format-version=2 lulesh-viz.cc
echo "null" > merged.ipcg
#this is cgmerge from metacg
cgmerge merged.ipcg *.ipcg
sed -i 's/fileProperties/FileProperties/g' merged.ipcg
#this currently uses hardcoded include directories as to be compatible with C++
#this is a terrible solution and is currently being worked on
CTUApex --extra-arg=-I/home/groups/da_sc/moduletree/packages-2023-08-24/.gcc/8.5/clang/15.0.7.debug/include \
--extra-arg=-I/opt/rh/gcc-toolset-12/root/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12 \
--extra-arg=-I/opt/rh/gcc-toolset-12/root/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/x86_64-redhat-linux \
--extra-arg=-I/opt/rh/gcc-toolset-12/root/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/backward \
--extra-arg=-I/work/groups/da_sc/moduletree/packages-2023-08-24/.gcc/8.5.0/clang/debug.15.0.7/lib/clang/15.0.7/include \
--extra-arg=-I/usr/local/include \
--extra-arg=-I/usr/include \
#CTUApex --extra-arg=-I/home/groups/da_sc/moduletree/packages-2023-08-24/.gcc/11.2.0/clang/15.0.7.debug/include \
#--extra-arg=-I/opt/rh/gcc-toolset-12/root/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12 \
#--extra-arg=-I/opt/rh/gcc-toolset-12/root/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/x86_64-redhat-linux \
#--extra-arg=-I/opt/rh/gcc-toolset-12/root/usr/lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/backward \
#--extra-arg=-I/work/groups/da_sc/moduletree/packages-2023-08-24/.gcc/8.5.0/clang/debug.15.0.7/lib/clang/15.0.7/include \
#--extra-arg=-I/usr/local/include \
#--extra-arg=-I/usr/include \
CTUApex \
--cg-file=merged.ipcg \
--extra-arg=-DUSE_MPI=0 \
--log-level=debug \
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment