From: Martin Quinson Date: Sun, 31 Jul 2016 20:45:14 +0000 (+0200) Subject: kill 2 more empty functions: simcall_process_get_name & SIMIX_process_get_name X-Git-Tag: v3_14~672 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/03847b386b2035bec76237eab400aeaf07466496 kill 2 more empty functions: simcall_process_get_name & SIMIX_process_get_name --- diff --git a/include/simgrid/s4u/Actor.hpp b/include/simgrid/s4u/Actor.hpp index 34562df5a8..99f4a8a0e4 100644 --- a/include/simgrid/s4u/Actor.hpp +++ b/include/simgrid/s4u/Actor.hpp @@ -233,7 +233,8 @@ public: /** Ask the actor to die. * * It will only notice your request when doing a simcall next time (a communication or similar). - * SimGrid sometimes have issues when you kill actors that are currently communicating and such. We are working on it to fix the issues. + * SimGrid sometimes have issues when you kill actors that are currently communicating and such. + * We are working on it to fix the issues. */ void kill(); diff --git a/include/simgrid/simix.h b/include/simgrid/simix.h index 76770b2cd3..d28bcd87a9 100644 --- a/include/simgrid/simix.h +++ b/include/simgrid/simix.h @@ -301,7 +301,6 @@ XBT_PUBLIC(int) simcall_process_count(void); XBT_PUBLIC(void *) simcall_process_get_data(smx_process_t process); XBT_PUBLIC(void) simcall_process_set_data(smx_process_t process, void *data); XBT_PUBLIC(void) simcall_process_set_host(smx_process_t process, sg_host_t dest); -XBT_PUBLIC(const char *) simcall_process_get_name(smx_process_t process); XBT_PUBLIC(int) simcall_process_get_PID(smx_process_t process); XBT_PUBLIC(int) simcall_process_get_PPID(smx_process_t process); XBT_PUBLIC(int) simcall_process_is_suspended(smx_process_t process); diff --git a/src/msg/msg_process.cpp b/src/msg/msg_process.cpp index f57209228a..d68bad5f40 100644 --- a/src/msg/msg_process.cpp +++ b/src/msg/msg_process.cpp @@ -388,8 +388,7 @@ int MSG_process_get_PPID(msg_process_t process) */ const char *MSG_process_get_name(msg_process_t process) { - xbt_assert(process != nullptr, "Invalid parameter: First argument must not be nullptr"); - return simcall_process_get_name(process); + return process->name.c_str(); } /** \ingroup m_process_management diff --git a/src/s4u/s4u_actor.cpp b/src/s4u/s4u_actor.cpp index 43fdb29407..79212bc73c 100644 --- a/src/s4u/s4u_actor.cpp +++ b/src/s4u/s4u_actor.cpp @@ -66,7 +66,7 @@ s4u::Host *Actor::getHost() { } const char* Actor::getName() { - return simcall_process_get_name(pimpl_); + return pimpl_->name.c_str(); } int Actor::getPid(){ diff --git a/src/simix/libsmx.cpp b/src/simix/libsmx.cpp index 5a0ab1219d..7b69dee748 100644 --- a/src/simix/libsmx.cpp +++ b/src/simix/libsmx.cpp @@ -514,19 +514,6 @@ double simcall_process_get_kill_time(smx_process_t process) { return SIMIX_timer_get_date(process->kill_timer); } -/** - * \ingroup simix_process_management - * \brief Return the name of an agent. - * - * This functions checks whether \a process is a valid pointer or not and return its name. - * \param process SIMIX process - * \return The process name - */ -const char* simcall_process_get_name(smx_process_t process) -{ - return SIMIX_process_get_name(process); -} - /** * \ingroup simix_process_management * \brief Returns true if the process is suspended . diff --git a/src/simix/popping_generated.cpp b/src/simix/popping_generated.cpp index cbfcc02393..a0f91c5713 100644 --- a/src/simix/popping_generated.cpp +++ b/src/simix/popping_generated.cpp @@ -432,7 +432,7 @@ case SIMCALL_RUN_BLOCKING: break; case SIMCALL_NONE: THROWF(arg_error,0,"Asked to do the noop syscall on %s@%s", - SIMIX_process_get_name(simcall->issuer), + simcall->issuer->name.c_str(), sg_host_get_name(simcall->issuer->host) ); break; diff --git a/src/simix/simcalls.py b/src/simix/simcalls.py index 6d52267b8f..6a6f43478e 100755 --- a/src/simix/simcalls.py +++ b/src/simix/simcalls.py @@ -326,11 +326,9 @@ if __name__ == '__main__': fd.write(' case NUM_SIMCALLS:\n') fd.write(' break;\n') fd.write(' case SIMCALL_NONE:\n') - fd.write( - ' THROWF(arg_error,0,"Asked to do the noop syscall on %s@%s",\n') - fd.write(' SIMIX_process_get_name(simcall->issuer),\n') - fd.write( - ' sg_host_get_name(simcall->issuer->host)\n') + fd.write(' THROWF(arg_error,0,"Asked to do the noop syscall on %s@%s",\n') + fd.write(' simcall->issuer->name.c_str(),\n') + fd.write(' sg_host_get_name(simcall->issuer->host)\n') fd.write(' );\n') fd.write(' break;\n') fd.write('\n') diff --git a/src/simix/smx_process.cpp b/src/simix/smx_process.cpp index f3f986228d..4e4454a6af 100644 --- a/src/simix/smx_process.cpp +++ b/src/simix/smx_process.cpp @@ -725,11 +725,6 @@ const char* SIMIX_process_self_get_name() { if (process == nullptr || process == simix_global->maestro_process) return "maestro"; - return SIMIX_process_get_name(process); -} - -const char* SIMIX_process_get_name(smx_process_t process) -{ return process->name.c_str(); } diff --git a/src/simix/smx_process_private.h b/src/simix/smx_process_private.h index 251c2f71e7..195ed7fa89 100644 --- a/src/simix/smx_process_private.h +++ b/src/simix/smx_process_private.h @@ -133,7 +133,6 @@ XBT_PRIVATE int SIMIX_process_get_PID(smx_process_t self); XBT_PRIVATE int SIMIX_process_get_PPID(smx_process_t self); XBT_PRIVATE void* SIMIX_process_get_data(smx_process_t process); XBT_PRIVATE void SIMIX_process_set_data(smx_process_t process, void *data); -XBT_PRIVATE const char* SIMIX_process_get_name(smx_process_t process); XBT_PRIVATE smx_process_t SIMIX_process_get_by_name(const char* name); XBT_PRIVATE int SIMIX_process_is_suspended(smx_process_t process); XBT_PRIVATE xbt_dict_t SIMIX_process_get_properties(smx_process_t process); diff --git a/src/simix/smx_synchro.cpp b/src/simix/smx_synchro.cpp index cde0af9a52..0db61fd5f3 100644 --- a/src/simix/smx_synchro.cpp +++ b/src/simix/smx_synchro.cpp @@ -168,7 +168,7 @@ void Mutex::unlock(smx_process_t issuer) /* If the mutex is not owned by the issuer, that's not good */ if (issuer != this->owner) THROWF(mismatch_error, 0, "Cannot release that mutex: it was locked by %s (pid:%d), not by you.", - SIMIX_process_get_name(this->owner),SIMIX_process_get_PID(this->owner)); + this->owner->name.c_str(),SIMIX_process_get_PID(this->owner)); if (xbt_swag_size(this->sleeping) > 0) { /*process to wake up */