fix a filesystem bug of IOH by pre-creating directories

This commit is contained in:
Johann Dreo 2021-01-23 16:33:44 +01:00
commit 82af0ed674
2 changed files with 10 additions and 1 deletions

View file

@ -93,5 +93,5 @@ endif()
######################################################################################
add_executable(fastga fastga.cpp)
target_link_libraries(fastga ${PARADISEO_LIBRARIES} ${IOH_LIBRARY})
target_link_libraries(fastga ${PARADISEO_LIBRARIES} ${IOH_LIBRARY} stdc++fs)

View file

@ -1,3 +1,4 @@
#include <filesystem>
#include <iostream>
#include <cstdlib>
#include <string>
@ -451,7 +452,15 @@ int main(int argc, char* argv[])
std::clog << desc.str() << std::endl;
std::string dir(name.str());
std::filesystem::path d = name.str();
std::filesystem::create_directory(d);
std::string folder(desc.str());
std::filesystem::path f = desc.str();
std::filesystem::create_directory(d);
std::filesystem::create_directory(d/f);
csv_logger = std::make_shared<IOHprofiler_csv_logger<int>>(dir, folder, name.str(), desc.str());
loggers.add(*csv_logger);
}