From 0ffc4789aa9f3b4e65a1fb9916a420697ac5a4c5 Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Sun, 21 May 2017 16:58:11 +0200 Subject: [PATCH] loudly fail when asked to replay a non-existing file --- src/smpi/smpi_replay.cpp | 1 + src/xbt/xbt_replay.cpp | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/smpi/smpi_replay.cpp b/src/smpi/smpi_replay.cpp index ada1fecf98..e226821ad7 100644 --- a/src/smpi/smpi_replay.cpp +++ b/src/smpi/smpi_replay.cpp @@ -106,6 +106,7 @@ static MPI_Datatype decode_datatype(const char *const action) break; default: MPI_CURRENT_TYPE=MPI_DEFAULT_TYPE; + break; } return MPI_CURRENT_TYPE; } diff --git a/src/xbt/xbt_replay.cpp b/src/xbt/xbt_replay.cpp index 408c7f4a13..86f8c7c9d8 100644 --- a/src/xbt/xbt_replay.cpp +++ b/src/xbt/xbt_replay.cpp @@ -34,7 +34,9 @@ class ReplayReader { public: explicit ReplayReader(const char* filename) { - fs = new std::ifstream(filename, std::ifstream::in); + XBT_VERB("Prepare to replay file '%s'", filename); + fs = new std::ifstream(filename, std::ifstream::in); + xbt_assert(fs->is_open(), "Cannot read file %s", filename); } ~ReplayReader() { -- 2.20.1