Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
kill two useless calls: SIMIX_process_get_host & simcall_process_get_host
authorMartin Quinson <martin.quinson@loria.fr>
Sun, 31 Jul 2016 20:30:20 +0000 (22:30 +0200)
committerMartin Quinson <martin.quinson@loria.fr>
Sun, 31 Jul 2016 20:30:20 +0000 (22:30 +0200)
include/simgrid/simix.h
src/s4u/s4u_actor.cpp
src/s4u/s4u_host.cpp
src/simix/libsmx.cpp
src/simix/popping_generated.cpp
src/simix/simcalls.py
src/simix/smx_host.cpp
src/simix/smx_process.cpp
src/simix/smx_process_private.h

index 0deec81..76770b2 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(sg_host_t) simcall_process_get_host(smx_process_t process);
 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);
index 2f97f34..43fdb29 100644 (file)
@@ -62,7 +62,7 @@ void Actor::setAutoRestart(bool autorestart) {
 }
 
 s4u::Host *Actor::getHost() {
-  return simcall_process_get_host(pimpl_);
+  return pimpl_->host;
 }
 
 const char* Actor::getName() {
index 9c3b420..f17f894 100644 (file)
@@ -72,7 +72,7 @@ Host *Host::current(){
   smx_process_t smx_proc = SIMIX_process_self();
   if (smx_proc == nullptr)
     xbt_die("Cannot call Host::current() from the maestro context");
-  return SIMIX_process_get_host(smx_proc);
+  return smx_proc->host;
 }
 
 void Host::turnOn() {
index e812dd7..5a0ab12 100644 (file)
@@ -514,20 +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 location on which an agent is running.
- *
- * This functions returns the sg_host_t corresponding to the location on which
- * \a process is running.
- * \param process SIMIX process
- * \return SIMIX host
- */
-sg_host_t simcall_process_get_host(smx_process_t process)
-{
-  return SIMIX_process_get_host(process);
-}
-
 /**
  * \ingroup simix_process_management
  * \brief Return the name of an agent.
index 3e13053..cbfcc02 100644 (file)
@@ -433,7 +433,7 @@ case SIMCALL_RUN_BLOCKING:
     case SIMCALL_NONE:
       THROWF(arg_error,0,"Asked to do the noop syscall on %s@%s",
           SIMIX_process_get_name(simcall->issuer),
-          sg_host_get_name(SIMIX_process_get_host(simcall->issuer))
+          sg_host_get_name(simcall->issuer->host)
           );
       break;
 
index 9d51800..6d52267 100755 (executable)
@@ -330,7 +330,7 @@ if __name__ == '__main__':
         '      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(SIMIX_process_get_host(simcall->issuer))\n')
+        '          sg_host_get_name(simcall->issuer->host)\n')
     fd.write('          );\n')
     fd.write('      break;\n')
     fd.write('\n')
index a0be3c8..43365f2 100644 (file)
@@ -131,7 +131,7 @@ void SIMIX_host_destroy(void *h)
 sg_host_t SIMIX_host_self(void)
 {
   smx_process_t process = SIMIX_process_self();
-  return (process == nullptr) ? nullptr : SIMIX_process_get_host(process);
+  return (process == nullptr) ? nullptr : process->host;
 }
 
 /* needs to be public and without simcall for exceptions and logging events */
index b9bd15e..f3f9862 100644 (file)
@@ -717,11 +717,6 @@ void SIMIX_process_set_data(smx_process_t process, void *data)
   process->data = data;
 }
 
-sg_host_t SIMIX_process_get_host(smx_process_t process)
-{
-  return process->host;
-}
-
 /* needs to be public and without simcall because it is called
    by exceptions and logging events */
 const char* SIMIX_process_self_get_name() {
index c067fa8..251c2f7 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 sg_host_t SIMIX_process_get_host(smx_process_t process);
 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);