From 3b2578396da3fe11b3781868b623d90877b38625 Mon Sep 17 00:00:00 2001 From: Pieter Pas Date: Wed, 23 Aug 2023 21:04:13 +0200 Subject: [PATCH] [Driver] Improve output filenames --- src/alpaqa/src/driver/alpaqa-driver.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/alpaqa/src/driver/alpaqa-driver.cpp b/src/alpaqa/src/driver/alpaqa-driver.cpp index d458835b1c..4f5baac7a9 100644 --- a/src/alpaqa/src/driver/alpaqa-driver.cpp +++ b/src/alpaqa/src/driver/alpaqa-driver.cpp @@ -197,7 +197,9 @@ void store_solution(const fs::path &sol_output_dir, std::ostream &os, auto timestamp_str = std::to_string(results.timestamp); auto rnd_str = random_hex_string(std::random_device()); auto name = results.problem.path.stem().string(); - auto suffix = '_' + name + '_' + timestamp_str + '_' + rnd_str; + if (name == "PROBLEM") + name = results.problem.name; + auto suffix = '_' + name + '_' + timestamp_str + '_' + rnd_str; fs::create_directories(sol_output_dir); std::array solutions{ std::tuple{"solution", "sol_x", &sol_res.solution},