From e47e02e59a4fb6c51d6b7d9cc8a3732cc73dc0ae Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Sun, 20 Jan 2019 01:11:12 +0100 Subject: [PATCH] useless cleanups --- src/simix/ActorImpl.cpp | 2 -- src/simix/libsmx.cpp | 5 +++-- src/simix/smx_global.cpp | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/simix/ActorImpl.cpp b/src/simix/ActorImpl.cpp index 06e64afc33..9f72900aa3 100644 --- a/src/simix/ActorImpl.cpp +++ b/src/simix/ActorImpl.cpp @@ -301,8 +301,6 @@ void create_maestro(simgrid::simix::ActorCode code) if (not code) { maestro->context_ = SIMIX_context_new(simgrid::simix::ActorCode(), nullptr, maestro); } else { - if (not simix_global) - xbt_die("simix is not initialized, please call MSG_init first"); maestro->context_ = simix_global->context_factory->create_maestro(code, maestro); } diff --git a/src/simix/libsmx.cpp b/src/simix/libsmx.cpp index ebfe0c5a39..7269508cc9 100644 --- a/src/simix/libsmx.cpp +++ b/src/simix/libsmx.cpp @@ -384,8 +384,9 @@ int simcall_comm_test(smx_activity_t comm) */ smx_mutex_t simcall_mutex_init() { - if (not simix_global) { - fprintf(stderr,"You must run MSG_init before using MSG\n"); // We can't use xbt_die since we may get there before the initialization + if (simix_global == nullptr) { + fprintf(stderr, "You must initialize the SimGrid engine before using it\n"); // We can't use xbt_die since we may + // get there before the initialization xbt_abort(); } return simgrid::simix::simcall([] { return new simgrid::kernel::activity::MutexImpl(); }); diff --git a/src/simix/smx_global.cpp b/src/simix/smx_global.cpp index 4c53ae65e3..b777616792 100644 --- a/src/simix/smx_global.cpp +++ b/src/simix/smx_global.cpp @@ -179,7 +179,7 @@ void SIMIX_global_init(int *argc, char **argv) simgrid::mc::Client::initialize(); #endif - if (not simix_global) { + if (simix_global == nullptr) { simix_global = std::unique_ptr(new simgrid::simix::Global()); simix_global->maestro_process = nullptr; -- 2.20.1