typedef simgrid_As *AS_t;
typedef simgrid_Host* sg_host_t;
-typedef kernel_Activity *smx_synchro_t;
+typedef kernel_Activity *smx_activity_t;
typedef surf_Cpu *surf_cpu_t;
typedef routing_NetCard *sg_netcard_t;
XBT_PUBLIC(msg_comm_t) MSG_task_isend(msg_task_t task, const char *alias);
XBT_PUBLIC(msg_comm_t) MSG_task_isend_bounded(msg_task_t task, const char *alias, double maxrate);
XBT_PUBLIC(msg_comm_t) MSG_task_isend_with_matching(msg_task_t task, const char *alias,
- int (*match_fun)(void*,void*, smx_synchro_t), void *match_data);
+ int (*match_fun)(void*,void*, smx_activity_t), void *match_data);
XBT_PUBLIC(void) MSG_task_dsend(msg_task_t task, const char *alias, void_f_pvoid_t cleanup);
XBT_PUBLIC(void) MSG_task_dsend_bounded(msg_task_t task, const char *alias, void_f_pvoid_t cleanup, double maxrate);
/* FIXME: expose these elements in the API */
int detached_ = 0;
- int (*matchFunction_)(void *, void *, smx_synchro_t) = nullptr;
+ int (*matchFunction_)(void *, void *, smx_activity_t) = nullptr;
void (*cleanFunction_)(void *) = nullptr;
- void (*copyDataFunction_)(smx_synchro_t, void*, size_t) = nullptr;
+ void (*copyDataFunction_)(smx_activity_t, void*, size_t) = nullptr;
smx_process_t sender_ = nullptr;
smx_process_t receiver_ = nullptr;
bool empty();
/** Returns the first element in the queue, or nullptr if none is there */
- smx_synchro_t front();
+ smx_activity_t front();
/** Declare that the specified process is a permanent receiver on that mailbox
*
XBT_PUBLIC(void) SIMIX_process_on_exit(smx_process_t process, int_f_pvoid_pvoid_t fun, void *data);
/****************************** Communication *********************************/
-XBT_PUBLIC(void) SIMIX_comm_set_copy_data_callback(void (*callback) (smx_synchro_t, void*, size_t));
-XBT_PUBLIC(void) SIMIX_comm_copy_pointer_callback(smx_synchro_t comm, void* buff, size_t buff_size);
-XBT_PUBLIC(void) SIMIX_comm_copy_buffer_callback(smx_synchro_t comm, void* buff, size_t buff_size);
+XBT_PUBLIC(void) SIMIX_comm_set_copy_data_callback(void (*callback) (smx_activity_t, void*, size_t));
+XBT_PUBLIC(void) SIMIX_comm_copy_pointer_callback(smx_activity_t comm, void* buff, size_t buff_size);
+XBT_PUBLIC(void) SIMIX_comm_copy_buffer_callback(smx_activity_t comm, void* buff, size_t buff_size);
-XBT_PUBLIC(smx_synchro_t) SIMIX_comm_get_send_match(smx_mailbox_t mbox, int (*match_fun)(void*, void*), void* data);
+XBT_PUBLIC(smx_activity_t) SIMIX_comm_get_send_match(smx_mailbox_t mbox, int (*match_fun)(void*, void*), void* data);
XBT_PUBLIC(int) SIMIX_comm_has_send_match(smx_mailbox_t mbox, int (*match_fun)(void*, void*), void* data);
XBT_PUBLIC(int) SIMIX_comm_has_recv_match(smx_mailbox_t mbox, int (*match_fun)(void*, void*), void* data);
-XBT_PUBLIC(void) SIMIX_comm_finish(smx_synchro_t synchro);
+XBT_PUBLIC(void) SIMIX_comm_finish(smx_activity_t synchro);
/******************************************************************************/
/* SIMIX simcalls */
/******************************* Host simcalls ********************************/
XBT_PUBLIC(void) simcall_host_set_data(sg_host_t host, void *data);
-XBT_PUBLIC(smx_synchro_t) simcall_execution_start(const char *name,
+XBT_PUBLIC(smx_activity_t) simcall_execution_start(const char *name,
double flops_amount,
double priority, double bound, unsigned long affinity_mask);
-XBT_PUBLIC(smx_synchro_t) simcall_execution_parallel_start(const char *name,
+XBT_PUBLIC(smx_activity_t) simcall_execution_parallel_start(const char *name,
int host_nb,
sg_host_t *host_list,
double *flops_amount,
double *bytes_amount,
double amount,
double rate);
-XBT_PUBLIC(void) simcall_execution_cancel(smx_synchro_t execution);
-XBT_PUBLIC(void) simcall_execution_set_priority(smx_synchro_t execution, double priority);
-XBT_PUBLIC(void) simcall_execution_set_bound(smx_synchro_t execution, double bound);
-XBT_PUBLIC(void) simcall_execution_set_affinity(smx_synchro_t execution, sg_host_t host, unsigned long mask);
-XBT_PUBLIC(e_smx_state_t) simcall_execution_wait(smx_synchro_t execution);
+XBT_PUBLIC(void) simcall_execution_cancel(smx_activity_t execution);
+XBT_PUBLIC(void) simcall_execution_set_priority(smx_activity_t execution, double priority);
+XBT_PUBLIC(void) simcall_execution_set_bound(smx_activity_t execution, double bound);
+XBT_PUBLIC(void) simcall_execution_set_affinity(smx_activity_t execution, sg_host_t host, unsigned long mask);
+XBT_PUBLIC(e_smx_state_t) simcall_execution_wait(smx_activity_t execution);
/******************************* VM simcalls ********************************/
// Create the vm_workstation at the SURF level
XBT_PUBLIC(void) simcall_comm_send(smx_process_t sender, smx_mailbox_t mbox, 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),
+ int (*match_fun)(void *, void *, smx_activity_t),
+ void (*copy_data_fun)(smx_activity_t, void*, size_t),
void *data, double timeout);
-XBT_PUBLIC(smx_synchro_t) simcall_comm_isend(smx_process_t sender, smx_mailbox_t mbox,
+XBT_PUBLIC(smx_activity_t) simcall_comm_isend(smx_process_t sender, smx_mailbox_t mbox,
double task_size,
double rate, void *src_buff,
size_t src_buff_size,
- int (*match_fun)(void *, void *, smx_synchro_t),
+ int (*match_fun)(void *, void *, smx_activity_t),
void (*clean_fun)(void *),
- void (*copy_data_fun)(smx_synchro_t, void*, size_t),
+ void (*copy_data_fun)(smx_activity_t, void*, size_t),
void *data, int detached);
XBT_PUBLIC(void) simcall_comm_recv(smx_process_t receiver, smx_mailbox_t mbox, 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),
+ int (*match_fun)(void *, void *, smx_activity_t),
+ void (*copy_data_fun)(smx_activity_t, void*, size_t),
void *data, double timeout, double rate);
-XBT_PUBLIC(smx_synchro_t) simcall_comm_irecv(smx_process_t receiver, smx_mailbox_t mbox, void *dst_buff,
+XBT_PUBLIC(smx_activity_t) simcall_comm_irecv(smx_process_t receiver, smx_mailbox_t mbox, 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),
+ int (*match_fun)(void *, void *, smx_activity_t),
+ void (*copy_data_fun)(smx_activity_t, void*, size_t),
void *data, double rate);
-XBT_PUBLIC(smx_synchro_t) simcall_comm_iprobe(smx_mailbox_t mbox, int type, int src, int tag,
- int (*match_fun)(void *, void *, smx_synchro_t), void *data);
-XBT_PUBLIC(void) simcall_comm_cancel(smx_synchro_t comm);
+XBT_PUBLIC(smx_activity_t) simcall_comm_iprobe(smx_mailbox_t mbox, int type, int src, int tag,
+ int (*match_fun)(void *, void *, smx_activity_t), void *data);
+XBT_PUBLIC(void) simcall_comm_cancel(smx_activity_t comm);
/* FIXME: waitany is going to be a vararg function, and should take a timeout */
XBT_PUBLIC(unsigned int) simcall_comm_waitany(xbt_dynar_t comms, double timeout);
-XBT_PUBLIC(void) simcall_comm_wait(smx_synchro_t comm, double timeout);
-XBT_PUBLIC(int) simcall_comm_test(smx_synchro_t comm);
-XBT_PUBLIC(int) simcall_comm_testany(smx_synchro_t* comms, size_t count);
+XBT_PUBLIC(void) simcall_comm_wait(smx_activity_t comm, double timeout);
+XBT_PUBLIC(int) simcall_comm_test(smx_activity_t comm);
+XBT_PUBLIC(int) simcall_comm_testany(smx_activity_t* comms, size_t count);
/************************** Tracing handling **********************************/
-XBT_PUBLIC(void) simcall_set_category(smx_synchro_t synchro, const char *category);
+XBT_PUBLIC(void) simcall_set_category(smx_activity_t synchro, const char *category);
/************************** Synchro simcalls **********************************/
XBT_PUBLIC(smx_mutex_t) simcall_mutex_init();
bool detached = false; /* If detached or not */
void (*clean_fun)(void*) = nullptr; /* Function to clean the detached src_buf if something goes wrong */
- int (*match_fun)(void*,void*,smx_synchro_t) = nullptr; /* Filter function used by the other side. It is used when
+ int (*match_fun)(void*,void*,smx_activity_t) = nullptr; /* Filter function used by the other side. It is used when
looking if a given communication matches my needs. For that, myself must match the
expectations of the other side, too. See */
- void (*copy_data_fun) (smx_synchro_t, void*, size_t) =nullptr;
+ void (*copy_data_fun) (smx_activity_t, void*, size_t) =nullptr;
/* Surf action data */
surf_action_t surf_comm = nullptr; /* The Surf communication action encapsulated */
mc_model_checker->process().read_bytes(
&comms, sizeof(comms), remote(simcall_comm_waitany__get__comms(req)));
if (!xbt_dynar_is_empty(&comms)) {
- smx_synchro_t remote_sync;
+ smx_activity_t remote_sync;
read_element(mc_model_checker->process(),
&remote_sync, remote(simcall_comm_waitany__get__comms(req)), value,
sizeof(remote_sync));
bool request_is_enabled_by_idx(smx_simcall_t req, unsigned int idx)
{
- smx_synchro_t remote_act = nullptr;
+ smx_activity_t remote_act = nullptr;
switch (req->call) {
case SIMCALL_COMM_WAIT:
else
label = simgrid::xbt::string_printf("[(%lu)] WaitTimeout", issuer->pid);
} else {
- smx_synchro_t remote_act = simcall_comm_wait__get__comm(req);
+ smx_activity_t remote_act = simcall_comm_wait__get__comm(req);
simgrid::mc::Remote<simgrid::kernel::activity::Comm> temp_comm;
mc_model_checker->process().read(temp_comm, remote(
static_cast<simgrid::kernel::activity::Comm*>(remote_act)));
}
case SIMCALL_COMM_TEST: {
- smx_synchro_t remote_act = simcall_comm_test__get__comm(req);
+ smx_activity_t remote_act = simcall_comm_test__get__comm(req);
simgrid::mc::Remote<simgrid::kernel::activity::Comm> temp_comm;
mc_model_checker->process().read(temp_comm, remote(
static_cast<simgrid::kernel::activity::Comm*>(remote_act)));
case SIMCALL_COMM_WAITANY: {
state->internal_req.call = SIMCALL_COMM_WAIT;
state->internal_req.issuer = req->issuer;
- smx_synchro_t remote_comm;
+ smx_activity_t remote_comm;
read_element(mc_model_checker->process(),
&remote_comm, remote(simcall_comm_waitany__get__comms(req)),
state->transition.argument, sizeof(remote_comm));
state->internal_req.issuer = req->issuer;
if (state->transition.argument > 0) {
- smx_synchro_t remote_comm = mc_model_checker->process().read(
+ smx_activity_t remote_comm = mc_model_checker->process().read(
remote(simcall_comm_testany__get__comms(req) + state->transition.argument));
mc_model_checker->process().read(state->internal_comm, remote(
static_cast<simgrid::kernel::activity::Comm*>(remote_comm)));
struct PatternCommunication {
int num = 0;
- smx_synchro_t comm_addr;
+ smx_activity_t comm_addr;
PatternCommunicationType type = PatternCommunicationType::send;
unsigned long src_proc = 0;
unsigned long dst_proc = 0;
/* Internal function used to factorize code between MSG_task_isend_with_matching() and MSG_task_dsend(). */
static inline msg_comm_t MSG_task_isend_internal(msg_task_t task, const char *alias,
- int (*match_fun)(void*,void*, smx_synchro_t),
+ int (*match_fun)(void*,void*, smx_activity_t),
void *match_data, void_f_pvoid_t cleanup, int detached)
{
simdata_task_t t_simdata = nullptr;
msg_global->sent_msg++;
/* Send it by calling SIMIX network layer */
- smx_synchro_t act = simcall_comm_isend(myself, mailbox->getImpl(), t_simdata->bytes_amount, t_simdata->rate,
+ smx_activity_t act = simcall_comm_isend(myself, mailbox->getImpl(), t_simdata->bytes_amount, t_simdata->rate,
task, sizeof(void *), match_fun, cleanup, nullptr, match_data,detached);
t_simdata->comm = static_cast<simgrid::kernel::activity::Comm*>(act);
* \return the msg_comm_t communication created
*/
msg_comm_t MSG_task_isend_with_matching(msg_task_t task, const char *alias,
- int (*match_fun)(void*, void*, smx_synchro_t), void *match_data)
+ int (*match_fun)(void*, void*, smx_activity_t), void *match_data)
{
return MSG_task_isend_internal(task, alias, match_fun, match_data, nullptr, 0);
}
int finished_index = -1;
/* create the equivalent dynar with SIMIX objects */
- xbt_dynar_t s_comms = xbt_dynar_new(sizeof(smx_synchro_t), nullptr);
+ xbt_dynar_t s_comms = xbt_dynar_new(sizeof(smx_activity_t), nullptr);
msg_comm_t comm;
unsigned int cursor;
xbt_dynar_foreach(comms, cursor, comm) {
* \param buff the data copied
* \param buff_size size of the buffer
*/
-void MSG_comm_copy_data_from_SIMIX(smx_synchro_t synchro, void* buff, size_t buff_size)
+void MSG_comm_copy_data_from_SIMIX(smx_activity_t synchro, void* buff, size_t buff_size)
{
simgrid::kernel::activity::Comm *comm = static_cast<simgrid::kernel::activity::Comm*>(synchro);
/* Try to send it by calling SIMIX network layer */
try {
- smx_synchro_t comm = nullptr; /* MC needs the comm to be set to nullptr during the simix call */
+ smx_activity_t comm = nullptr; /* MC needs the comm to be set to nullptr during the simix call */
comm = simcall_comm_isend(SIMIX_process_self(), mailbox->getImpl(),t_simdata->bytes_amount,
t_simdata->rate, task, sizeof(void *), nullptr, nullptr, nullptr, task, 0);
if (TRACE_is_enabled())
typedef struct simdata_process {
msg_host_t m_host; /* the host on which the process is running */
msg_host_t put_host; /* used for debugging purposes */
- smx_synchro_t waiting_action;
+ smx_activity_t waiting_action;
msg_task_t waiting_task;
msg_error_t last_errno; /* the last value returned by a MSG_function */
} s_process_arg_t, *process_arg_t;
typedef struct msg_comm {
- smx_synchro_t s_comm; /* SIMIX communication object encapsulated (the same for both processes) */
+ smx_activity_t s_comm; /* SIMIX communication object encapsulated (the same for both processes) */
msg_task_t task_sent; /* task sent (NULL for the receiver) */
msg_task_t *task_received; /* where the task will be received (NULL for the sender) */
msg_error_t status; /* status of the communication once finished */
const char *hostname, double kill_time,
xbt_dict_t properties, int auto_restart,
smx_process_t parent_process);
-XBT_PRIVATE void MSG_comm_copy_data_from_SIMIX(smx_synchro_t comm, void* buff, size_t buff_size);
+XBT_PRIVATE void MSG_comm_copy_data_from_SIMIX(smx_activity_t comm, void* buff, size_t buff_size);
XBT_PRIVATE void MSG_post_create_environment();
}
e_smx_state_t execute(double flops) {
- smx_synchro_t s = simcall_execution_start(nullptr,flops,1.0/*priority*/,0./*bound*/, 0L/*affinity*/);
+ smx_activity_t s = simcall_execution_start(nullptr,flops,1.0/*priority*/,0./*bound*/, 0L/*affinity*/);
return simcall_execution_wait(s);
}
return pimpl_->comm_queue.empty();
}
-smx_synchro_t Mailbox::front()
+smx_activity_t Mailbox::front()
{
return pimpl_->comm_queue.empty() ? nullptr : pimpl_->comm_queue.front();
}
xbt_os_mutex_acquire(simix_global->mutex);
/* cancel non-blocking communications */
- smx_synchro_t synchro = static_cast<smx_synchro_t>(xbt_fifo_pop(process->comms));
+ smx_activity_t synchro = static_cast<smx_activity_t>(xbt_fifo_pop(process->comms));
while (synchro != nullptr) {
simgrid::kernel::activity::Comm *comm = static_cast<simgrid::kernel::activity::Comm*>(synchro);
} else {
xbt_die("Communication synchro %p is in my list but I'm not the sender nor the receiver", synchro);
}
- synchro = static_cast<smx_synchro_t>(xbt_fifo_pop(process->comms));
+ synchro = static_cast<smx_activity_t>(xbt_fifo_pop(process->comms));
}
XBT_DEBUG("%p should not be run anymore",process);
void simcall_HANDLER_process_suspend(smx_simcall_t simcall, smx_process_t process)
{
- smx_synchro_t sync_suspend = SIMIX_process_suspend(process, simcall->issuer);
+ smx_activity_t sync_suspend = SIMIX_process_suspend(process, simcall->issuer);
if (process != simcall->issuer) {
SIMIX_simcall_answer(simcall);
/* If we are suspending ourselves, then just do not finish the simcall now */
}
-smx_synchro_t SIMIX_process_suspend(smx_process_t process, smx_process_t issuer)
+smx_activity_t SIMIX_process_suspend(smx_process_t process, smx_process_t issuer)
{
if (process->suspended) {
XBT_DEBUG("Process '%s' is already suspended", process->name.c_str());
SIMIX_simcall_answer(simcall);
return;
}
- smx_synchro_t sync = SIMIX_process_join(simcall->issuer, process, timeout);
+ smx_activity_t sync = SIMIX_process_join(simcall->issuer, process, timeout);
sync->simcalls.push_back(simcall);
simcall->issuer->waiting_synchro = sync;
}
-static int SIMIX_process_join_finish(smx_process_exit_status_t status, smx_synchro_t synchro){
+static int SIMIX_process_join_finish(smx_process_exit_status_t status, smx_activity_t synchro){
simgrid::kernel::activity::Sleep *sleep = static_cast<simgrid::kernel::activity::Sleep*>(synchro);
if (sleep->surf_sleep) {
return 0;
}
-smx_synchro_t SIMIX_process_join(smx_process_t issuer, smx_process_t process, double timeout)
+smx_activity_t SIMIX_process_join(smx_process_t issuer, smx_process_t process, double timeout)
{
- smx_synchro_t res = SIMIX_process_sleep(issuer, timeout);
+ smx_activity_t res = SIMIX_process_sleep(issuer, timeout);
static_cast<simgrid::kernel::activity::ActivityImpl*>(res)->ref();
SIMIX_process_on_exit(process, (int_f_pvoid_pvoid_t)SIMIX_process_join_finish, res);
return res;
SIMIX_simcall_answer(simcall);
return;
}
- smx_synchro_t sync = SIMIX_process_sleep(simcall->issuer, duration);
+ smx_activity_t sync = SIMIX_process_sleep(simcall->issuer, duration);
sync->simcalls.push_back(simcall);
simcall->issuer->waiting_synchro = sync;
}
-smx_synchro_t SIMIX_process_sleep(smx_process_t process, double duration)
+smx_activity_t SIMIX_process_sleep(smx_process_t process, double duration)
{
sg_host_t host = process->host;
return synchro;
}
-void SIMIX_process_sleep_destroy(smx_synchro_t synchro)
+void SIMIX_process_sleep_destroy(smx_activity_t synchro)
{
XBT_DEBUG("Destroy synchro %p", synchro);
simgrid::kernel::activity::Sleep *sleep = static_cast<simgrid::kernel::activity::Sleep*>(synchro);
bool auto_restart = false;
sg_host_t new_host = nullptr; /* if not null, the host on which the process must migrate to */
- smx_synchro_t waiting_synchro = nullptr; /* the current blocking synchro if any */
+ smx_activity_t waiting_synchro = nullptr; /* the current blocking synchro if any */
xbt_fifo_t comms = nullptr; /* the current non-blocking communication synchros */
xbt_dict_t properties = nullptr;
s_smx_simcall_t simcall;
XBT_PRIVATE void SIMIX_process_yield(smx_process_t self);
XBT_PRIVATE void SIMIX_process_exception_terminate(xbt_ex_t * e);
XBT_PRIVATE void SIMIX_process_change_host(smx_process_t process, sg_host_t dest);
-XBT_PRIVATE smx_synchro_t SIMIX_process_suspend(smx_process_t process, smx_process_t issuer);
+XBT_PRIVATE smx_activity_t SIMIX_process_suspend(smx_process_t process, smx_process_t issuer);
XBT_PRIVATE void SIMIX_process_resume(smx_process_t process, smx_process_t issuer);
XBT_PRIVATE int SIMIX_process_get_PID(smx_process_t self);
XBT_PRIVATE void* SIMIX_process_get_data(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);
-XBT_PRIVATE smx_synchro_t SIMIX_process_join(smx_process_t issuer, smx_process_t process, double timeout);
-XBT_PRIVATE smx_synchro_t SIMIX_process_sleep(smx_process_t process, double duration);
+XBT_PRIVATE smx_activity_t SIMIX_process_join(smx_process_t issuer, smx_process_t process, double timeout);
+XBT_PRIVATE smx_activity_t SIMIX_process_sleep(smx_process_t process, double duration);
-XBT_PRIVATE void SIMIX_process_sleep_destroy(smx_synchro_t synchro);
+XBT_PRIVATE void SIMIX_process_sleep_destroy(smx_activity_t synchro);
XBT_PRIVATE void SIMIX_process_auto_restart_set(smx_process_t process, int auto_restart);
XBT_PRIVATE smx_process_t SIMIX_process_restart(smx_process_t process, smx_process_t issuer);
* \param affinity_mask
* \return A new SIMIX execution synchronization
*/
-smx_synchro_t simcall_execution_start(const char *name,
+smx_activity_t simcall_execution_start(const char *name,
double flops_amount,
double priority, double bound, unsigned long affinity_mask)
{
* \param rate the SURF action rate
* \return A new SIMIX execution synchronization
*/
-smx_synchro_t simcall_execution_parallel_start(const char *name,
+smx_activity_t simcall_execution_parallel_start(const char *name,
int host_nb,
sg_host_t *host_list,
double *flops_amount,
* This functions stops the execution. It calls a surf function.
* \param execution The execution synchro to cancel
*/
-void simcall_execution_cancel(smx_synchro_t execution)
+void simcall_execution_cancel(smx_activity_t execution)
{
simcall_BODY_execution_cancel(execution);
}
* \param execution The execution synchro
* \param priority The new priority
*/
-void simcall_execution_set_priority(smx_synchro_t execution, double priority)
+void simcall_execution_set_priority(smx_activity_t execution, double priority)
{
/* checking for infinite values */
xbt_assert(std::isfinite(priority), "priority is not finite!");
* \param execution The execution synchro
* \param bound The new bound
*/
-void simcall_execution_set_bound(smx_synchro_t execution, double bound)
+void simcall_execution_set_bound(smx_activity_t execution, double bound)
{
simcall_BODY_execution_set_bound(execution, bound);
}
* \param host Host
* \param mask Affinity mask
*/
-void simcall_execution_set_affinity(smx_synchro_t execution, sg_host_t host, unsigned long mask)
+void simcall_execution_set_affinity(smx_activity_t execution, sg_host_t host, unsigned long mask)
{
simcall_BODY_execution_set_affinity(execution, host, mask);
}
*
* \param execution The execution synchro
*/
-e_smx_state_t simcall_execution_wait(smx_synchro_t execution)
+e_smx_state_t simcall_execution_wait(smx_activity_t execution)
{
return (e_smx_state_t) simcall_BODY_execution_wait(execution);
}
*/
void simcall_comm_send(smx_process_t sender, smx_mailbox_t mbox, 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,
+ int (*match_fun)(void *, void *, smx_activity_t),
+ void (*copy_data_fun)(smx_activity_t, void*, size_t), void *data,
double timeout)
{
/* checking for infinite values */
if (MC_is_active() || MC_record_replay_is_active()) {
/* the model-checker wants two separate simcalls */
- smx_synchro_t comm = nullptr; /* MC needs the comm to be set to nullptr during the simcall */
+ smx_activity_t comm = nullptr; /* MC needs the comm to be set to nullptr during the simcall */
comm = simcall_comm_isend(sender, mbox, task_size, rate,
src_buff, src_buff_size, match_fun, nullptr, copy_data_fun, data, 0);
simcall_comm_wait(comm, timeout);
/**
* \ingroup simix_comm_management
*/
-smx_synchro_t simcall_comm_isend(smx_process_t sender, smx_mailbox_t mbox, double task_size, double rate,
+smx_activity_t simcall_comm_isend(smx_process_t sender, smx_mailbox_t mbox, double task_size, double rate,
void *src_buff, size_t src_buff_size,
- int (*match_fun)(void *, void *, smx_synchro_t),
+ int (*match_fun)(void *, void *, smx_activity_t),
void (*clean_fun)(void *),
- void (*copy_data_fun)(smx_synchro_t, void*, size_t),
+ void (*copy_data_fun)(smx_activity_t, void*, size_t),
void *data,
int detached)
{
* \ingroup simix_comm_management
*/
void simcall_comm_recv(smx_process_t receiver, smx_mailbox_t mbox, 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),
+ int (*match_fun)(void *, void *, smx_activity_t),
+ void (*copy_data_fun)(smx_activity_t, void*, size_t),
void *data, double timeout, double rate)
{
xbt_assert(std::isfinite(timeout), "timeout is not finite!");
if (MC_is_active() || MC_record_replay_is_active()) {
/* the model-checker wants two separate simcalls */
- smx_synchro_t comm = nullptr; /* MC needs the comm to be set to nullptr during the simcall */
+ smx_activity_t comm = nullptr; /* MC needs the comm to be set to nullptr during the simcall */
comm = simcall_comm_irecv(receiver, mbox, dst_buff, dst_buff_size,
match_fun, copy_data_fun, data, rate);
simcall_comm_wait(comm, timeout);
/**
* \ingroup simix_comm_management
*/
-smx_synchro_t simcall_comm_irecv(smx_process_t receiver, smx_mailbox_t mbox, 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),
+smx_activity_t simcall_comm_irecv(smx_process_t receiver, smx_mailbox_t mbox, void *dst_buff, size_t *dst_buff_size,
+ int (*match_fun)(void *, void *, smx_activity_t),
+ void (*copy_data_fun)(smx_activity_t, void*, size_t),
void *data, double rate)
{
xbt_assert(mbox, "No rendez-vous point defined for irecv");
/**
* \ingroup simix_comm_management
*/
-smx_synchro_t simcall_comm_iprobe(smx_mailbox_t mbox, int type, int src, int tag,
- int (*match_fun)(void *, void *, smx_synchro_t), void *data)
+smx_activity_t simcall_comm_iprobe(smx_mailbox_t mbox, int type, int src, int tag,
+ int (*match_fun)(void *, void *, smx_activity_t), void *data)
{
xbt_assert(mbox, "No rendez-vous point defined for iprobe");
/**
* \ingroup simix_comm_management
*/
-void simcall_comm_cancel(smx_synchro_t synchro)
+void simcall_comm_cancel(smx_activity_t synchro)
{
simgrid::simix::kernelImmediate([synchro]{
simgrid::kernel::activity::Comm *comm = static_cast<simgrid::kernel::activity::Comm*>(synchro);
/**
* \ingroup simix_comm_management
*/
-int simcall_comm_testany(smx_synchro_t* comms, size_t count)
+int simcall_comm_testany(smx_activity_t* comms, size_t count)
{
if (count == 0)
return -1;
/**
* \ingroup simix_comm_management
*/
-void simcall_comm_wait(smx_synchro_t comm, double timeout)
+void simcall_comm_wait(smx_activity_t comm, double timeout)
{
xbt_assert(std::isfinite(timeout), "timeout is not finite!");
simcall_BODY_comm_wait(comm, timeout);
* \param execution The execution synchro
* \param category The tracing category
*/
-void simcall_set_category(smx_synchro_t synchro, const char *category)
+void simcall_set_category(smx_activity_t synchro, const char *category)
{
if (category == nullptr) {
return;
* \ingroup simix_comm_management
*
*/
-int simcall_comm_test(smx_synchro_t comm)
+int simcall_comm_test(smx_activity_t comm)
{
return simcall_BODY_comm_test(comm);
}
}
}
-void SIMIX_simcall_exit(smx_synchro_t synchro)
+void SIMIX_simcall_exit(smx_activity_t synchro)
{
synchro->post();
}
static inline void simcall_execution_start__set__affinity_mask(smx_simcall_t simcall, unsigned long arg) {
simgrid::simix::marshal<unsigned long>(simcall->args[4], arg);
}
-static inline smx_synchro_t simcall_execution_start__get__result(smx_simcall_t simcall){
- return simgrid::simix::unmarshal<smx_synchro_t>(simcall->result);
+static inline smx_activity_t simcall_execution_start__get__result(smx_simcall_t simcall){
+ return simgrid::simix::unmarshal<smx_activity_t>(simcall->result);
}
-static inline void simcall_execution_start__set__result(smx_simcall_t simcall, smx_synchro_t result){
- simgrid::simix::marshal<smx_synchro_t>(simcall->result, result);
+static inline void simcall_execution_start__set__result(smx_simcall_t simcall, smx_activity_t result){
+ simgrid::simix::marshal<smx_activity_t>(simcall->result, result);
}
static inline const char* simcall_execution_parallel_start__get__name(smx_simcall_t simcall) {
static inline void simcall_execution_parallel_start__set__rate(smx_simcall_t simcall, double arg) {
simgrid::simix::marshal<double>(simcall->args[6], arg);
}
-static inline smx_synchro_t simcall_execution_parallel_start__get__result(smx_simcall_t simcall){
- return simgrid::simix::unmarshal<smx_synchro_t>(simcall->result);
+static inline smx_activity_t simcall_execution_parallel_start__get__result(smx_simcall_t simcall){
+ return simgrid::simix::unmarshal<smx_activity_t>(simcall->result);
}
-static inline void simcall_execution_parallel_start__set__result(smx_simcall_t simcall, smx_synchro_t result){
- simgrid::simix::marshal<smx_synchro_t>(simcall->result, result);
+static inline void simcall_execution_parallel_start__set__result(smx_simcall_t simcall, smx_activity_t result){
+ simgrid::simix::marshal<smx_activity_t>(simcall->result, result);
}
-static inline smx_synchro_t simcall_execution_cancel__get__execution(smx_simcall_t simcall) {
- return simgrid::simix::unmarshal<smx_synchro_t>(simcall->args[0]);
+static inline smx_activity_t simcall_execution_cancel__get__execution(smx_simcall_t simcall) {
+ return simgrid::simix::unmarshal<smx_activity_t>(simcall->args[0]);
}
-static inline void simcall_execution_cancel__set__execution(smx_simcall_t simcall, smx_synchro_t arg) {
- simgrid::simix::marshal<smx_synchro_t>(simcall->args[0], arg);
+static inline void simcall_execution_cancel__set__execution(smx_simcall_t simcall, smx_activity_t arg) {
+ simgrid::simix::marshal<smx_activity_t>(simcall->args[0], arg);
}
-static inline smx_synchro_t simcall_execution_set_priority__get__execution(smx_simcall_t simcall) {
- return simgrid::simix::unmarshal<smx_synchro_t>(simcall->args[0]);
+static inline smx_activity_t simcall_execution_set_priority__get__execution(smx_simcall_t simcall) {
+ return simgrid::simix::unmarshal<smx_activity_t>(simcall->args[0]);
}
-static inline void simcall_execution_set_priority__set__execution(smx_simcall_t simcall, smx_synchro_t arg) {
- simgrid::simix::marshal<smx_synchro_t>(simcall->args[0], arg);
+static inline void simcall_execution_set_priority__set__execution(smx_simcall_t simcall, smx_activity_t arg) {
+ simgrid::simix::marshal<smx_activity_t>(simcall->args[0], arg);
}
static inline double simcall_execution_set_priority__get__priority(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<double>(simcall->args[1]);
simgrid::simix::marshal<double>(simcall->args[1], arg);
}
-static inline smx_synchro_t simcall_execution_set_bound__get__execution(smx_simcall_t simcall) {
- return simgrid::simix::unmarshal<smx_synchro_t>(simcall->args[0]);
+static inline smx_activity_t simcall_execution_set_bound__get__execution(smx_simcall_t simcall) {
+ return simgrid::simix::unmarshal<smx_activity_t>(simcall->args[0]);
}
-static inline void simcall_execution_set_bound__set__execution(smx_simcall_t simcall, smx_synchro_t arg) {
- simgrid::simix::marshal<smx_synchro_t>(simcall->args[0], arg);
+static inline void simcall_execution_set_bound__set__execution(smx_simcall_t simcall, smx_activity_t arg) {
+ simgrid::simix::marshal<smx_activity_t>(simcall->args[0], arg);
}
static inline double simcall_execution_set_bound__get__bound(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<double>(simcall->args[1]);
simgrid::simix::marshal<double>(simcall->args[1], arg);
}
-static inline smx_synchro_t simcall_execution_set_affinity__get__execution(smx_simcall_t simcall) {
- return simgrid::simix::unmarshal<smx_synchro_t>(simcall->args[0]);
+static inline smx_activity_t simcall_execution_set_affinity__get__execution(smx_simcall_t simcall) {
+ return simgrid::simix::unmarshal<smx_activity_t>(simcall->args[0]);
}
-static inline void simcall_execution_set_affinity__set__execution(smx_simcall_t simcall, smx_synchro_t arg) {
- simgrid::simix::marshal<smx_synchro_t>(simcall->args[0], arg);
+static inline void simcall_execution_set_affinity__set__execution(smx_simcall_t simcall, smx_activity_t arg) {
+ simgrid::simix::marshal<smx_activity_t>(simcall->args[0], arg);
}
static inline sg_host_t simcall_execution_set_affinity__get__ws(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<sg_host_t>(simcall->args[1]);
simgrid::simix::marshal<unsigned long>(simcall->args[2], arg);
}
-static inline smx_synchro_t simcall_execution_wait__get__execution(smx_simcall_t simcall) {
- return simgrid::simix::unmarshal<smx_synchro_t>(simcall->args[0]);
+static inline smx_activity_t simcall_execution_wait__get__execution(smx_simcall_t simcall) {
+ return simgrid::simix::unmarshal<smx_activity_t>(simcall->args[0]);
}
-static inline void simcall_execution_wait__set__execution(smx_simcall_t simcall, smx_synchro_t arg) {
- simgrid::simix::marshal<smx_synchro_t>(simcall->args[0], arg);
+static inline void simcall_execution_wait__set__execution(smx_simcall_t simcall, smx_activity_t arg) {
+ simgrid::simix::marshal<smx_activity_t>(simcall->args[0], arg);
}
static inline int simcall_execution_wait__get__result(smx_simcall_t simcall){
return simgrid::simix::unmarshal<int>(simcall->result);
static inline void simcall_comm_iprobe__set__data(smx_simcall_t simcall, void* arg) {
simgrid::simix::marshal<void*>(simcall->args[5], arg);
}
-static inline smx_synchro_t simcall_comm_iprobe__get__result(smx_simcall_t simcall){
- return simgrid::simix::unmarshal<smx_synchro_t>(simcall->result);
+static inline smx_activity_t simcall_comm_iprobe__get__result(smx_simcall_t simcall){
+ return simgrid::simix::unmarshal<smx_activity_t>(simcall->result);
}
-static inline void simcall_comm_iprobe__set__result(smx_simcall_t simcall, smx_synchro_t result){
- simgrid::simix::marshal<smx_synchro_t>(simcall->result, result);
+static inline void simcall_comm_iprobe__set__result(smx_simcall_t simcall, smx_activity_t result){
+ simgrid::simix::marshal<smx_activity_t>(simcall->result, result);
}
static inline smx_process_t simcall_comm_send__get__sender(smx_simcall_t simcall) {
static inline void simcall_comm_isend__set__detached(smx_simcall_t simcall, int arg) {
simgrid::simix::marshal<int>(simcall->args[10], arg);
}
-static inline smx_synchro_t simcall_comm_isend__get__result(smx_simcall_t simcall){
- return simgrid::simix::unmarshal<smx_synchro_t>(simcall->result);
+static inline smx_activity_t simcall_comm_isend__get__result(smx_simcall_t simcall){
+ return simgrid::simix::unmarshal<smx_activity_t>(simcall->result);
}
-static inline void simcall_comm_isend__set__result(smx_simcall_t simcall, smx_synchro_t result){
- simgrid::simix::marshal<smx_synchro_t>(simcall->result, result);
+static inline void simcall_comm_isend__set__result(smx_simcall_t simcall, smx_activity_t result){
+ simgrid::simix::marshal<smx_activity_t>(simcall->result, result);
}
static inline smx_process_t simcall_comm_recv__get__receiver(smx_simcall_t simcall) {
static inline void simcall_comm_irecv__set__rate(smx_simcall_t simcall, double arg) {
simgrid::simix::marshal<double>(simcall->args[7], arg);
}
-static inline smx_synchro_t simcall_comm_irecv__get__result(smx_simcall_t simcall){
- return simgrid::simix::unmarshal<smx_synchro_t>(simcall->result);
+static inline smx_activity_t simcall_comm_irecv__get__result(smx_simcall_t simcall){
+ return simgrid::simix::unmarshal<smx_activity_t>(simcall->result);
}
-static inline void simcall_comm_irecv__set__result(smx_simcall_t simcall, smx_synchro_t result){
- simgrid::simix::marshal<smx_synchro_t>(simcall->result, result);
+static inline void simcall_comm_irecv__set__result(smx_simcall_t simcall, smx_activity_t result){
+ simgrid::simix::marshal<smx_activity_t>(simcall->result, result);
}
static inline xbt_dynar_t simcall_comm_waitany__get__comms(smx_simcall_t simcall) {
simgrid::simix::marshal<int>(simcall->result, result);
}
-static inline smx_synchro_t simcall_comm_wait__get__comm(smx_simcall_t simcall) {
- return simgrid::simix::unmarshal<smx_synchro_t>(simcall->args[0]);
+static inline smx_activity_t simcall_comm_wait__get__comm(smx_simcall_t simcall) {
+ return simgrid::simix::unmarshal<smx_activity_t>(simcall->args[0]);
}
-static inline void simcall_comm_wait__set__comm(smx_simcall_t simcall, smx_synchro_t arg) {
- simgrid::simix::marshal<smx_synchro_t>(simcall->args[0], arg);
+static inline void simcall_comm_wait__set__comm(smx_simcall_t simcall, smx_activity_t arg) {
+ simgrid::simix::marshal<smx_activity_t>(simcall->args[0], arg);
}
static inline double simcall_comm_wait__get__timeout(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<double>(simcall->args[1]);
simgrid::simix::marshal<double>(simcall->args[1], arg);
}
-static inline smx_synchro_t simcall_comm_test__get__comm(smx_simcall_t simcall) {
- return simgrid::simix::unmarshal<smx_synchro_t>(simcall->args[0]);
+static inline smx_activity_t simcall_comm_test__get__comm(smx_simcall_t simcall) {
+ return simgrid::simix::unmarshal<smx_activity_t>(simcall->args[0]);
}
-static inline void simcall_comm_test__set__comm(smx_simcall_t simcall, smx_synchro_t arg) {
- simgrid::simix::marshal<smx_synchro_t>(simcall->args[0], arg);
+static inline void simcall_comm_test__set__comm(smx_simcall_t simcall, smx_activity_t arg) {
+ simgrid::simix::marshal<smx_activity_t>(simcall->args[0], arg);
}
static inline int simcall_comm_test__get__result(smx_simcall_t simcall){
return simgrid::simix::unmarshal<int>(simcall->result);
simgrid::simix::marshal<int>(simcall->result, result);
}
-static inline smx_synchro_t* simcall_comm_testany__get__comms(smx_simcall_t simcall) {
- return simgrid::simix::unmarshal<smx_synchro_t*>(simcall->args[0]);
+static inline smx_activity_t* simcall_comm_testany__get__comms(smx_simcall_t simcall) {
+ return simgrid::simix::unmarshal<smx_activity_t*>(simcall->args[0]);
}
-static inline void simcall_comm_testany__set__comms(smx_simcall_t simcall, smx_synchro_t* arg) {
- simgrid::simix::marshal<smx_synchro_t*>(simcall->args[0], arg);
+static inline void simcall_comm_testany__set__comms(smx_simcall_t simcall, smx_activity_t* arg) {
+ simgrid::simix::marshal<smx_activity_t*>(simcall->args[0], arg);
}
static inline size_t simcall_comm_testany__get__count(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<size_t>(simcall->args[1]);
simgrid::simix::marshal<int>(simcall->result, result);
}
-static inline smx_synchro_t simcall_set_category__get__synchro(smx_simcall_t simcall) {
- return simgrid::simix::unmarshal<smx_synchro_t>(simcall->args[0]);
+static inline smx_activity_t simcall_set_category__get__synchro(smx_simcall_t simcall) {
+ return simgrid::simix::unmarshal<smx_activity_t>(simcall->args[0]);
}
-static inline void simcall_set_category__set__synchro(smx_simcall_t simcall, smx_synchro_t arg) {
- simgrid::simix::marshal<smx_synchro_t>(simcall->args[0], arg);
+static inline void simcall_set_category__set__synchro(smx_simcall_t simcall, smx_activity_t arg) {
+ simgrid::simix::marshal<smx_activity_t>(simcall->args[0], arg);
}
static inline const char* simcall_set_category__get__category(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<const char*>(simcall->args[1]);
XBT_PRIVATE void simcall_HANDLER_process_set_host(smx_simcall_t simcall, smx_process_t process, sg_host_t dest);
XBT_PRIVATE void simcall_HANDLER_process_join(smx_simcall_t simcall, smx_process_t process, double timeout);
XBT_PRIVATE void simcall_HANDLER_process_sleep(smx_simcall_t simcall, double duration);
-XBT_PRIVATE smx_synchro_t simcall_HANDLER_execution_start(smx_simcall_t simcall, const char* name, double flops_amount, double priority, double bound, unsigned long affinity_mask);
-XBT_PRIVATE void simcall_HANDLER_execution_wait(smx_simcall_t simcall, smx_synchro_t execution);
+XBT_PRIVATE smx_activity_t simcall_HANDLER_execution_start(smx_simcall_t simcall, const char* name, double flops_amount, double priority, double bound, unsigned long affinity_mask);
+XBT_PRIVATE void simcall_HANDLER_execution_wait(smx_simcall_t simcall, smx_activity_t execution);
XBT_PRIVATE smx_process_t simcall_HANDLER_process_restart(smx_simcall_t simcall, smx_process_t process);
-XBT_PRIVATE smx_synchro_t simcall_HANDLER_comm_iprobe(smx_simcall_t simcall, smx_mailbox_t mbox, int type, int src, int tag, simix_match_func_t match_fun, void* data);
+XBT_PRIVATE smx_activity_t simcall_HANDLER_comm_iprobe(smx_simcall_t simcall, smx_mailbox_t mbox, int type, int src, int tag, simix_match_func_t match_fun, void* data);
XBT_PRIVATE void simcall_HANDLER_comm_send(smx_simcall_t simcall, smx_process_t sender, smx_mailbox_t mbox, double task_size, double rate, void* src_buff, size_t src_buff_size, simix_match_func_t match_fun, simix_copy_data_func_t copy_data_fun, void* data, double timeout);
-XBT_PRIVATE smx_synchro_t simcall_HANDLER_comm_isend(smx_simcall_t simcall, smx_process_t sender, smx_mailbox_t mbox, double task_size, double rate, void* src_buff, size_t src_buff_size, simix_match_func_t match_fun, simix_clean_func_t clean_fun, simix_copy_data_func_t copy_data_fun, void* data, int detached);
+XBT_PRIVATE smx_activity_t simcall_HANDLER_comm_isend(smx_simcall_t simcall, smx_process_t sender, smx_mailbox_t mbox, double task_size, double rate, void* src_buff, size_t src_buff_size, simix_match_func_t match_fun, simix_clean_func_t clean_fun, simix_copy_data_func_t copy_data_fun, void* data, int detached);
XBT_PRIVATE void simcall_HANDLER_comm_recv(smx_simcall_t simcall, smx_process_t receiver, smx_mailbox_t mbox, void* dst_buff, size_t* dst_buff_size, simix_match_func_t match_fun, simix_copy_data_func_t copy_data_fun, void* data, double timeout, double rate);
-XBT_PRIVATE smx_synchro_t simcall_HANDLER_comm_irecv(smx_simcall_t simcall, smx_process_t receiver, smx_mailbox_t mbox, void* dst_buff, size_t* dst_buff_size, simix_match_func_t match_fun, simix_copy_data_func_t copy_data_fun, void* data, double rate);
+XBT_PRIVATE smx_activity_t simcall_HANDLER_comm_irecv(smx_simcall_t simcall, smx_process_t receiver, smx_mailbox_t mbox, void* dst_buff, size_t* dst_buff_size, simix_match_func_t match_fun, simix_copy_data_func_t copy_data_fun, void* data, double rate);
XBT_PRIVATE void simcall_HANDLER_comm_waitany(smx_simcall_t simcall, xbt_dynar_t comms, double timeout);
-XBT_PRIVATE void simcall_HANDLER_comm_wait(smx_simcall_t simcall, smx_synchro_t comm, double timeout);
-XBT_PRIVATE void simcall_HANDLER_comm_test(smx_simcall_t simcall, smx_synchro_t comm);
-XBT_PRIVATE void simcall_HANDLER_comm_testany(smx_simcall_t simcall, smx_synchro_t* comms, size_t count);
+XBT_PRIVATE void simcall_HANDLER_comm_wait(smx_simcall_t simcall, smx_activity_t comm, double timeout);
+XBT_PRIVATE void simcall_HANDLER_comm_test(smx_simcall_t simcall, smx_activity_t comm);
+XBT_PRIVATE void simcall_HANDLER_comm_testany(smx_simcall_t simcall, smx_activity_t* comms, size_t count);
XBT_PRIVATE smx_mutex_t simcall_HANDLER_mutex_init(smx_simcall_t simcall);
XBT_PRIVATE void simcall_HANDLER_mutex_lock(smx_simcall_t simcall, smx_mutex_t mutex);
XBT_PRIVATE int simcall_HANDLER_mutex_trylock(smx_simcall_t simcall, smx_mutex_t mutex);
return simcall<int, double>(SIMCALL_PROCESS_SLEEP, duration);
}
-inline static smx_synchro_t simcall_BODY_execution_start(const char* name, double flops_amount, double priority, double bound, unsigned long affinity_mask) {
+inline static smx_activity_t simcall_BODY_execution_start(const char* name, double flops_amount, double priority, double bound, unsigned long affinity_mask) {
/* Go to that function to follow the code flow through the simcall barrier */
if (0) simcall_HANDLER_execution_start(&SIMIX_process_self()->simcall, name, flops_amount, priority, bound, affinity_mask);
- return simcall<smx_synchro_t, const char*, double, double, double, unsigned long>(SIMCALL_EXECUTION_START, name, flops_amount, priority, bound, affinity_mask);
+ return simcall<smx_activity_t, const char*, double, double, double, unsigned long>(SIMCALL_EXECUTION_START, name, flops_amount, priority, bound, affinity_mask);
}
-inline static smx_synchro_t simcall_BODY_execution_parallel_start(const char* name, int host_nb, sg_host_t* host_list, double* flops_amount, double* bytes_amount, double amount, double rate) {
+inline static smx_activity_t simcall_BODY_execution_parallel_start(const char* name, int host_nb, sg_host_t* host_list, double* flops_amount, double* bytes_amount, double amount, double rate) {
/* Go to that function to follow the code flow through the simcall barrier */
if (0) SIMIX_execution_parallel_start(name, host_nb, host_list, flops_amount, bytes_amount, amount, rate);
- return simcall<smx_synchro_t, const char*, int, sg_host_t*, double*, double*, double, double>(SIMCALL_EXECUTION_PARALLEL_START, name, host_nb, host_list, flops_amount, bytes_amount, amount, rate);
+ return simcall<smx_activity_t, const char*, int, sg_host_t*, double*, double*, double, double>(SIMCALL_EXECUTION_PARALLEL_START, name, host_nb, host_list, flops_amount, bytes_amount, amount, rate);
}
-inline static void simcall_BODY_execution_cancel(smx_synchro_t execution) {
+inline static void simcall_BODY_execution_cancel(smx_activity_t execution) {
/* Go to that function to follow the code flow through the simcall barrier */
if (0) SIMIX_execution_cancel(execution);
- return simcall<void, smx_synchro_t>(SIMCALL_EXECUTION_CANCEL, execution);
+ return simcall<void, smx_activity_t>(SIMCALL_EXECUTION_CANCEL, execution);
}
-inline static void simcall_BODY_execution_set_priority(smx_synchro_t execution, double priority) {
+inline static void simcall_BODY_execution_set_priority(smx_activity_t execution, double priority) {
/* Go to that function to follow the code flow through the simcall barrier */
if (0) SIMIX_execution_set_priority(execution, priority);
- return simcall<void, smx_synchro_t, double>(SIMCALL_EXECUTION_SET_PRIORITY, execution, priority);
+ return simcall<void, smx_activity_t, double>(SIMCALL_EXECUTION_SET_PRIORITY, execution, priority);
}
-inline static void simcall_BODY_execution_set_bound(smx_synchro_t execution, double bound) {
+inline static void simcall_BODY_execution_set_bound(smx_activity_t execution, double bound) {
/* Go to that function to follow the code flow through the simcall barrier */
if (0) SIMIX_execution_set_bound(execution, bound);
- return simcall<void, smx_synchro_t, double>(SIMCALL_EXECUTION_SET_BOUND, execution, bound);
+ return simcall<void, smx_activity_t, double>(SIMCALL_EXECUTION_SET_BOUND, execution, bound);
}
-inline static void simcall_BODY_execution_set_affinity(smx_synchro_t execution, sg_host_t ws, unsigned long mask) {
+inline static void simcall_BODY_execution_set_affinity(smx_activity_t execution, sg_host_t ws, unsigned long mask) {
/* Go to that function to follow the code flow through the simcall barrier */
if (0) SIMIX_execution_set_affinity(execution, ws, mask);
- return simcall<void, smx_synchro_t, sg_host_t, unsigned long>(SIMCALL_EXECUTION_SET_AFFINITY, execution, ws, mask);
+ return simcall<void, smx_activity_t, sg_host_t, unsigned long>(SIMCALL_EXECUTION_SET_AFFINITY, execution, ws, mask);
}
-inline static int simcall_BODY_execution_wait(smx_synchro_t execution) {
+inline static int simcall_BODY_execution_wait(smx_activity_t execution) {
/* Go to that function to follow the code flow through the simcall barrier */
if (0) simcall_HANDLER_execution_wait(&SIMIX_process_self()->simcall, execution);
- return simcall<int, smx_synchro_t>(SIMCALL_EXECUTION_WAIT, execution);
+ return simcall<int, smx_activity_t>(SIMCALL_EXECUTION_WAIT, execution);
}
inline static void simcall_BODY_process_on_exit(smx_process_t process, int_f_pvoid_pvoid_t fun, void* data) {
return simcall<void, smx_mailbox_t, smx_process_t>(SIMCALL_MBOX_SET_RECEIVER, mbox, receiver);
}
-inline static smx_synchro_t simcall_BODY_comm_iprobe(smx_mailbox_t mbox, int type, int src, int tag, simix_match_func_t match_fun, void* data) {
+inline static smx_activity_t simcall_BODY_comm_iprobe(smx_mailbox_t mbox, int type, int src, int tag, simix_match_func_t match_fun, void* data) {
/* Go to that function to follow the code flow through the simcall barrier */
if (0) simcall_HANDLER_comm_iprobe(&SIMIX_process_self()->simcall, mbox, type, src, tag, match_fun, data);
- return simcall<smx_synchro_t, smx_mailbox_t, int, int, int, simix_match_func_t, void*>(SIMCALL_COMM_IPROBE, mbox, type, src, tag, match_fun, data);
+ return simcall<smx_activity_t, smx_mailbox_t, int, int, int, simix_match_func_t, void*>(SIMCALL_COMM_IPROBE, mbox, type, src, tag, match_fun, data);
}
inline static void simcall_BODY_comm_send(smx_process_t sender, smx_mailbox_t mbox, double task_size, double rate, void* src_buff, size_t src_buff_size, simix_match_func_t match_fun, simix_copy_data_func_t copy_data_fun, void* data, double timeout) {
return simcall<void, smx_process_t, smx_mailbox_t, double, double, void*, size_t, simix_match_func_t, simix_copy_data_func_t, void*, double>(SIMCALL_COMM_SEND, sender, mbox, task_size, rate, src_buff, src_buff_size, match_fun, copy_data_fun, data, timeout);
}
-inline static smx_synchro_t simcall_BODY_comm_isend(smx_process_t sender, smx_mailbox_t mbox, double task_size, double rate, void* src_buff, size_t src_buff_size, simix_match_func_t match_fun, simix_clean_func_t clean_fun, simix_copy_data_func_t copy_data_fun, void* data, int detached) {
+inline static smx_activity_t simcall_BODY_comm_isend(smx_process_t sender, smx_mailbox_t mbox, double task_size, double rate, void* src_buff, size_t src_buff_size, simix_match_func_t match_fun, simix_clean_func_t clean_fun, simix_copy_data_func_t copy_data_fun, void* data, int detached) {
/* Go to that function to follow the code flow through the simcall barrier */
if (0) simcall_HANDLER_comm_isend(&SIMIX_process_self()->simcall, sender, mbox, task_size, rate, src_buff, src_buff_size, match_fun, clean_fun, copy_data_fun, data, detached);
- return simcall<smx_synchro_t, smx_process_t, smx_mailbox_t, double, double, void*, size_t, simix_match_func_t, simix_clean_func_t, simix_copy_data_func_t, void*, int>(SIMCALL_COMM_ISEND, sender, mbox, task_size, rate, src_buff, src_buff_size, match_fun, clean_fun, copy_data_fun, data, detached);
+ return simcall<smx_activity_t, smx_process_t, smx_mailbox_t, double, double, void*, size_t, simix_match_func_t, simix_clean_func_t, simix_copy_data_func_t, void*, int>(SIMCALL_COMM_ISEND, sender, mbox, task_size, rate, src_buff, src_buff_size, match_fun, clean_fun, copy_data_fun, data, detached);
}
inline static void simcall_BODY_comm_recv(smx_process_t receiver, smx_mailbox_t mbox, void* dst_buff, size_t* dst_buff_size, simix_match_func_t match_fun, simix_copy_data_func_t copy_data_fun, void* data, double timeout, double rate) {
return simcall<void, smx_process_t, smx_mailbox_t, void*, size_t*, simix_match_func_t, simix_copy_data_func_t, void*, double, double>(SIMCALL_COMM_RECV, receiver, mbox, dst_buff, dst_buff_size, match_fun, copy_data_fun, data, timeout, rate);
}
-inline static smx_synchro_t simcall_BODY_comm_irecv(smx_process_t receiver, smx_mailbox_t mbox, void* dst_buff, size_t* dst_buff_size, simix_match_func_t match_fun, simix_copy_data_func_t copy_data_fun, void* data, double rate) {
+inline static smx_activity_t simcall_BODY_comm_irecv(smx_process_t receiver, smx_mailbox_t mbox, void* dst_buff, size_t* dst_buff_size, simix_match_func_t match_fun, simix_copy_data_func_t copy_data_fun, void* data, double rate) {
/* Go to that function to follow the code flow through the simcall barrier */
if (0) simcall_HANDLER_comm_irecv(&SIMIX_process_self()->simcall, receiver, mbox, dst_buff, dst_buff_size, match_fun, copy_data_fun, data, rate);
- return simcall<smx_synchro_t, smx_process_t, smx_mailbox_t, void*, size_t*, simix_match_func_t, simix_copy_data_func_t, void*, double>(SIMCALL_COMM_IRECV, receiver, mbox, dst_buff, dst_buff_size, match_fun, copy_data_fun, data, rate);
+ return simcall<smx_activity_t, smx_process_t, smx_mailbox_t, void*, size_t*, simix_match_func_t, simix_copy_data_func_t, void*, double>(SIMCALL_COMM_IRECV, receiver, mbox, dst_buff, dst_buff_size, match_fun, copy_data_fun, data, rate);
}
inline static int simcall_BODY_comm_waitany(xbt_dynar_t comms, double timeout) {
return simcall<int, xbt_dynar_t, double>(SIMCALL_COMM_WAITANY, comms, timeout);
}
-inline static void simcall_BODY_comm_wait(smx_synchro_t comm, double timeout) {
+inline static void simcall_BODY_comm_wait(smx_activity_t comm, double timeout) {
/* Go to that function to follow the code flow through the simcall barrier */
if (0) simcall_HANDLER_comm_wait(&SIMIX_process_self()->simcall, comm, timeout);
- return simcall<void, smx_synchro_t, double>(SIMCALL_COMM_WAIT, comm, timeout);
+ return simcall<void, smx_activity_t, double>(SIMCALL_COMM_WAIT, comm, timeout);
}
-inline static int simcall_BODY_comm_test(smx_synchro_t comm) {
+inline static int simcall_BODY_comm_test(smx_activity_t comm) {
/* Go to that function to follow the code flow through the simcall barrier */
if (0) simcall_HANDLER_comm_test(&SIMIX_process_self()->simcall, comm);
- return simcall<int, smx_synchro_t>(SIMCALL_COMM_TEST, comm);
+ return simcall<int, smx_activity_t>(SIMCALL_COMM_TEST, comm);
}
-inline static int simcall_BODY_comm_testany(smx_synchro_t* comms, size_t count) {
+inline static int simcall_BODY_comm_testany(smx_activity_t* comms, size_t count) {
/* Go to that function to follow the code flow through the simcall barrier */
if (0) simcall_HANDLER_comm_testany(&SIMIX_process_self()->simcall, comms, count);
- return simcall<int, smx_synchro_t*, size_t>(SIMCALL_COMM_TESTANY, comms, count);
+ return simcall<int, smx_activity_t*, size_t>(SIMCALL_COMM_TESTANY, comms, count);
}
inline static smx_mutex_t simcall_BODY_mutex_init() {
return simcall<int, int, int>(SIMCALL_MC_RANDOM, min, max);
}
-inline static void simcall_BODY_set_category(smx_synchro_t synchro, const char* category) {
+inline static void simcall_BODY_set_category(smx_activity_t synchro, const char* category) {
/* Go to that function to follow the code flow through the simcall barrier */
if (0) SIMIX_set_category(synchro, category);
- return simcall<void, smx_synchro_t, const char*>(SIMCALL_SET_CATEGORY, synchro, category);
+ return simcall<void, smx_activity_t, const char*>(SIMCALL_SET_CATEGORY, synchro, category);
}
inline static void simcall_BODY_run_kernel(std::function<void()> const* code) {
break;
case SIMCALL_EXECUTION_START:
- simgrid::simix::marshal<smx_synchro_t>(simcall->result, simcall_HANDLER_execution_start(simcall, simgrid::simix::unmarshal<const char*>(simcall->args[0]), simgrid::simix::unmarshal<double>(simcall->args[1]), simgrid::simix::unmarshal<double>(simcall->args[2]), simgrid::simix::unmarshal<double>(simcall->args[3]), simgrid::simix::unmarshal<unsigned long>(simcall->args[4])));
+ simgrid::simix::marshal<smx_activity_t>(simcall->result, simcall_HANDLER_execution_start(simcall, simgrid::simix::unmarshal<const char*>(simcall->args[0]), simgrid::simix::unmarshal<double>(simcall->args[1]), simgrid::simix::unmarshal<double>(simcall->args[2]), simgrid::simix::unmarshal<double>(simcall->args[3]), simgrid::simix::unmarshal<unsigned long>(simcall->args[4])));
SIMIX_simcall_answer(simcall);
break;
case SIMCALL_EXECUTION_PARALLEL_START:
- simgrid::simix::marshal<smx_synchro_t>(simcall->result, SIMIX_execution_parallel_start(simgrid::simix::unmarshal<const char*>(simcall->args[0]), simgrid::simix::unmarshal<int>(simcall->args[1]), simgrid::simix::unmarshal<sg_host_t*>(simcall->args[2]), simgrid::simix::unmarshal<double*>(simcall->args[3]), simgrid::simix::unmarshal<double*>(simcall->args[4]), simgrid::simix::unmarshal<double>(simcall->args[5]), simgrid::simix::unmarshal<double>(simcall->args[6])));
+ simgrid::simix::marshal<smx_activity_t>(simcall->result, SIMIX_execution_parallel_start(simgrid::simix::unmarshal<const char*>(simcall->args[0]), simgrid::simix::unmarshal<int>(simcall->args[1]), simgrid::simix::unmarshal<sg_host_t*>(simcall->args[2]), simgrid::simix::unmarshal<double*>(simcall->args[3]), simgrid::simix::unmarshal<double*>(simcall->args[4]), simgrid::simix::unmarshal<double>(simcall->args[5]), simgrid::simix::unmarshal<double>(simcall->args[6])));
SIMIX_simcall_answer(simcall);
break;
case SIMCALL_EXECUTION_CANCEL:
- SIMIX_execution_cancel(simgrid::simix::unmarshal<smx_synchro_t>(simcall->args[0]));
+ SIMIX_execution_cancel(simgrid::simix::unmarshal<smx_activity_t>(simcall->args[0]));
SIMIX_simcall_answer(simcall);
break;
case SIMCALL_EXECUTION_SET_PRIORITY:
- SIMIX_execution_set_priority(simgrid::simix::unmarshal<smx_synchro_t>(simcall->args[0]), simgrid::simix::unmarshal<double>(simcall->args[1]));
+ SIMIX_execution_set_priority(simgrid::simix::unmarshal<smx_activity_t>(simcall->args[0]), simgrid::simix::unmarshal<double>(simcall->args[1]));
SIMIX_simcall_answer(simcall);
break;
case SIMCALL_EXECUTION_SET_BOUND:
- SIMIX_execution_set_bound(simgrid::simix::unmarshal<smx_synchro_t>(simcall->args[0]), simgrid::simix::unmarshal<double>(simcall->args[1]));
+ SIMIX_execution_set_bound(simgrid::simix::unmarshal<smx_activity_t>(simcall->args[0]), simgrid::simix::unmarshal<double>(simcall->args[1]));
SIMIX_simcall_answer(simcall);
break;
case SIMCALL_EXECUTION_SET_AFFINITY:
- SIMIX_execution_set_affinity(simgrid::simix::unmarshal<smx_synchro_t>(simcall->args[0]), simgrid::simix::unmarshal<sg_host_t>(simcall->args[1]), simgrid::simix::unmarshal<unsigned long>(simcall->args[2]));
+ SIMIX_execution_set_affinity(simgrid::simix::unmarshal<smx_activity_t>(simcall->args[0]), simgrid::simix::unmarshal<sg_host_t>(simcall->args[1]), simgrid::simix::unmarshal<unsigned long>(simcall->args[2]));
SIMIX_simcall_answer(simcall);
break;
case SIMCALL_EXECUTION_WAIT:
- simcall_HANDLER_execution_wait(simcall, simgrid::simix::unmarshal<smx_synchro_t>(simcall->args[0]));
+ simcall_HANDLER_execution_wait(simcall, simgrid::simix::unmarshal<smx_activity_t>(simcall->args[0]));
break;
case SIMCALL_PROCESS_ON_EXIT:
break;
case SIMCALL_COMM_IPROBE:
- simgrid::simix::marshal<smx_synchro_t>(simcall->result, simcall_HANDLER_comm_iprobe(simcall, simgrid::simix::unmarshal<smx_mailbox_t>(simcall->args[0]), simgrid::simix::unmarshal<int>(simcall->args[1]), simgrid::simix::unmarshal<int>(simcall->args[2]), simgrid::simix::unmarshal<int>(simcall->args[3]), simgrid::simix::unmarshal<simix_match_func_t>(simcall->args[4]), simgrid::simix::unmarshal<void*>(simcall->args[5])));
+ simgrid::simix::marshal<smx_activity_t>(simcall->result, simcall_HANDLER_comm_iprobe(simcall, simgrid::simix::unmarshal<smx_mailbox_t>(simcall->args[0]), simgrid::simix::unmarshal<int>(simcall->args[1]), simgrid::simix::unmarshal<int>(simcall->args[2]), simgrid::simix::unmarshal<int>(simcall->args[3]), simgrid::simix::unmarshal<simix_match_func_t>(simcall->args[4]), simgrid::simix::unmarshal<void*>(simcall->args[5])));
SIMIX_simcall_answer(simcall);
break;
break;
case SIMCALL_COMM_ISEND:
- simgrid::simix::marshal<smx_synchro_t>(simcall->result, simcall_HANDLER_comm_isend(simcall, simgrid::simix::unmarshal<smx_process_t>(simcall->args[0]), simgrid::simix::unmarshal<smx_mailbox_t>(simcall->args[1]), simgrid::simix::unmarshal<double>(simcall->args[2]), simgrid::simix::unmarshal<double>(simcall->args[3]), simgrid::simix::unmarshal<void*>(simcall->args[4]), simgrid::simix::unmarshal<size_t>(simcall->args[5]), simgrid::simix::unmarshal<simix_match_func_t>(simcall->args[6]), simgrid::simix::unmarshal<simix_clean_func_t>(simcall->args[7]), simgrid::simix::unmarshal<simix_copy_data_func_t>(simcall->args[8]), simgrid::simix::unmarshal<void*>(simcall->args[9]), simgrid::simix::unmarshal<int>(simcall->args[10])));
+ simgrid::simix::marshal<smx_activity_t>(simcall->result, simcall_HANDLER_comm_isend(simcall, simgrid::simix::unmarshal<smx_process_t>(simcall->args[0]), simgrid::simix::unmarshal<smx_mailbox_t>(simcall->args[1]), simgrid::simix::unmarshal<double>(simcall->args[2]), simgrid::simix::unmarshal<double>(simcall->args[3]), simgrid::simix::unmarshal<void*>(simcall->args[4]), simgrid::simix::unmarshal<size_t>(simcall->args[5]), simgrid::simix::unmarshal<simix_match_func_t>(simcall->args[6]), simgrid::simix::unmarshal<simix_clean_func_t>(simcall->args[7]), simgrid::simix::unmarshal<simix_copy_data_func_t>(simcall->args[8]), simgrid::simix::unmarshal<void*>(simcall->args[9]), simgrid::simix::unmarshal<int>(simcall->args[10])));
SIMIX_simcall_answer(simcall);
break;
break;
case SIMCALL_COMM_IRECV:
- simgrid::simix::marshal<smx_synchro_t>(simcall->result, simcall_HANDLER_comm_irecv(simcall, simgrid::simix::unmarshal<smx_process_t>(simcall->args[0]), simgrid::simix::unmarshal<smx_mailbox_t>(simcall->args[1]), simgrid::simix::unmarshal<void*>(simcall->args[2]), simgrid::simix::unmarshal<size_t*>(simcall->args[3]), simgrid::simix::unmarshal<simix_match_func_t>(simcall->args[4]), simgrid::simix::unmarshal<simix_copy_data_func_t>(simcall->args[5]), simgrid::simix::unmarshal<void*>(simcall->args[6]), simgrid::simix::unmarshal<double>(simcall->args[7])));
+ simgrid::simix::marshal<smx_activity_t>(simcall->result, simcall_HANDLER_comm_irecv(simcall, simgrid::simix::unmarshal<smx_process_t>(simcall->args[0]), simgrid::simix::unmarshal<smx_mailbox_t>(simcall->args[1]), simgrid::simix::unmarshal<void*>(simcall->args[2]), simgrid::simix::unmarshal<size_t*>(simcall->args[3]), simgrid::simix::unmarshal<simix_match_func_t>(simcall->args[4]), simgrid::simix::unmarshal<simix_copy_data_func_t>(simcall->args[5]), simgrid::simix::unmarshal<void*>(simcall->args[6]), simgrid::simix::unmarshal<double>(simcall->args[7])));
SIMIX_simcall_answer(simcall);
break;
break;
case SIMCALL_COMM_WAIT:
- simcall_HANDLER_comm_wait(simcall, simgrid::simix::unmarshal<smx_synchro_t>(simcall->args[0]), simgrid::simix::unmarshal<double>(simcall->args[1]));
+ simcall_HANDLER_comm_wait(simcall, simgrid::simix::unmarshal<smx_activity_t>(simcall->args[0]), simgrid::simix::unmarshal<double>(simcall->args[1]));
break;
case SIMCALL_COMM_TEST:
- simcall_HANDLER_comm_test(simcall, simgrid::simix::unmarshal<smx_synchro_t>(simcall->args[0]));
+ simcall_HANDLER_comm_test(simcall, simgrid::simix::unmarshal<smx_activity_t>(simcall->args[0]));
break;
case SIMCALL_COMM_TESTANY:
- simcall_HANDLER_comm_testany(simcall, simgrid::simix::unmarshal<smx_synchro_t*>(simcall->args[0]), simgrid::simix::unmarshal<size_t>(simcall->args[1]));
+ simcall_HANDLER_comm_testany(simcall, simgrid::simix::unmarshal<smx_activity_t*>(simcall->args[0]), simgrid::simix::unmarshal<size_t>(simcall->args[1]));
break;
case SIMCALL_MUTEX_INIT:
break;
case SIMCALL_SET_CATEGORY:
- SIMIX_set_category(simgrid::simix::unmarshal<smx_synchro_t>(simcall->args[0]), simgrid::simix::unmarshal<const char*>(simcall->args[1]));
+ SIMIX_set_category(simgrid::simix::unmarshal<smx_activity_t>(simcall->args[0]), simgrid::simix::unmarshal<const char*>(simcall->args[1]));
SIMIX_simcall_answer(simcall);
break;
#include "popping_enum.h" /* Definition of e_smx_simcall_t, with one value per simcall */
-typedef int (*simix_match_func_t)(void *, void *, smx_synchro_t);
-typedef void (*simix_copy_data_func_t)(smx_synchro_t, void*, size_t);
+typedef int (*simix_match_func_t)(void *, void *, smx_activity_t);
+typedef void (*simix_copy_data_func_t)(smx_activity_t, void*, size_t);
typedef void (*simix_clean_func_t)(void *);
typedef void (*FPtr)(void); // Hide the ugliness
XBT_PRIVATE void SIMIX_simcall_answer(smx_simcall_t simcall);
XBT_PRIVATE void SIMIX_simcall_handle(smx_simcall_t simcall, int value);
-XBT_PRIVATE void SIMIX_simcall_exit(smx_synchro_t synchro);
+XBT_PRIVATE void SIMIX_simcall_exit(smx_activity_t synchro);
XBT_PRIVATE const char *SIMIX_simcall_name(e_smx_simcall_t kind);
XBT_PRIVATE void SIMIX_run_kernel(std::function<void()> const* code);
XBT_PRIVATE void SIMIX_run_blocking(std::function<void()> const* code);
int process_join(smx_process_t process, double timeout) [[block]];
int process_sleep(double duration) [[block]];
-smx_synchro_t execution_start(const char* name, double flops_amount, double priority, double bound, unsigned long affinity_mask);
-smx_synchro_t execution_parallel_start(const char* name, int host_nb, sg_host_t* host_list, double* flops_amount, double* bytes_amount, double amount, double rate) [[nohandler]];
-void execution_cancel(smx_synchro_t execution) [[nohandler]];
-void execution_set_priority(smx_synchro_t execution, double priority) [[nohandler]];
-void execution_set_bound(smx_synchro_t execution, double bound) [[nohandler]];
-void execution_set_affinity(smx_synchro_t execution, sg_host_t ws, unsigned long mask) [[nohandler]];
-int execution_wait(smx_synchro_t execution) [[block]];
+smx_activity_t execution_start(const char* name, double flops_amount, double priority, double bound, unsigned long affinity_mask);
+smx_activity_t execution_parallel_start(const char* name, int host_nb, sg_host_t* host_list, double* flops_amount, double* bytes_amount, double amount, double rate) [[nohandler]];
+void execution_cancel(smx_activity_t execution) [[nohandler]];
+void execution_set_priority(smx_activity_t execution, double priority) [[nohandler]];
+void execution_set_bound(smx_activity_t execution, double bound) [[nohandler]];
+void execution_set_affinity(smx_activity_t execution, sg_host_t ws, unsigned long mask) [[nohandler]];
+int execution_wait(smx_activity_t execution) [[block]];
void process_on_exit(smx_process_t process, int_f_pvoid_pvoid_t fun, void* data) [[nohandler]];
void process_auto_restart_set(smx_process_t process, int auto_restart) [[nohandler]];
smx_mailbox_t mbox_create(const char* name) [[nohandler]];
void mbox_set_receiver(smx_mailbox_t mbox, smx_process_t receiver) [[nohandler]];
-smx_synchro_t comm_iprobe(smx_mailbox_t mbox, int type, int src, int tag, simix_match_func_t match_fun, void* data);
+smx_activity_t comm_iprobe(smx_mailbox_t mbox, int type, int src, int tag, simix_match_func_t match_fun, void* data);
void comm_send(smx_process_t sender, smx_mailbox_t mbox, double task_size, double rate, void* src_buff, size_t src_buff_size, simix_match_func_t match_fun, simix_copy_data_func_t copy_data_fun, void* data, double timeout) [[block]];
-smx_synchro_t comm_isend(smx_process_t sender, smx_mailbox_t mbox, double task_size, double rate, void* src_buff, size_t src_buff_size, simix_match_func_t match_fun, simix_clean_func_t clean_fun, simix_copy_data_func_t copy_data_fun, void* data, int detached);
+smx_activity_t comm_isend(smx_process_t sender, smx_mailbox_t mbox, double task_size, double rate, void* src_buff, size_t src_buff_size, simix_match_func_t match_fun, simix_clean_func_t clean_fun, simix_copy_data_func_t copy_data_fun, void* data, int detached);
void comm_recv(smx_process_t receiver, smx_mailbox_t mbox, void* dst_buff, size_t* dst_buff_size, simix_match_func_t match_fun, simix_copy_data_func_t copy_data_fun, void* data, double timeout, double rate) [[block]];
-smx_synchro_t comm_irecv(smx_process_t receiver, smx_mailbox_t mbox, void* dst_buff, size_t* dst_buff_size, simix_match_func_t match_fun, simix_copy_data_func_t copy_data_fun, void* data, double rate);
+smx_activity_t comm_irecv(smx_process_t receiver, smx_mailbox_t mbox, void* dst_buff, size_t* dst_buff_size, simix_match_func_t match_fun, simix_copy_data_func_t copy_data_fun, void* data, double rate);
int comm_waitany(xbt_dynar_t comms, double timeout) [[block]];
-void comm_wait(smx_synchro_t comm, double timeout) [[block]];
-int comm_test(smx_synchro_t comm) [[block]];
-int comm_testany(smx_synchro_t* comms, size_t count) [[block]];
+void comm_wait(smx_activity_t comm, double timeout) [[block]];
+int comm_test(smx_activity_t comm) [[block]];
+int comm_testany(smx_activity_t* comms, size_t count) [[block]];
smx_mutex_t mutex_init();
void mutex_lock(smx_mutex_t mutex) [[block]];
xbt_dict_t asr_get_properties(const char* name);
int mc_random(int min, int max);
-void set_category(smx_synchro_t synchro, const char* category) [[nohandler]];
+void set_category(smx_activity_t synchro, const char* category) [[nohandler]];
void run_kernel(std::function<void()> const* code) [[nohandler]];
void run_blocking(std::function<void()> const* code) [[block,nohandler]];
XBT_DEBUG("Handling the processes whose action failed (if any)");
while ((action = surf_model_extract_failed_action_set(model))) {
XBT_DEBUG(" Handling Action %p",action);
- SIMIX_simcall_exit((smx_synchro_t) action->getData());
+ SIMIX_simcall_exit((smx_activity_t) action->getData());
}
XBT_DEBUG("Handling the processes whose action terminated normally (if any)");
while ((action = surf_model_extract_done_action_set(model))) {
if (action->getData() == nullptr)
XBT_DEBUG("probably vcpu's action %p, skip", action);
else
- SIMIX_simcall_exit((smx_synchro_t) action->getData());
+ SIMIX_simcall_exit((smx_activity_t) action->getData());
}
}
}
xbt_dynar_reset(process_list);
}
-smx_synchro_t simcall_HANDLER_execution_start(smx_simcall_t simcall, const char* name, double flops_amount,
+smx_activity_t simcall_HANDLER_execution_start(smx_simcall_t simcall, const char* name, double flops_amount,
double priority, double bound, unsigned long affinity_mask) {
return SIMIX_execution_start(simcall->issuer, name,flops_amount,priority,bound,affinity_mask);
}
-smx_synchro_t SIMIX_execution_start(smx_process_t issuer, const char *name, double flops_amount, double priority,
+smx_activity_t SIMIX_execution_start(smx_process_t issuer, const char *name, double flops_amount, double priority,
double bound, unsigned long affinity_mask){
/* alloc structures and initialize */
return exec;
}
-smx_synchro_t SIMIX_execution_parallel_start(const char *name, int host_nb, sg_host_t *host_list, double *flops_amount,
+smx_activity_t SIMIX_execution_parallel_start(const char *name, int host_nb, sg_host_t *host_list, double *flops_amount,
double *bytes_amount, double amount, double rate){
/* alloc structures and initialize */
return exec;
}
-void SIMIX_execution_cancel(smx_synchro_t synchro)
+void SIMIX_execution_cancel(smx_activity_t synchro)
{
XBT_DEBUG("Cancel synchro %p", synchro);
simgrid::kernel::activity::Exec *exec = static_cast<simgrid::kernel::activity::Exec *>(synchro);
exec->surf_exec->cancel();
}
-void SIMIX_execution_set_priority(smx_synchro_t synchro, double priority)
+void SIMIX_execution_set_priority(smx_activity_t synchro, double priority)
{
simgrid::kernel::activity::Exec *exec = static_cast<simgrid::kernel::activity::Exec *>(synchro);
if(exec->surf_exec)
exec->surf_exec->setPriority(priority);
}
-void SIMIX_execution_set_bound(smx_synchro_t synchro, double bound)
+void SIMIX_execution_set_bound(smx_activity_t synchro, double bound)
{
simgrid::kernel::activity::Exec *exec = static_cast<simgrid::kernel::activity::Exec *>(synchro);
if(exec->surf_exec)
static_cast<simgrid::surf::CpuAction*>(exec->surf_exec)->setBound(bound);
}
-void SIMIX_execution_set_affinity(smx_synchro_t synchro, sg_host_t host, unsigned long mask)
+void SIMIX_execution_set_affinity(smx_activity_t synchro, sg_host_t host, unsigned long mask)
{
simgrid::kernel::activity::Exec *exec = static_cast<simgrid::kernel::activity::Exec *>(synchro);
if(exec->surf_exec) {
}
}
-void simcall_HANDLER_execution_wait(smx_simcall_t simcall, smx_synchro_t synchro)
+void simcall_HANDLER_execution_wait(smx_simcall_t simcall, smx_activity_t synchro)
{
simgrid::kernel::activity::Exec *exec = static_cast<simgrid::kernel::activity::Exec *>(synchro);
XBT_DEBUG("Wait for execution of synchro %p, state %d", synchro, (int)synchro->state);
exec->unref();
}
-void SIMIX_set_category(smx_synchro_t synchro, const char *category)
+void SIMIX_set_category(smx_activity_t synchro, const char *category)
{
if (synchro->state != SIMIX_RUNNING)
return;
XBT_PRIVATE void SIMIX_host_restart_processes(sg_host_t host);
XBT_PRIVATE void SIMIX_host_autorestart(sg_host_t host);
-XBT_PRIVATE smx_synchro_t SIMIX_execution_start(smx_process_t issuer, const char *name,
+XBT_PRIVATE smx_activity_t SIMIX_execution_start(smx_process_t issuer, const char *name,
double flops_amount, double priority, double bound, unsigned long affinity_mask);
-XBT_PRIVATE smx_synchro_t SIMIX_execution_parallel_start(const char *name,
+XBT_PRIVATE smx_activity_t SIMIX_execution_parallel_start(const char *name,
int host_nb, sg_host_t *host_list,
double *flops_amount, double *bytes_amount,
double amount, double rate);
-XBT_PRIVATE void SIMIX_execution_cancel(smx_synchro_t synchro);
-XBT_PRIVATE void SIMIX_execution_set_priority(smx_synchro_t synchro, double priority);
-XBT_PRIVATE void SIMIX_execution_set_bound(smx_synchro_t synchro, double bound);
-XBT_PRIVATE void SIMIX_execution_set_affinity(smx_synchro_t synchro, sg_host_t host, unsigned long mask);
+XBT_PRIVATE void SIMIX_execution_cancel(smx_activity_t synchro);
+XBT_PRIVATE void SIMIX_execution_set_priority(smx_activity_t synchro, double priority);
+XBT_PRIVATE void SIMIX_execution_set_bound(smx_activity_t synchro, double bound);
+XBT_PRIVATE void SIMIX_execution_set_affinity(smx_activity_t synchro, sg_host_t host, unsigned long mask);
XBT_PRIVATE void SIMIX_execution_finish(simgrid::kernel::activity::Exec *exec);
-XBT_PRIVATE void SIMIX_set_category(smx_synchro_t synchro, const char *category);
+XBT_PRIVATE void SIMIX_set_category(smx_activity_t synchro, const char *category);
/* vm related stuff */
XBT_PRIVATE sg_host_t SIMIX_vm_create(const char *name, sg_host_t ind_phys_host);
//SIMIX FILE READ
void simcall_HANDLER_file_read(smx_simcall_t simcall, smx_file_t fd, sg_size_t size, sg_host_t host)
{
- smx_synchro_t synchro = SIMIX_file_read(fd, size, host);
+ smx_activity_t synchro = SIMIX_file_read(fd, size, host);
synchro->simcalls.push_back(simcall);
simcall->issuer->waiting_synchro = synchro;
}
-smx_synchro_t SIMIX_file_read(smx_file_t fd, sg_size_t size, sg_host_t host)
+smx_activity_t SIMIX_file_read(smx_file_t fd, sg_size_t size, sg_host_t host)
{
/* check if the host is active */
if (host->isOff())
//SIMIX FILE WRITE
void simcall_HANDLER_file_write(smx_simcall_t simcall, smx_file_t fd, sg_size_t size, sg_host_t host)
{
- smx_synchro_t synchro = SIMIX_file_write(fd, size, host);
+ smx_activity_t synchro = SIMIX_file_write(fd, size, host);
synchro->simcalls.push_back(simcall);
simcall->issuer->waiting_synchro = synchro;
}
-smx_synchro_t SIMIX_file_write(smx_file_t fd, sg_size_t size, sg_host_t host)
+smx_activity_t SIMIX_file_write(smx_file_t fd, sg_size_t size, sg_host_t host)
{
if (host->isOff())
THROWF(host_error, 0, "Host %s failed, you cannot call this function", sg_host_get_name(host));
//SIMIX FILE OPEN
void simcall_HANDLER_file_open(smx_simcall_t simcall, const char* fullpath, sg_host_t host)
{
- smx_synchro_t synchro = SIMIX_file_open(fullpath, host);
+ smx_activity_t synchro = SIMIX_file_open(fullpath, host);
synchro->simcalls.push_back(simcall);
simcall->issuer->waiting_synchro = synchro;
}
-smx_synchro_t SIMIX_file_open(const char* fullpath, sg_host_t host)
+smx_activity_t SIMIX_file_open(const char* fullpath, sg_host_t host)
{
if (host->isOff())
THROWF(host_error, 0, "Host %s failed, you cannot call this function", sg_host_get_name(host));
//SIMIX FILE CLOSE
void simcall_HANDLER_file_close(smx_simcall_t simcall, smx_file_t fd, sg_host_t host)
{
- smx_synchro_t synchro = SIMIX_file_close(fd, host);
+ smx_activity_t synchro = SIMIX_file_close(fd, host);
synchro->simcalls.push_back(simcall);
simcall->issuer->waiting_synchro = synchro;
}
-smx_synchro_t SIMIX_file_close(smx_file_t fd, sg_host_t host)
+smx_activity_t SIMIX_file_close(smx_file_t fd, sg_host_t host)
{
if (host->isOff())
THROWF(host_error, 0, "Host %s failed, you cannot call this function", sg_host_get_name(host));
return surf_storage_get_host(storage);
}
-void SIMIX_io_destroy(smx_synchro_t synchro)
+void SIMIX_io_destroy(smx_activity_t synchro)
{
simgrid::kernel::activity::Io *io = static_cast<simgrid::kernel::activity::Io*>(synchro);
XBT_DEBUG("Destroy synchro %p", synchro);
delete io;
}
-void SIMIX_io_finish(smx_synchro_t synchro)
+void SIMIX_io_finish(smx_activity_t synchro)
{
for (smx_simcall_t simcall : synchro->simcalls) {
switch (synchro->state) {
XBT_PRIVATE smx_storage_t SIMIX_storage_create(const char *name, void *storage, void *data);
XBT_PRIVATE void SIMIX_storage_destroy(void *s);
-XBT_PRIVATE smx_synchro_t SIMIX_file_read(smx_file_t fd, sg_size_t size, sg_host_t host);
-XBT_PRIVATE smx_synchro_t SIMIX_file_write(smx_file_t fd, sg_size_t size, sg_host_t host);
-XBT_PRIVATE smx_synchro_t SIMIX_file_open(const char* fullpath, sg_host_t host);
-XBT_PRIVATE smx_synchro_t SIMIX_file_close(smx_file_t fd, sg_host_t host);
+XBT_PRIVATE smx_activity_t SIMIX_file_read(smx_file_t fd, sg_size_t size, sg_host_t host);
+XBT_PRIVATE smx_activity_t SIMIX_file_write(smx_file_t fd, sg_size_t size, sg_host_t host);
+XBT_PRIVATE smx_activity_t SIMIX_file_open(const char* fullpath, sg_host_t host);
+XBT_PRIVATE smx_activity_t SIMIX_file_close(smx_file_t fd, sg_host_t host);
XBT_PRIVATE int SIMIX_file_unlink(smx_file_t fd, sg_host_t host);
XBT_PRIVATE sg_size_t SIMIX_file_get_size(smx_process_t process, smx_file_t fd);
XBT_PRIVATE sg_size_t SIMIX_file_tell(smx_process_t process, smx_file_t fd);
XBT_PRIVATE xbt_dict_t SIMIX_storage_get_properties(smx_storage_t storage);
-XBT_PRIVATE void SIMIX_io_destroy(smx_synchro_t synchro);
-XBT_PRIVATE void SIMIX_io_finish(smx_synchro_t synchro);
+XBT_PRIVATE void SIMIX_io_destroy(smx_activity_t synchro);
+XBT_PRIVATE void SIMIX_io_finish(smx_activity_t synchro);
#endif
static xbt_dict_t mailboxes = xbt_dict_new_homogeneous(SIMIX_mbox_free);
static void SIMIX_waitany_remove_simcall_from_actions(smx_simcall_t simcall);
-static void SIMIX_comm_copy_data(smx_synchro_t comm);
-static inline void SIMIX_mbox_push(smx_mailbox_t mbox, smx_synchro_t comm);
-static smx_synchro_t _find_matching_comm(std::deque<smx_synchro_t> *deque, e_smx_comm_type_t type,
- int (*match_fun)(void *, void *,smx_synchro_t), void *user_data, smx_synchro_t my_synchro, bool remove_matching);
-static void SIMIX_comm_start(smx_synchro_t synchro);
+static void SIMIX_comm_copy_data(smx_activity_t comm);
+static inline void SIMIX_mbox_push(smx_mailbox_t mbox, smx_activity_t comm);
+static smx_activity_t _find_matching_comm(std::deque<smx_activity_t> *deque, e_smx_comm_type_t type,
+ int (*match_fun)(void *, void *,smx_activity_t), void *user_data, smx_activity_t my_synchro, bool remove_matching);
+static void SIMIX_comm_start(smx_activity_t synchro);
void SIMIX_mailbox_exit()
{
* \param mbox The mailbox
* \param synchro The communication synchro
*/
-static inline void SIMIX_mbox_push(smx_mailbox_t mbox, smx_synchro_t synchro)
+static inline void SIMIX_mbox_push(smx_mailbox_t mbox, smx_activity_t synchro)
{
simgrid::kernel::activity::Comm *comm = static_cast<simgrid::kernel::activity::Comm*>(synchro);
mbox->comm_queue.push_back(comm);
* \param mbox The rendez-vous point
* \param synchro The communication synchro
*/
-void SIMIX_mbox_remove(smx_mailbox_t mbox, smx_synchro_t synchro)
+void SIMIX_mbox_remove(smx_mailbox_t mbox, smx_activity_t synchro)
{
simgrid::kernel::activity::Comm *comm = static_cast<simgrid::kernel::activity::Comm*>(synchro);
* \param type The type of communication we are looking for (comm_send, comm_recv)
* \return The communication synchro if found, nullptr otherwise
*/
-static smx_synchro_t _find_matching_comm(std::deque<smx_synchro_t> *deque, e_smx_comm_type_t type,
- int (*match_fun)(void *, void *,smx_synchro_t), void *this_user_data, smx_synchro_t my_synchro, bool remove_matching)
+static smx_activity_t _find_matching_comm(std::deque<smx_activity_t> *deque, e_smx_comm_type_t type,
+ int (*match_fun)(void *, void *,smx_activity_t), void *this_user_data, smx_activity_t my_synchro, bool remove_matching)
{
void* other_user_data = nullptr;
for(auto it = deque->begin(); it != deque->end(); it++){
- smx_synchro_t synchro = *it;
+ smx_activity_t synchro = *it;
simgrid::kernel::activity::Comm *comm = static_cast<simgrid::kernel::activity::Comm*>(synchro);
if (comm->type == SIMIX_COMM_SEND) {
XBT_PRIVATE void simcall_HANDLER_comm_send(smx_simcall_t simcall, smx_process_t src, smx_mailbox_t mbox,
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),
+ int (*match_fun)(void *, void *,smx_activity_t),
+ void (*copy_data_fun)(smx_activity_t, void*, size_t),
void *data, double timeout){
- smx_synchro_t comm = simcall_HANDLER_comm_isend(simcall, src, mbox, task_size, rate,
+ smx_activity_t comm = simcall_HANDLER_comm_isend(simcall, src, mbox, task_size, rate,
src_buff, src_buff_size, match_fun, nullptr, copy_data_fun,
data, 0);
SIMCALL_SET_MC_VALUE(simcall, 0);
simcall_HANDLER_comm_wait(simcall, comm, timeout);
}
-XBT_PRIVATE smx_synchro_t simcall_HANDLER_comm_isend(smx_simcall_t simcall, smx_process_t src_proc, smx_mailbox_t mbox,
+XBT_PRIVATE smx_activity_t simcall_HANDLER_comm_isend(smx_simcall_t simcall, smx_process_t src_proc, smx_mailbox_t mbox,
double task_size, double rate,
void *src_buff, size_t src_buff_size,
- int (*match_fun)(void *, void *,smx_synchro_t),
+ int (*match_fun)(void *, void *,smx_activity_t),
void (*clean_fun)(void *), // used to free the synchro in case of problem after a detached send
- void (*copy_data_fun)(smx_synchro_t, void*, size_t),// used to copy data if not default one
+ void (*copy_data_fun)(smx_activity_t, void*, size_t),// used to copy data if not default one
void *data, int detached)
{
XBT_DEBUG("send from %p", mbox);
* ourself so that the other side also gets a chance of choosing if it wants to match with us.
*
* If it is not found then push our communication into the rendez-vous point */
- smx_synchro_t other_synchro =
+ smx_activity_t other_synchro =
_find_matching_comm(&mbox->comm_queue, SIMIX_COMM_RECEIVE, match_fun, data, this_synchro, /*remove_matching*/true);
simgrid::kernel::activity::Comm *other_comm = static_cast<simgrid::kernel::activity::Comm*>(other_synchro);
XBT_PRIVATE void simcall_HANDLER_comm_recv(smx_simcall_t simcall, smx_process_t receiver, smx_mailbox_t mbox,
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),
+ int (*match_fun)(void *, void *, smx_activity_t),
+ void (*copy_data_fun)(smx_activity_t, void*, size_t),
void *data, double timeout, double rate)
{
- smx_synchro_t comm = SIMIX_comm_irecv(receiver, mbox, dst_buff, dst_buff_size, match_fun, copy_data_fun, data, rate);
+ smx_activity_t comm = SIMIX_comm_irecv(receiver, mbox, dst_buff, dst_buff_size, match_fun, copy_data_fun, data, rate);
SIMCALL_SET_MC_VALUE(simcall, 0);
simcall_HANDLER_comm_wait(simcall, comm, timeout);
}
-XBT_PRIVATE smx_synchro_t simcall_HANDLER_comm_irecv(smx_simcall_t simcall, smx_process_t receiver, smx_mailbox_t mbox,
+XBT_PRIVATE smx_activity_t simcall_HANDLER_comm_irecv(smx_simcall_t simcall, smx_process_t receiver, smx_mailbox_t mbox,
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),
+ int (*match_fun)(void *, void *, smx_activity_t),
+ void (*copy_data_fun)(smx_activity_t, void*, size_t),
void *data, double rate)
{
return SIMIX_comm_irecv(receiver, mbox, dst_buff, dst_buff_size, match_fun, copy_data_fun, data, rate);
}
-smx_synchro_t SIMIX_comm_irecv(smx_process_t dst_proc, smx_mailbox_t mbox, 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), // used to copy data if not default one
+smx_activity_t SIMIX_comm_irecv(smx_process_t dst_proc, smx_mailbox_t mbox, void *dst_buff, size_t *dst_buff_size,
+ int (*match_fun)(void *, void *, smx_activity_t),
+ void (*copy_data_fun)(smx_activity_t, void*, size_t), // used to copy data if not default one
void *data, double rate)
{
XBT_DEBUG("recv from %p %p", mbox, &mbox->comm_queue);
simgrid::kernel::activity::Comm* this_synchro = new simgrid::kernel::activity::Comm(SIMIX_COMM_RECEIVE);
- smx_synchro_t other_synchro;
+ smx_activity_t other_synchro;
//communication already done, get it inside the fifo of completed comms
if (mbox->permanent_receiver != nullptr && ! mbox->done_comm_queue.empty()) {
return other_synchro;
}
-smx_synchro_t simcall_HANDLER_comm_iprobe(smx_simcall_t simcall, smx_mailbox_t mbox,
+smx_activity_t simcall_HANDLER_comm_iprobe(smx_simcall_t simcall, smx_mailbox_t mbox,
int type, int src, int tag,
- int (*match_fun)(void *, void *, smx_synchro_t),
+ int (*match_fun)(void *, void *, smx_activity_t),
void *data){
return SIMIX_comm_iprobe(simcall->issuer, mbox, type, src, tag, match_fun, data);
}
-smx_synchro_t SIMIX_comm_iprobe(smx_process_t dst_proc, smx_mailbox_t mbox, int type, int src,
- int tag, int (*match_fun)(void *, void *, smx_synchro_t), void *data)
+smx_activity_t SIMIX_comm_iprobe(smx_process_t dst_proc, smx_mailbox_t mbox, int type, int src,
+ int tag, int (*match_fun)(void *, void *, smx_activity_t), void *data)
{
XBT_DEBUG("iprobe from %p %p", mbox, &mbox->comm_queue);
simgrid::kernel::activity::Comm* this_comm;
this_comm = new simgrid::kernel::activity::Comm(SIMIX_COMM_RECEIVE);
smx_type = SIMIX_COMM_SEND;
}
- smx_synchro_t other_synchro=nullptr;
+ smx_activity_t other_synchro=nullptr;
if (mbox->permanent_receiver != nullptr && !mbox->done_comm_queue.empty()) {
XBT_DEBUG("first check in the permanent recv mailbox, to see if we already got something");
other_synchro = _find_matching_comm(&mbox->done_comm_queue,
return other_synchro;
}
-void simcall_HANDLER_comm_wait(smx_simcall_t simcall, smx_synchro_t synchro, double timeout)
+void simcall_HANDLER_comm_wait(smx_simcall_t simcall, smx_activity_t synchro, double timeout)
{
/* Associate this simcall to the wait synchro */
XBT_DEBUG("simcall_HANDLER_comm_wait, %p", synchro);
}
}
-void simcall_HANDLER_comm_test(smx_simcall_t simcall, smx_synchro_t synchro)
+void simcall_HANDLER_comm_test(smx_simcall_t simcall, smx_activity_t synchro)
{
simgrid::kernel::activity::Comm *comm = static_cast<simgrid::kernel::activity::Comm*>(synchro);
void simcall_HANDLER_comm_waitany(smx_simcall_t simcall, xbt_dynar_t synchros, double timeout)
{
- smx_synchro_t synchro;
+ smx_activity_t synchro;
unsigned int cursor = 0;
if (MC_is_active() || MC_record_replay_is_active()){
if (timeout != -1)
xbt_die("Timeout not implemented for waitany in the model-checker");
int idx = SIMCALL_GET_MC_VALUE(simcall);
- synchro = xbt_dynar_get_as(synchros, idx, smx_synchro_t);
+ synchro = xbt_dynar_get_as(synchros, idx, smx_activity_t);
synchro->simcalls.push_back(simcall);
simcall_comm_waitany__set__result(simcall, idx);
synchro->state = SIMIX_DONE;
void SIMIX_waitany_remove_simcall_from_actions(smx_simcall_t simcall)
{
- smx_synchro_t synchro;
+ smx_activity_t synchro;
unsigned int cursor = 0;
xbt_dynar_t synchros = simcall_comm_waitany__get__comms(simcall);
* \brief Starts the simulation of a communication synchro.
* \param synchro the communication synchro
*/
-static inline void SIMIX_comm_start(smx_synchro_t synchro)
+static inline void SIMIX_comm_start(smx_activity_t synchro)
{
simgrid::kernel::activity::Comm *comm = static_cast<simgrid::kernel::activity::Comm*>(synchro);
* \brief Answers the SIMIX simcalls associated to a communication synchro.
* \param synchro a finished communication synchro
*/
-void SIMIX_comm_finish(smx_synchro_t synchro)
+void SIMIX_comm_finish(smx_activity_t synchro)
{
simgrid::kernel::activity::Comm *comm = static_cast<simgrid::kernel::activity::Comm*>(synchro);
unsigned int destroy_count = 0;
/******************************************************************************/
/* SIMIX_comm_copy_data callbacks */
/******************************************************************************/
-static void (*SIMIX_comm_copy_data_callback) (smx_synchro_t, void*, size_t) = &SIMIX_comm_copy_pointer_callback;
+static void (*SIMIX_comm_copy_data_callback) (smx_activity_t, void*, size_t) = &SIMIX_comm_copy_pointer_callback;
-void SIMIX_comm_set_copy_data_callback(void (*callback) (smx_synchro_t, void*, size_t))
+void SIMIX_comm_set_copy_data_callback(void (*callback) (smx_activity_t, void*, size_t))
{
SIMIX_comm_copy_data_callback = callback;
}
-void SIMIX_comm_copy_pointer_callback(smx_synchro_t synchro, void* buff, size_t buff_size)
+void SIMIX_comm_copy_pointer_callback(smx_activity_t synchro, void* buff, size_t buff_size)
{
simgrid::kernel::activity::Comm *comm = static_cast<simgrid::kernel::activity::Comm*>(synchro);
*(void **) (comm->dst_buff) = buff;
}
-void SIMIX_comm_copy_buffer_callback(smx_synchro_t synchro, void* buff, size_t buff_size)
+void SIMIX_comm_copy_buffer_callback(smx_activity_t synchro, void* buff, size_t buff_size)
{
simgrid::kernel::activity::Comm *comm = static_cast<simgrid::kernel::activity::Comm*>(synchro);
* \brief Copy the communication data from the sender's buffer to the receiver's one
* \param comm The communication
*/
-void SIMIX_comm_copy_data(smx_synchro_t synchro)
+void SIMIX_comm_copy_data(smx_activity_t synchro)
{
simgrid::kernel::activity::Comm *comm = static_cast<simgrid::kernel::activity::Comm*>(synchro);
simgrid::s4u::Mailbox piface_; // Our interface
char* name;
- std::deque<smx_synchro_t> comm_queue;
+ std::deque<smx_activity_t> comm_queue;
boost::intrusive_ptr<simgrid::simix::ActorImpl> permanent_receiver; //process which the mailbox is attached to
- std::deque<smx_synchro_t> done_comm_queue;//messages already received in the permanent receive mode
+ std::deque<smx_activity_t> done_comm_queue;//messages already received in the permanent receive mode
};
}
XBT_PRIVATE smx_mailbox_t SIMIX_mbox_create(const char *name);
XBT_PRIVATE smx_mailbox_t SIMIX_mbox_get_by_name(const char *name);
-XBT_PRIVATE void SIMIX_mbox_remove(smx_mailbox_t mbox, smx_synchro_t comm);
+XBT_PRIVATE void SIMIX_mbox_remove(smx_mailbox_t mbox, smx_activity_t comm);
XBT_PRIVATE void SIMIX_mbox_set_receiver(smx_mailbox_t mbox, smx_process_t proc);
-XBT_PRIVATE smx_synchro_t SIMIX_comm_irecv(smx_process_t dst_proc, smx_mailbox_t mbox,
+XBT_PRIVATE smx_activity_t SIMIX_comm_irecv(smx_process_t dst_proc, smx_mailbox_t mbox,
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),
+ int (*match_fun)(void *, void *, smx_activity_t),
+ void (*copy_data_fun)(smx_activity_t, void*, size_t),
void *data, double rate);
-XBT_PRIVATE smx_synchro_t SIMIX_comm_iprobe(smx_process_t dst_proc, smx_mailbox_t mbox, int type, int src,
- int tag, int (*match_fun)(void *, void *, smx_synchro_t), void *data);
+XBT_PRIVATE smx_activity_t SIMIX_comm_iprobe(smx_process_t dst_proc, smx_mailbox_t mbox, int type, int src,
+ int tag, int (*match_fun)(void *, void *, smx_activity_t), void *data);
#endif
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(simix_synchro, simix, "SIMIX Synchronization (mutex, semaphores and conditions)");
-static smx_synchro_t SIMIX_synchro_wait(sg_host_t smx_host, double timeout);
+static smx_activity_t SIMIX_synchro_wait(sg_host_t smx_host, double timeout);
static void _SIMIX_cond_wait(smx_cond_t cond, smx_mutex_t mutex, double timeout,
smx_process_t issuer, smx_simcall_t simcall);
static void _SIMIX_sem_wait(smx_sem_t sem, double timeout, smx_process_t issuer,
/***************************** Raw synchronization *********************************/
-static smx_synchro_t SIMIX_synchro_wait(sg_host_t smx_host, double timeout)
+static smx_activity_t SIMIX_synchro_wait(sg_host_t smx_host, double timeout)
{
XBT_IN("(%p, %f)",smx_host,timeout);
XBT_OUT();
}
-void SIMIX_synchro_finish(smx_synchro_t synchro)
+void SIMIX_synchro_finish(smx_activity_t synchro)
{
XBT_IN("(%p)",synchro);
smx_simcall_t simcall = synchro->simcalls.front();
{
XBT_IN("(%p; %p)", this, issuer);
/* FIXME: check where to validate the arguments */
- smx_synchro_t synchro = nullptr;
+ smx_activity_t synchro = nullptr;
if (this->locked) {
/* FIXME: check if the host is active ? */
smx_process_t issuer, smx_simcall_t simcall)
{
XBT_IN("(%p, %p, %f, %p,%p)",cond,mutex,timeout,issuer,simcall);
- smx_synchro_t synchro = nullptr;
+ smx_activity_t synchro = nullptr;
XBT_DEBUG("Wait condition %p", cond);
smx_simcall_t simcall)
{
XBT_IN("(%p, %f, %p, %p)",sem,timeout,issuer,simcall);
- smx_synchro_t synchro = nullptr;
+ smx_activity_t synchro = nullptr;
XBT_DEBUG("Wait semaphore %p (timeout:%f)", sem, timeout);
if (sem->value <= 0) {
xbt_swag_t sleeping; /* list of sleeping process */
} s_smx_sem_t;
-XBT_PRIVATE void SIMIX_post_synchro(smx_synchro_t synchro);
+XBT_PRIVATE void SIMIX_post_synchro(smx_activity_t synchro);
XBT_PRIVATE void SIMIX_synchro_stop_waiting(smx_process_t process, smx_simcall_t simcall);
-XBT_PRIVATE void SIMIX_synchro_destroy(smx_synchro_t synchro);
-XBT_PRIVATE void SIMIX_synchro_finish(smx_synchro_t synchro);
+XBT_PRIVATE void SIMIX_synchro_destroy(smx_activity_t synchro);
+XBT_PRIVATE void SIMIX_synchro_finish(smx_activity_t synchro);
XBT_PRIVATE smx_cond_t SIMIX_cond_init();
XBT_PRIVATE void SIMIX_cond_broadcast(smx_cond_t cond);
int truncated;
size_t real_size;
MPI_Comm comm;
- smx_synchro_t action;
+ smx_activity_t action;
unsigned flags;
int detached;
MPI_Request detached_sender;
XBT_PRIVATE void smpi_deployment_register_process(const char* instance_id, int rank, int index, MPI_Comm** comm, xbt_bar_t*bar);
XBT_PRIVATE void smpi_deployment_cleanup_instances();
-XBT_PRIVATE void smpi_comm_copy_buffer_callback(smx_synchro_t comm, void *buff, size_t buff_size);
+XBT_PRIVATE void smpi_comm_copy_buffer_callback(smx_activity_t comm, void *buff, size_t buff_size);
-XBT_PRIVATE void smpi_comm_null_copy_buffer_callback(smx_synchro_t comm, void *buff, size_t buff_size);
+XBT_PRIVATE void smpi_comm_null_copy_buffer_callback(smx_activity_t comm, void *buff, size_t buff_size);
XBT_PRIVATE void print_request(const char *message, MPI_Request request);
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_base, smpi, "Logging specific to SMPI (base)");
-static int match_recv(void* a, void* b, smx_synchro_t ignored) {
+static int match_recv(void* a, void* b, smx_activity_t ignored) {
MPI_Request ref = static_cast<MPI_Request>(a);
MPI_Request req = static_cast<MPI_Request>(b);
XBT_DEBUG("Trying to match a recv of src %d against %d, tag %d against %d",ref->src,req->src, ref->tag, req->tag);
}else return 0;
}
-static int match_send(void* a, void* b,smx_synchro_t ignored) {
+static int match_send(void* a, void* b,smx_activity_t ignored) {
MPI_Request ref = static_cast<MPI_Request>(a);
MPI_Request req = static_cast<MPI_Request>(b);
XBT_DEBUG("Trying to match a send of src %d against %d, tag %d against %d",ref->src,req->src, ref->tag, req->tag);
//begin with the more appropriate one : the small one.
mailbox = smpi_process_mailbox_small();
XBT_DEBUG("Is there a corresponding send already posted in the small mailbox %p (in case of SSEND)?", mailbox);
- smx_synchro_t action = simcall_comm_iprobe(mailbox, 0, request->src,request->tag, &match_recv, static_cast<void*>(request));
+ smx_activity_t action = simcall_comm_iprobe(mailbox, 0, request->src,request->tag, &match_recv, static_cast<void*>(request));
if (action == nullptr) {
mailbox = smpi_process_mailbox();
else {
mailbox = smpi_process_mailbox_small();
XBT_DEBUG("Is there a corresponding send already posted the small mailbox?");
- smx_synchro_t action = simcall_comm_iprobe(mailbox, 0, request->src,request->tag, &match_recv, (void*)request);
+ smx_activity_t action = simcall_comm_iprobe(mailbox, 0, request->src,request->tag, &match_recv, (void*)request);
if (action == nullptr) {
XBT_DEBUG("No, nothing in the permanent receive mailbox");
else if (((request->flags & RMA) != 0) || static_cast<int>(request->size) < async_small_thresh) { // eager mode
mailbox = smpi_process_remote_mailbox(receiver);
XBT_DEBUG("Is there a corresponding recv already posted in the large mailbox %p?", mailbox);
- smx_synchro_t action = simcall_comm_iprobe(mailbox, 1,request->dst, request->tag, &match_send, static_cast<void*>(request));
+ smx_activity_t action = simcall_comm_iprobe(mailbox, 1,request->dst, request->tag, &match_send, static_cast<void*>(request));
if (action == nullptr) {
if ((request->flags & SSEND) == 0){
mailbox = smpi_process_remote_mailbox_small(receiver);
if(count > 0) {
// Wait for a request to complete
- comms = xbt_dynar_new(sizeof(smx_synchro_t), nullptr);
+ comms = xbt_dynar_new(sizeof(smx_activity_t), nullptr);
map = xbt_new(int, count);
XBT_DEBUG("Wait for one of %d", count);
for(i = 0; i < count; i++) {
}
void smpi_execute_flops(double flops) {
- smx_synchro_t action;
+ smx_activity_t action;
XBT_DEBUG("Handle real computation time: %f flops", flops);
action = simcall_execution_start("computation", flops, 1, 0, 0);
simcall_set_category (action, TRACE_internal_smpi_get_category());
message, request, request->buf, request->size, request->src, request->dst, request->tag, request->flags);
}
-void smpi_comm_copy_buffer_callback(smx_synchro_t synchro, void *buff, size_t buff_size)
+void smpi_comm_copy_buffer_callback(smx_activity_t synchro, void *buff, size_t buff_size)
{
XBT_DEBUG("Copy the data over");
void* tmpbuff=buff;
if(tmpbuff!=buff)xbt_free(tmpbuff);
}
-void smpi_comm_null_copy_buffer_callback(smx_synchro_t comm, void *buff, size_t buff_size)
+void smpi_comm_null_copy_buffer_callback(smx_activity_t comm, void *buff, size_t buff_size)
{
return;
}