Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
kill 2 more empty functions: simcall_process_get_name & SIMIX_process_get_name
authorMartin Quinson <martin.quinson@loria.fr>
Sun, 31 Jul 2016 20:45:14 +0000 (22:45 +0200)
committerMartin Quinson <martin.quinson@loria.fr>
Sun, 31 Jul 2016 20:45:14 +0000 (22:45 +0200)
include/simgrid/s4u/Actor.hpp
include/simgrid/simix.h
src/msg/msg_process.cpp
src/s4u/s4u_actor.cpp
src/simix/libsmx.cpp
src/simix/popping_generated.cpp
src/simix/simcalls.py
src/simix/smx_process.cpp
src/simix/smx_process_private.h
src/simix/smx_synchro.cpp

index 34562df..99f4a8a 100644 (file)
@@ -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();
 
index 76770b2..d28bcd8 100644 (file)
@@ -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);
index f572092..d68bad5 100644 (file)
@@ -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
index 43fdb29..79212bc 100644 (file)
@@ -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(){
index 5a0ab12..7b69dee 100644 (file)
@@ -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 .
index cbfcc02..a0f91c5 100644 (file)
@@ -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;
index 6d52267..6a6f434 100755 (executable)
@@ -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')
index f3f9862..4e4454a 100644 (file)
@@ -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();
 }
 
index 251c2f7..195ed7f 100644 (file)
@@ -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);
index cde0af9..0db61fd 100644 (file)
@@ -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 */