/* */
/* This is somehow the "libc" of SimGrid */
-/* Copyright (c) 2010-2014. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2010-2015. The SimGrid Team.
+ * All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
+ * under the terms of the license (GNU LGPL) which comes with this package. */
-#include "mc/mc_replay.h"
+#include "src/mc/mc_replay.h"
#include "smx_private.h"
-#include "mc/mc_forward.h"
+#include "src/mc/mc_forward.h"
#include "xbt/ex.h"
#include <math.h> /* isfinite() */
#include "mc/mc.h"
#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
return simcall_BODY_asr_get_properties(name);
}
-
-/**
- * \ingroup simix_host_management
- * \brief Returns the speed of the processor.
- *
- * The speed returned does not take into account the current load on the machine.
- * \param host A SIMIX host
- * \return The speed of this host (in Mflop/s)
- */
-double simcall_host_get_speed(sg_host_t host)
-{
- return simcall_BODY_host_get_speed(host);
-}
-
-/**
- * \ingroup simix_host_management
- * \brief Returns the number of core of the processor.
- *
- * \param host A SIMIX host
- * \return The number of core
- */
-int simcall_host_get_core(sg_host_t host)
-{
- return simcall_BODY_host_get_core(host);
-}
-
/**
* \ingroup simix_host_management
* \brief Returns the list of processes attached to the host.
return simcall_BODY_host_get_process_list(host);
}
-
-/**
- * \ingroup simix_host_management
- * \brief Returns the available speed of the processor.
- *
- * \return Speed currently available (in Mflop/s)
- */
-double simcall_host_get_available_speed(sg_host_t host)
-{
- return simcall_BODY_host_get_available_speed(host);
-}
-
-/**
- * \ingroup simix_host_management
- * \brief Returns the state of a host.
- *
- * Two states are possible: 1 if the host is active or 0 if it has crashed.
- * \param host A SIMIX host
- * \return 1 if the host is available, 0 otherwise
- */
-int simcall_host_get_state(sg_host_t host)
-{
- return simcall_BODY_host_get_state(host);
-}
-
/**
* \ingroup simix_host_management
* \brief Returns the power peak of a host.
return simcall_BODY_host_get_power_peak_at(host, pstate_index);
}
-/**
- * \ingroup simix_host_management
- * \brief Returns the number of power states for a host.
- *
- * \param host A SIMIX host
- * \return the number of power states
- */
-int simcall_host_get_nb_pstates(sg_host_t host)
-{
- return simcall_BODY_host_get_nb_pstates(host);
-}
-
/**
* \ingroup simix_host_management
* \brief Sets the pstate at which the host should run
{
simcall_BODY_host_set_pstate(host, pstate_index);
}
-/**
- * \ingroup simix_host_management
- * \brief Gets the pstate at which that host currently runs.
- *
- * \param host A SIMIX host
- */
-int simcall_host_get_pstate(sg_host_t host)
-{
- return simcall_BODY_host_get_pstate(host);
-}
-/**
- * \ingroup simix_host_management
- * \brief Returns the total energy consumed by the host (in Joules)
- *
- * \param host A SIMIX host
- * \return the energy consumed by the host (double)
- */
-double simcall_host_get_consumed_energy(sg_host_t host)
-{
- return simcall_BODY_host_get_consumed_energy(host);
-}
/** \ingroup simix_host_management
* \brief Returns the amount of watt dissipated at the given pstate when the host is idling
*/
* \param process the process to migrate
* \param dest name of the new host
*/
-void simcall_process_change_host(smx_process_t process, sg_host_t dest)
+void simcall_process_set_host(smx_process_t process, sg_host_t dest)
{
- simcall_BODY_process_change_host(process, dest);
+ simcall_BODY_process_set_host(process, dest);
}
void simcall_process_join(smx_process_t process, double timeout)
if (kill_time > SIMIX_get_clock()) {
if (simix_global->kill_process_function) {
XBT_DEBUG("Set kill time %f for process %s(%s)",kill_time, process->name,
- sg_host_name(process->host));
+ sg_host_get_name(process->host));
process->kill_timer = SIMIX_timer_set(kill_time, simix_global->kill_process_function, process);
}
}
/**
* \ingroup simix_comm_management
*/
-void simcall_comm_send(smx_process_t src, smx_rdv_t rdv, double task_size, double rate,
+void simcall_comm_send(smx_process_t sender, smx_rdv_t rdv, double task_size, double rate,
void *src_buff, size_t src_buff_size,
int (*match_fun)(void *, void *, smx_synchro_t),
void (*copy_data_fun)(smx_synchro_t, void*, size_t), void *data,
if (MC_is_active() || MC_record_replay_is_active()) {
/* the model-checker wants two separate simcalls */
smx_synchro_t comm = NULL; /* MC needs the comm to be set to NULL during the simcall */
- comm = simcall_comm_isend(src, rdv, task_size, rate,
+ comm = simcall_comm_isend(sender, rdv, task_size, rate,
src_buff, src_buff_size, match_fun, NULL, copy_data_fun, data, 0);
simcall_comm_wait(comm, timeout);
comm = NULL;
}
else {
- simcall_BODY_comm_send(src, rdv, task_size, rate, src_buff, src_buff_size,
+ simcall_BODY_comm_send(sender, rdv, task_size, rate, src_buff, src_buff_size,
match_fun, copy_data_fun, data, timeout);
}
}
/**
* \ingroup simix_comm_management
*/
-smx_synchro_t simcall_comm_isend(smx_process_t src, smx_rdv_t rdv, double task_size, double rate,
+smx_synchro_t simcall_comm_isend(smx_process_t sender, smx_rdv_t rdv, double task_size, double rate,
void *src_buff, size_t src_buff_size,
int (*match_fun)(void *, void *, smx_synchro_t),
void (*clean_fun)(void *),
xbt_assert(rdv, "No rendez-vous point defined for isend");
- return simcall_BODY_comm_isend(src, rdv, task_size, rate, src_buff,
+ return simcall_BODY_comm_isend(sender, rdv, task_size, rate, src_buff,
src_buff_size, match_fun,
clean_fun, copy_data_fun, data, detached);
}
/**
* \ingroup simix_comm_management
*/
-void simcall_comm_recv(smx_rdv_t rdv, void *dst_buff, size_t * dst_buff_size,
+void simcall_comm_recv(smx_process_t receiver, smx_rdv_t rdv, void *dst_buff, size_t * dst_buff_size,
int (*match_fun)(void *, void *, smx_synchro_t),
void (*copy_data_fun)(smx_synchro_t, void*, size_t),
void *data, double timeout, double rate)
if (MC_is_active() || MC_record_replay_is_active()) {
/* the model-checker wants two separate simcalls */
smx_synchro_t comm = NULL; /* MC needs the comm to be set to NULL during the simcall */
- comm = simcall_comm_irecv(rdv, dst_buff, dst_buff_size,
+ comm = simcall_comm_irecv(receiver, rdv, dst_buff, dst_buff_size,
match_fun, copy_data_fun, data, rate);
simcall_comm_wait(comm, timeout);
comm = NULL;
}
else {
- simcall_BODY_comm_recv(rdv, dst_buff, dst_buff_size,
+ simcall_BODY_comm_recv(receiver, rdv, dst_buff, dst_buff_size,
match_fun, copy_data_fun, data, timeout, rate);
}
}
/**
* \ingroup simix_comm_management
*/
-smx_synchro_t simcall_comm_irecv(smx_rdv_t rdv, void *dst_buff, size_t *dst_buff_size,
+smx_synchro_t simcall_comm_irecv(smx_process_t receiver, smx_rdv_t rdv, void *dst_buff, size_t *dst_buff_size,
int (*match_fun)(void *, void *, smx_synchro_t),
void (*copy_data_fun)(smx_synchro_t, void*, size_t),
void *data, double rate)
{
xbt_assert(rdv, "No rendez-vous point defined for irecv");
- return simcall_BODY_comm_irecv(rdv, dst_buff, dst_buff_size,
+ return simcall_BODY_comm_irecv(receiver, rdv, dst_buff, dst_buff_size,
match_fun, copy_data_fun, data, rate);
}