/******************************* Host simcalls ********************************/
/* TODO use handlers and keep sg_host_t hidden from higher levels */
-XBT_PUBLIC(const char *) simcall_host_get_name(sg_host_t host);
XBT_PUBLIC(xbt_dict_t) simcall_host_get_properties(sg_host_t host);
XBT_PUBLIC(void) simcall_host_on(sg_host_t host);
XBT_PUBLIC(void) simcall_host_off(sg_host_t host);
#include "popping_bodies.c"
-/**
- * \ingroup simix_host_management
- * \brief Returns the name of a host.
- *
- * \param host A SIMIX host
- * \return The name of this host
- */
-const char* simcall_host_get_name(sg_host_t host)
-{
- return simcall_BODY_host_get_name(host);
-}
-
/**
* \ingroup simix_host_management
* \brief Start the host if it is off
*/
-static inline sg_host_t simcall_host_get_name__get__host(smx_simcall_t simcall) {
- return (sg_host_t) simcall->args[0].dp;
-}
-static inline void simcall_host_get_name__set__host(smx_simcall_t simcall, void* arg) {
- simcall->args[0].dp = arg;
-}
-static inline const char* simcall_host_get_name__get__result(smx_simcall_t simcall){
- return simcall->result.cc;
-}
-static inline void simcall_host_get_name__set__result(smx_simcall_t simcall, const char* result){
- simcall->result.cc = result;
-}
-
static inline sg_host_t simcall_host_on__get__host(smx_simcall_t simcall) {
return (sg_host_t) simcall->args[0].dp;
}
#include "src/mc/mc_forward.h"
#include "xbt/ex.h"
-inline static const char* simcall_BODY_host_get_name(sg_host_t host) {
- smx_process_t self = SIMIX_process_self();
-
- /* Go to that function to follow the code flow through the simcall barrier */
- if (0) SIMIX_host_get_name(host);
- /* end of the guide intended to the poor programmer wanting to go from MSG to Surf */
-
- self->simcall.call = SIMCALL_HOST_GET_NAME;
- memset(&self->simcall.result, 0, sizeof(self->simcall.result));
- memset(self->simcall.args, 0, sizeof(self->simcall.args));
- self->simcall.args[0].dp = (void*) host;
- if (self != simix_global->maestro_process) {
- XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
- SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
- SIMIX_process_yield(self);
- } else {
- SIMIX_simcall_handle(&self->simcall, 0);
- }
- return self->simcall.result.cc;
- }
-
inline static void simcall_BODY_host_on(sg_host_t host) {
smx_process_t self = SIMIX_process_self();
*/
typedef enum {
SIMCALL_NONE,
- SIMCALL_HOST_GET_NAME,
SIMCALL_HOST_ON,
SIMCALL_HOST_OFF,
SIMCALL_HOST_GET_PROPERTIES,
/** @brief Simcalls' names (generated from src/simix/simcalls.in) */
const char* simcall_names[] = {
- [SIMCALL_HOST_GET_NAME] = "SIMCALL_HOST_GET_NAME",
[SIMCALL_HOST_ON] = "SIMCALL_HOST_ON",
[SIMCALL_HOST_OFF] = "SIMCALL_HOST_OFF",
[SIMCALL_HOST_GET_PROPERTIES] = "SIMCALL_HOST_GET_PROPERTIES",
if (simcall->issuer->context->iwannadie && simcall->call != SIMCALL_PROCESS_CLEANUP)
return;
switch (simcall->call) {
-case SIMCALL_HOST_GET_NAME:
- simcall->result.cc = SIMIX_host_get_name((sg_host_t) simcall->args[0].dp);
- SIMIX_simcall_answer(simcall);
- break;
-
case SIMCALL_HOST_ON:
SIMIX_host_on((sg_host_t) simcall->args[0].dp);
SIMIX_simcall_answer(simcall);
# ./include/simgrid/simix.h (otherwise you will get a warning at the
# compilation time)
-Func - host_get_name (const char*) (host, void*, sg_host_t)
Proc - host_on (void) (host, void*, sg_host_t)
Proc H host_off (void) (host, void*, sg_host_t)
Func - host_get_properties (void*, xbt_dict_t) (host, void*, sg_host_t)