diff options
author | Gard Spreemann <gard.spreemann@epfl.ch> | 2019-05-10 16:23:56 +0200 |
---|---|---|
committer | Gard Spreemann <gard.spreemann@epfl.ch> | 2019-05-10 16:23:56 +0200 |
commit | 7d9fc408481ff9a165d5a324ea2580fe396b44b2 (patch) | |
tree | d0512734fbf2b3e2e24f3194c911e3bcf7001958 | |
parent | a99391b04635836b028b8f875ac8d99226da4683 (diff) |
Fail more loudly if a diagram file list is missing.
-rw-r--r-- | geom_matching/wasserstein/mpi/main.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/geom_matching/wasserstein/mpi/main.cpp b/geom_matching/wasserstein/mpi/main.cpp index a1d980a..707cd38 100644 --- a/geom_matching/wasserstein/mpi/main.cpp +++ b/geom_matching/wasserstein/mpi/main.cpp @@ -245,6 +245,10 @@ int main(int argc, char ** argv) std::vector<std::string> files_2; std::ifstream list_file(list_1_file_name, std::ios::in); + if (!list_file.is_open()) + { + fail(world_rank, std::string("Failed to load diagram list file ") + list_1_file_name + std::string(".")); + } std::string line; while (std::getline(list_file, line)) { @@ -259,6 +263,10 @@ int main(int argc, char ** argv) else { list_file.open(list_2_file_name, std::ios::in); + if (!list_file.is_open()) + { + fail(world_rank, std::string("Failed to load diagram list file ") + list_2_file_name + std::string(".")); + } while (std::getline(list_file, line)) { files_2.push_back(line); |