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);
}
s4u::Host *Actor::getHost() {
- return simcall_process_get_host(pimpl_);
+ return pimpl_->host;
}
const char* Actor::getName() {
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() {
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.
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;
' 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')
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 */
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() {
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);