Skip to content

Commit

Permalink
feat(structure): updated output structure of the profiler
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasrothenberger committed Oct 17, 2023
1 parent d8c39a6 commit 657fc1b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 12 deletions.
16 changes: 8 additions & 8 deletions DiscoPoP/DiscoPoP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -889,7 +889,7 @@ void DiscoPoP::fillStartEndLineNumbers(Node *root, LoopInfo &LI) {
}

void DiscoPoP::initializeCUIDCounter() {
std::string CUCounterFile = "DP_CUIDCounter.txt";
std::string CUCounterFile = ".discopop/profiler/DP_CUIDCounter.txt";
if (dputil::fexists(CUCounterFile)) {
std::fstream inCUIDCounter(CUCounterFile, std::ios_base::in);;
inCUIDCounter >> CUIDCounter;
Expand Down Expand Up @@ -1830,7 +1830,7 @@ void DiscoPoP::dp_reduction_insert_functions() {

// insert function calls to monitor loop iterations
std::ofstream loop_metadata_file;
loop_metadata_file.open("loop_meta.txt");
loop_metadata_file.open(".discopop/profiler/loop_meta.txt");
int loop_id = 1;
llvm::Type* loop_incr_fn_arg_type = llvm::Type::getInt32Ty(*ctx_);
llvm::ArrayRef<llvm::Type*> loop_incr_fn_args(loop_incr_fn_arg_type);
Expand Down Expand Up @@ -2018,10 +2018,10 @@ bool DiscoPoP::runOnModule(Module &M) {
ctx_ = &module_->getContext();

reduction_file = new std::ofstream();
reduction_file->open("reduction.txt", std::ios_base::app);
reduction_file->open(".discopop/profiler/reduction.txt", std::ios_base::app);

loop_counter_file = new std::ofstream();
loop_counter_file->open("loop_counter_output.txt", std::ios_base::app);
loop_counter_file->open(".discopop/profiler/loop_counter_output.txt", std::ios_base::app);

/*
bool success = dp_reduction_init_util(FileMappingPath);
Expand Down Expand Up @@ -2456,7 +2456,7 @@ bool DiscoPoP::runOnFunction(Function &F) {
// Report statically identified dependencies

staticDependencyFile = new std::ofstream();
staticDependencyFile->open("static_dependencies.txt", std::ios_base::app);
staticDependencyFile->open(".discopop/profiler/static_dependencies.txt", std::ios_base::app);

for (auto pair: conditionalBBDepMap) {
for (auto s: pair.second) {
Expand Down Expand Up @@ -2866,13 +2866,13 @@ string DiscoPoP::xmlEscape(string data) {

void DiscoPoP::secureStream() {
outOriginalVariables = new std::ofstream();
outOriginalVariables->open("OriginalVariables.txt", std::ios_base::app);
outOriginalVariables->open(".discopop/profiler/OriginalVariables.txt", std::ios_base::app);

outCUs = new std::ofstream();
outCUs->open("Data.xml", std::ios_base::app);
outCUs->open(".discopop/profiler/Data.xml", std::ios_base::app);

outCUIDCounter = new std::ofstream();
outCUIDCounter->open("DP_CUIDCounter.txt", std::ios_base::out);
outCUIDCounter->open(".discopop/profiler/DP_CUIDCounter.txt", std::ios_base::out);
}

string DiscoPoP::getLineNumbersString(set<int> LineNumbers) {
Expand Down
5 changes: 3 additions & 2 deletions rtlib/iFunctions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ namespace __dp {

void outputAllocations() {
auto allocationsFileStream = new ofstream();
allocationsFileStream->open("memory_regions.txt", ios::out);
allocationsFileStream->open(".discopop/profiler/memory_regions.txt", ios::out);
for(auto memoryRegion : *allocatedMemoryRegions){
string position = decodeLID(get<0>(memoryRegion));
string id = get<1>(memoryRegion);
Expand Down Expand Up @@ -1088,7 +1088,8 @@ namespace __dp {
selfPath = nullptr;
out->open("Output.txt", ios::out);
}
out->open(string(selfPath) + "_dep.txt", ios::out);
//out->open(string(selfPath) + "_dep.txt", ios::out); # results in the old <prog>_dep.txt
out->open(".discopop/profiler/dynamic_dependencies.txt", ios::out);
}
#else
out->open("Output.txt", ios::out);
Expand Down
4 changes: 2 additions & 2 deletions rtlib/loop_counter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ void loop_counter_output() {
// get meta information about the loops
std::vector <loop_info_t> loop_infos;
loop_infos.push_back(loop_info_t()); // dummy
ifile.open("loop_meta.txt");
ifile.open(".discopop/profiler/loop_meta.txt");
while (std::getline(ifile, line)) {
loop_info_t loop_info;
int cnt = sscanf(line.c_str(), "%d %d %d", &loop_info.file_id_,
Expand All @@ -69,7 +69,7 @@ void loop_counter_output() {
ifile.close();

// output information about the loops
ofile.open("loop_counter_output.txt");
ofile.open(".discopop/profiler/loop_counter_output.txt");
for (auto i = 1; i < lc.loop_counters_.size(); ++i) {
loop_info_t &loop_info = loop_infos[i];
ofile << loop_info.file_id_ << " ";
Expand Down

0 comments on commit 657fc1b

Please sign in to comment.