Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Print state_ in symbolic form.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Mon, 12 Apr 2021 20:45:19 +0000 (22:45 +0200)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Mon, 12 Apr 2021 20:45:19 +0000 (22:45 +0200)
src/kernel/activity/ActivityImpl.cpp
src/s4u/s4u_Exec.cpp

index c6c864b..3ce0954 100644 (file)
@@ -65,7 +65,7 @@ bool ActivityImpl::test()
 
 void ActivityImpl::wait_for(actor::ActorImpl* issuer, double timeout)
 {
-  XBT_DEBUG("Wait for execution of synchro %p, state %d", this, (int)state_);
+  XBT_DEBUG("Wait for execution of synchro %p, state %s", this, to_c_str(state_));
   xbt_assert(std::isfinite(timeout), "timeout is not finite!");
 
   /* Associate this simcall to the synchro */
index 0fe8c0a..192b8d2 100644 (file)
@@ -183,7 +183,7 @@ unsigned int Exec::get_host_number() const
 ExecPtr Exec::set_host(Host* host)
 {
   xbt_assert(state_ == State::INITED || state_ == State::STARTING || state_ == State::STARTED,
-             "Cannot change the host of an exec once it's done (state: %d)", (int)state_);
+             "Cannot change the host of an exec once it's done (state: %s)", to_c_str(state_));
 
   if (state_ == State::STARTED)
     boost::static_pointer_cast<kernel::activity::ExecImpl>(pimpl_)->migrate(host);
@@ -201,7 +201,7 @@ ExecPtr Exec::set_host(Host* host)
 ExecPtr Exec::set_hosts(const std::vector<Host*>& hosts)
 {
   xbt_assert(state_ == State::INITED || state_ == State::STARTING,
-      "Cannot change the hosts of an exec once it's done (state: %d)", (int)state_);
+             "Cannot change the hosts of an exec once it's done (state: %s)", to_c_str(state_));
 
   kernel::actor::simcall(
       [this, hosts] { boost::static_pointer_cast<kernel::activity::ExecImpl>(pimpl_)->set_hosts(hosts); });