friend Comm;
private:
- Mailbox(const char*name, smx_rdv_t inferior);
+ Mailbox(const char*name, smx_mailbox_t inferior);
public:
~Mailbox();
protected:
- smx_rdv_t getInferior() { return inferior_; }
+ smx_mailbox_t getInferior() { return inferior_; }
public:
/** Get the name of that mailbox */
private:
std::string name_;
- smx_rdv_t inferior_;
+ smx_mailbox_t inferior_;
static boost::unordered_map<std::string, Mailbox *> *mailboxes;
};
}} // namespace simgrid::s4u
/**
* \ingroup simix_rdv_management
*/
-typedef struct s_smx_rvpoint *smx_rdv_t;
+typedef struct s_smx_rvpoint *smx_mailbox_t;
XBT_PUBLIC(void*) SIMIX_comm_get_src_data(smx_synchro_t synchro);
XBT_PUBLIC(void*) SIMIX_comm_get_dst_data(smx_synchro_t synchro);
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(smx_synchro_t) SIMIX_comm_get_send_match(smx_rdv_t rdv, int (*match_fun)(void*, void*), void* data);
-XBT_PUBLIC(int) SIMIX_comm_has_send_match(smx_rdv_t rdv, int (*match_fun)(void*, void*), void* data);
-XBT_PUBLIC(int) SIMIX_comm_has_recv_match(smx_rdv_t rdv, int (*match_fun)(void*, void*), void* data);
+XBT_PUBLIC(smx_synchro_t) SIMIX_comm_get_send_match(smx_mailbox_t rdv, int (*match_fun)(void*, void*), void* data);
+XBT_PUBLIC(int) SIMIX_comm_has_send_match(smx_mailbox_t rdv, int (*match_fun)(void*, void*), void* data);
+XBT_PUBLIC(int) SIMIX_comm_has_recv_match(smx_mailbox_t rdv, int (*match_fun)(void*, void*), void* data);
XBT_PUBLIC(void) SIMIX_comm_finish(smx_synchro_t synchro);
/******************************************************************************/
/************************** Comunication simcalls *****************************/
/***** Rendez-vous points *****/
-XBT_PUBLIC(smx_rdv_t) simcall_rdv_create(const char *name);
-XBT_PUBLIC(void) simcall_rdv_destroy(smx_rdv_t rvp);
-XBT_PUBLIC(smx_rdv_t) simcall_rdv_get_by_name(const char *name);
-XBT_PUBLIC(int) simcall_rdv_comm_count_by_host(smx_rdv_t rdv, sg_host_t host);
-XBT_PUBLIC(smx_synchro_t) simcall_rdv_get_head(smx_rdv_t rdv);
-XBT_PUBLIC(smx_process_t) simcall_rdv_get_receiver(smx_rdv_t rdv);
-XBT_PUBLIC(void) simcall_rdv_set_receiver(smx_rdv_t rdv , smx_process_t process);
+XBT_PUBLIC(smx_mailbox_t) simcall_rdv_create(const char *name);
+XBT_PUBLIC(void) simcall_rdv_destroy(smx_mailbox_t rvp);
+XBT_PUBLIC(smx_mailbox_t) simcall_rdv_get_by_name(const char *name);
+XBT_PUBLIC(int) simcall_rdv_comm_count_by_host(smx_mailbox_t rdv, sg_host_t host);
+XBT_PUBLIC(smx_synchro_t) simcall_rdv_get_head(smx_mailbox_t rdv);
+XBT_PUBLIC(smx_process_t) simcall_rdv_get_receiver(smx_mailbox_t rdv);
+XBT_PUBLIC(void) simcall_rdv_set_receiver(smx_mailbox_t rdv , smx_process_t process);
XBT_PUBLIC(xbt_dict_t) SIMIX_get_rdv_points(void);
/***** Communication simcalls *****/
-XBT_PUBLIC(void) simcall_comm_send(smx_process_t sender, smx_rdv_t rdv, double task_size,
+XBT_PUBLIC(void) simcall_comm_send(smx_process_t sender, smx_mailbox_t rdv, double task_size,
double rate, void *src_buff,
size_t src_buff_size,
int (*match_fun)(void *, void *, smx_synchro_t),
void (*copy_data_fun)(smx_synchro_t, void*, size_t),
void *data, double timeout);
-XBT_PUBLIC(smx_synchro_t) simcall_comm_isend(smx_process_t sender, smx_rdv_t rdv,
+XBT_PUBLIC(smx_synchro_t) simcall_comm_isend(smx_process_t sender, smx_mailbox_t rdv,
double task_size,
double rate, void *src_buff,
size_t src_buff_size,
void (*copy_data_fun)(smx_synchro_t, void*, size_t),
void *data, int detached);
-XBT_PUBLIC(void) simcall_comm_recv(smx_process_t receiver, smx_rdv_t rdv, void *dst_buff,
+XBT_PUBLIC(void) simcall_comm_recv(smx_process_t receiver, smx_mailbox_t rdv, void *dst_buff,
size_t * dst_buff_size,
int (*match_fun)(void *, void *, smx_synchro_t),
void (*copy_data_fun)(smx_synchro_t, void*, size_t),
void *data, double timeout, double rate);
-XBT_PUBLIC(smx_synchro_t) simcall_comm_irecv(smx_process_t receiver, smx_rdv_t rdv, void *dst_buff,
+XBT_PUBLIC(smx_synchro_t) simcall_comm_irecv(smx_process_t receiver, smx_mailbox_t rdv, void *dst_buff,
size_t * dst_buff_size,
int (*match_fun)(void *, void *, smx_synchro_t),
void (*copy_data_fun)(smx_synchro_t, void*, size_t),
void *data, double rate);
-XBT_PUBLIC(smx_synchro_t) simcall_comm_iprobe(smx_rdv_t rdv, int type, int src, int tag,
+XBT_PUBLIC(smx_synchro_t) simcall_comm_iprobe(smx_mailbox_t rdv, 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);
}
static inline
-smx_rdv_t MC_get_rdv(smx_simcall_t r)
+smx_mailbox_t MC_get_rdv(smx_simcall_t r)
{
switch(r->call) {
case SIMCALL_COMM_ISEND:
if ((r1->call == SIMCALL_COMM_ISEND || r1->call == SIMCALL_COMM_IRECV)
&& r2->call == SIMCALL_COMM_WAIT) {
- smx_rdv_t rdv = MC_get_rdv(r1);
+ smx_mailbox_t rdv = MC_get_rdv(r1);
if (rdv != synchro2->comm.rdv_cpy
&& simcall_comm_wait__get__timeout(r2) <= 0)
*/
msg_comm_t MSG_task_irecv_bounded(msg_task_t *task, const char *name, double rate)
{
- smx_rdv_t rdv = MSG_mailbox_get_by_alias(name);
+ smx_mailbox_t rdv = MSG_mailbox_get_by_alias(name);
/* FIXME: these functions are not traceable */
/* Sanity check */
*/
int MSG_task_listen(const char *alias)
{
- smx_rdv_t rdv = MSG_mailbox_get_by_alias(alias);
+ smx_mailbox_t rdv = MSG_mailbox_get_by_alias(alias);
return !MSG_mailbox_is_empty(rdv) || (rdv->permanent_receiver && xbt_fifo_size(rdv->done_comm_fifo)!=0);
}
boost::unordered_map <std::string, s4u::Mailbox *> *s4u::Mailbox::mailboxes = new boost::unordered_map<std::string, s4u::Mailbox*> ();
-s4u::Mailbox::Mailbox(const char*name, smx_rdv_t inferior) {
+s4u::Mailbox::Mailbox(const char*name, smx_mailbox_t inferior) {
inferior_ = inferior;
name_ = name;
mailboxes->insert({name, this});
* \param name The name of the rendez-vous point
* \return The created rendez-vous point
*/
-smx_rdv_t simcall_rdv_create(const char *name)
+smx_mailbox_t simcall_rdv_create(const char *name)
{
return simcall_BODY_rdv_create(name);
}
* \brief Destroy a rendez-vous point
* \param rdv The rendez-vous point to destroy
*/
-void simcall_rdv_destroy(smx_rdv_t rdv)
+void simcall_rdv_destroy(smx_mailbox_t rdv)
{
simcall_BODY_rdv_destroy(rdv);
}
* \ingroup simix_rdv_management
* \brief Returns a rendez-vous point knowing its name
*/
-smx_rdv_t simcall_rdv_get_by_name(const char *name)
+smx_mailbox_t simcall_rdv_get_by_name(const char *name)
{
xbt_assert(name != NULL, "Invalid parameter for simcall_rdv_get_by_name (name is NULL)");
* \param host The host to be counted
* \return The number of comm synchros pending in the rdv
*/
-int simcall_rdv_comm_count_by_host(smx_rdv_t rdv, sg_host_t host)
+int simcall_rdv_comm_count_by_host(smx_mailbox_t rdv, sg_host_t host)
{
return simcall_BODY_rdv_comm_count_by_host(rdv, host);
}
* \param rdv The rendez-vous point
* \return The communication or NULL if empty
*/
-smx_synchro_t simcall_rdv_get_head(smx_rdv_t rdv)
+smx_synchro_t simcall_rdv_get_head(smx_mailbox_t rdv)
{
return simcall_BODY_rdv_get_head(rdv);
}
-void simcall_rdv_set_receiver(smx_rdv_t rdv, smx_process_t process)
+void simcall_rdv_set_receiver(smx_mailbox_t rdv, smx_process_t process)
{
simcall_BODY_rdv_set_receiver(rdv, process);
}
-smx_process_t simcall_rdv_get_receiver(smx_rdv_t rdv)
+smx_process_t simcall_rdv_get_receiver(smx_mailbox_t rdv)
{
return simcall_BODY_rdv_get_receiver(rdv);
}
/**
* \ingroup simix_comm_management
*/
-void simcall_comm_send(smx_process_t sender, smx_rdv_t rdv, double task_size, double rate,
+void simcall_comm_send(smx_process_t sender, smx_mailbox_t rdv, double task_size, double rate,
void *src_buff, size_t src_buff_size,
int (*match_fun)(void *, void *, smx_synchro_t),
void (*copy_data_fun)(smx_synchro_t, void*, size_t), void *data,
/**
* \ingroup simix_comm_management
*/
-smx_synchro_t simcall_comm_isend(smx_process_t sender, smx_rdv_t rdv, double task_size, double rate,
+smx_synchro_t simcall_comm_isend(smx_process_t sender, smx_mailbox_t rdv, double task_size, double rate,
void *src_buff, size_t src_buff_size,
int (*match_fun)(void *, void *, smx_synchro_t),
void (*clean_fun)(void *),
/**
* \ingroup simix_comm_management
*/
-void simcall_comm_recv(smx_process_t receiver, smx_rdv_t rdv, void *dst_buff, size_t * dst_buff_size,
+void simcall_comm_recv(smx_process_t receiver, smx_mailbox_t rdv, void *dst_buff, size_t * dst_buff_size,
int (*match_fun)(void *, void *, smx_synchro_t),
void (*copy_data_fun)(smx_synchro_t, void*, size_t),
void *data, double timeout, double rate)
/**
* \ingroup simix_comm_management
*/
-smx_synchro_t simcall_comm_irecv(smx_process_t receiver, smx_rdv_t rdv, void *dst_buff, size_t *dst_buff_size,
+smx_synchro_t simcall_comm_irecv(smx_process_t receiver, smx_mailbox_t rdv, void *dst_buff, size_t *dst_buff_size,
int (*match_fun)(void *, void *, smx_synchro_t),
void (*copy_data_fun)(smx_synchro_t, void*, size_t),
void *data, double rate)
/**
* \ingroup simix_comm_management
*/
-smx_synchro_t simcall_comm_iprobe(smx_rdv_t rdv, int type, int src, int tag,
+smx_synchro_t simcall_comm_iprobe(smx_mailbox_t rdv, int type, int src, int tag,
int (*match_fun)(void *, void *, smx_synchro_t), void *data)
{
xbt_assert(rdv, "No rendez-vous point defined for iprobe");
static inline void simcall_rdv_create__set__name(smx_simcall_t simcall, const char* arg) {
simcall->args[0].cc = arg;
}
-static inline smx_rdv_t simcall_rdv_create__get__result(smx_simcall_t simcall){
- return (smx_rdv_t) simcall->result.dp;
+static inline smx_mailbox_t simcall_rdv_create__get__result(smx_simcall_t simcall){
+ return (smx_mailbox_t) simcall->result.dp;
}
static inline void simcall_rdv_create__set__result(smx_simcall_t simcall, void* result){
simcall->result.dp = result;
}
-static inline smx_rdv_t simcall_rdv_destroy__get__rdv(smx_simcall_t simcall) {
- return (smx_rdv_t) simcall->args[0].dp;
+static inline smx_mailbox_t simcall_rdv_destroy__get__rdv(smx_simcall_t simcall) {
+ return (smx_mailbox_t) simcall->args[0].dp;
}
static inline void simcall_rdv_destroy__set__rdv(smx_simcall_t simcall, void* arg) {
simcall->args[0].dp = arg;
}
-static inline smx_rdv_t simcall_rdv_comm_count_by_host__get__rdv(smx_simcall_t simcall) {
- return (smx_rdv_t) simcall->args[0].dp;
+static inline smx_mailbox_t simcall_rdv_comm_count_by_host__get__rdv(smx_simcall_t simcall) {
+ return (smx_mailbox_t) simcall->args[0].dp;
}
static inline void simcall_rdv_comm_count_by_host__set__rdv(smx_simcall_t simcall, void* arg) {
simcall->args[0].dp = arg;
simcall->result.ui = result;
}
-static inline smx_rdv_t simcall_rdv_get_head__get__rdv(smx_simcall_t simcall) {
- return (smx_rdv_t) simcall->args[0].dp;
+static inline smx_mailbox_t simcall_rdv_get_head__get__rdv(smx_simcall_t simcall) {
+ return (smx_mailbox_t) simcall->args[0].dp;
}
static inline void simcall_rdv_get_head__set__rdv(smx_simcall_t simcall, void* arg) {
simcall->args[0].dp = arg;
simcall->result.dp = result;
}
-static inline smx_rdv_t simcall_rdv_set_receiver__get__rdv(smx_simcall_t simcall) {
- return (smx_rdv_t) simcall->args[0].dp;
+static inline smx_mailbox_t simcall_rdv_set_receiver__get__rdv(smx_simcall_t simcall) {
+ return (smx_mailbox_t) simcall->args[0].dp;
}
static inline void simcall_rdv_set_receiver__set__rdv(smx_simcall_t simcall, void* arg) {
simcall->args[0].dp = arg;
simcall->args[1].dp = arg;
}
-static inline smx_rdv_t simcall_rdv_get_receiver__get__rdv(smx_simcall_t simcall) {
- return (smx_rdv_t) simcall->args[0].dp;
+static inline smx_mailbox_t simcall_rdv_get_receiver__get__rdv(smx_simcall_t simcall) {
+ return (smx_mailbox_t) simcall->args[0].dp;
}
static inline void simcall_rdv_get_receiver__set__rdv(smx_simcall_t simcall, void* arg) {
simcall->args[0].dp = arg;
simcall->result.dp = result;
}
-static inline smx_rdv_t simcall_comm_iprobe__get__rdv(smx_simcall_t simcall) {
- return (smx_rdv_t) simcall->args[0].dp;
+static inline smx_mailbox_t simcall_comm_iprobe__get__rdv(smx_simcall_t simcall) {
+ return (smx_mailbox_t) simcall->args[0].dp;
}
static inline void simcall_comm_iprobe__set__rdv(smx_simcall_t simcall, void* arg) {
simcall->args[0].dp = arg;
static inline void simcall_comm_send__set__sender(smx_simcall_t simcall, void* arg) {
simcall->args[0].dp = arg;
}
-static inline smx_rdv_t simcall_comm_send__get__rdv(smx_simcall_t simcall) {
- return (smx_rdv_t) simcall->args[1].dp;
+static inline smx_mailbox_t simcall_comm_send__get__rdv(smx_simcall_t simcall) {
+ return (smx_mailbox_t) simcall->args[1].dp;
}
static inline void simcall_comm_send__set__rdv(smx_simcall_t simcall, void* arg) {
simcall->args[1].dp = arg;
static inline void simcall_comm_isend__set__sender(smx_simcall_t simcall, void* arg) {
simcall->args[0].dp = arg;
}
-static inline smx_rdv_t simcall_comm_isend__get__rdv(smx_simcall_t simcall) {
- return (smx_rdv_t) simcall->args[1].dp;
+static inline smx_mailbox_t simcall_comm_isend__get__rdv(smx_simcall_t simcall) {
+ return (smx_mailbox_t) simcall->args[1].dp;
}
static inline void simcall_comm_isend__set__rdv(smx_simcall_t simcall, void* arg) {
simcall->args[1].dp = arg;
static inline void simcall_comm_recv__set__receiver(smx_simcall_t simcall, void* arg) {
simcall->args[0].dp = arg;
}
-static inline smx_rdv_t simcall_comm_recv__get__rdv(smx_simcall_t simcall) {
- return (smx_rdv_t) simcall->args[1].dp;
+static inline smx_mailbox_t simcall_comm_recv__get__rdv(smx_simcall_t simcall) {
+ return (smx_mailbox_t) simcall->args[1].dp;
}
static inline void simcall_comm_recv__set__rdv(smx_simcall_t simcall, void* arg) {
simcall->args[1].dp = arg;
static inline void simcall_comm_irecv__set__receiver(smx_simcall_t simcall, void* arg) {
simcall->args[0].dp = arg;
}
-static inline smx_rdv_t simcall_comm_irecv__get__rdv(smx_simcall_t simcall) {
- return (smx_rdv_t) simcall->args[1].dp;
+static inline smx_mailbox_t simcall_comm_irecv__get__rdv(smx_simcall_t simcall) {
+ return (smx_mailbox_t) simcall->args[1].dp;
}
static inline void simcall_comm_irecv__set__rdv(smx_simcall_t simcall, void* arg) {
simcall->args[1].dp = arg;
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_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_rdv_t rdv, 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_rdv_t rdv, 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_rdv_t rdv, 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_rdv_t rdv, 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_rdv_t rdv, 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_synchro_t simcall_HANDLER_comm_iprobe(smx_simcall_t simcall, smx_mailbox_t rdv, 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 rdv, 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 rdv, 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 rdv, 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 rdv, 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);
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);
return (smx_process_t) self->simcall.result.dp;
}
-inline static smx_rdv_t simcall_BODY_rdv_create(const char* name) {
+inline static smx_mailbox_t simcall_BODY_rdv_create(const char* name) {
smx_process_t self = SIMIX_process_self();
/* Go to that function to follow the code flow through the simcall barrier */
} else {
SIMIX_simcall_handle(&self->simcall, 0);
}
- return (smx_rdv_t) self->simcall.result.dp;
+ return (smx_mailbox_t) self->simcall.result.dp;
}
-inline static void simcall_BODY_rdv_destroy(smx_rdv_t rdv) {
+inline static void simcall_BODY_rdv_destroy(smx_mailbox_t rdv) {
smx_process_t self = SIMIX_process_self();
/* Go to that function to follow the code flow through the simcall barrier */
}
-inline static unsigned int simcall_BODY_rdv_comm_count_by_host(smx_rdv_t rdv, sg_host_t host) {
+inline static unsigned int simcall_BODY_rdv_comm_count_by_host(smx_mailbox_t rdv, sg_host_t host) {
smx_process_t self = SIMIX_process_self();
/* Go to that function to follow the code flow through the simcall barrier */
return (unsigned int) self->simcall.result.ui;
}
-inline static smx_synchro_t simcall_BODY_rdv_get_head(smx_rdv_t rdv) {
+inline static smx_synchro_t simcall_BODY_rdv_get_head(smx_mailbox_t rdv) {
smx_process_t self = SIMIX_process_self();
/* Go to that function to follow the code flow through the simcall barrier */
return (smx_synchro_t) self->simcall.result.dp;
}
-inline static void simcall_BODY_rdv_set_receiver(smx_rdv_t rdv, smx_process_t receiver) {
+inline static void simcall_BODY_rdv_set_receiver(smx_mailbox_t rdv, smx_process_t receiver) {
smx_process_t self = SIMIX_process_self();
/* Go to that function to follow the code flow through the simcall barrier */
}
-inline static smx_process_t simcall_BODY_rdv_get_receiver(smx_rdv_t rdv) {
+inline static smx_process_t simcall_BODY_rdv_get_receiver(smx_mailbox_t rdv) {
smx_process_t self = SIMIX_process_self();
/* Go to that function to follow the code flow through the simcall barrier */
return (smx_process_t) self->simcall.result.dp;
}
-inline static smx_synchro_t simcall_BODY_comm_iprobe(smx_rdv_t rdv, int type, int src, int tag, simix_match_func_t match_fun, void* data) {
+inline static smx_synchro_t simcall_BODY_comm_iprobe(smx_mailbox_t rdv, int type, int src, int tag, simix_match_func_t match_fun, void* data) {
smx_process_t self = SIMIX_process_self();
/* Go to that function to follow the code flow through the simcall barrier */
return (smx_synchro_t) self->simcall.result.dp;
}
-inline static void simcall_BODY_comm_send(smx_process_t sender, smx_rdv_t rdv, 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) {
+inline static void simcall_BODY_comm_send(smx_process_t sender, smx_mailbox_t rdv, 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) {
smx_process_t self = SIMIX_process_self();
/* Go to that function to follow the code flow through the simcall barrier */
}
-inline static smx_synchro_t simcall_BODY_comm_isend(smx_process_t sender, smx_rdv_t rdv, 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_synchro_t simcall_BODY_comm_isend(smx_process_t sender, smx_mailbox_t rdv, 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_process_t self = SIMIX_process_self();
/* Go to that function to follow the code flow through the simcall barrier */
return (smx_synchro_t) self->simcall.result.dp;
}
-inline static void simcall_BODY_comm_recv(smx_process_t receiver, smx_rdv_t rdv, 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) {
+inline static void simcall_BODY_comm_recv(smx_process_t receiver, smx_mailbox_t rdv, 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) {
smx_process_t self = SIMIX_process_self();
/* Go to that function to follow the code flow through the simcall barrier */
}
-inline static smx_synchro_t simcall_BODY_comm_irecv(smx_process_t receiver, smx_rdv_t rdv, 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_synchro_t simcall_BODY_comm_irecv(smx_process_t receiver, smx_mailbox_t rdv, 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_process_t self = SIMIX_process_self();
/* Go to that function to follow the code flow through the simcall barrier */
break;
case SIMCALL_RDV_DESTROY:
- SIMIX_rdv_destroy((smx_rdv_t) simcall->args[0].dp);
+ SIMIX_rdv_destroy((smx_mailbox_t) simcall->args[0].dp);
SIMIX_simcall_answer(simcall);
break;
case SIMCALL_RDV_COMM_COUNT_BY_HOST:
- simcall->result.ui = SIMIX_rdv_comm_count_by_host((smx_rdv_t) simcall->args[0].dp,(sg_host_t) simcall->args[1].dp);
+ simcall->result.ui = SIMIX_rdv_comm_count_by_host((smx_mailbox_t) simcall->args[0].dp,(sg_host_t) simcall->args[1].dp);
SIMIX_simcall_answer(simcall);
break;
case SIMCALL_RDV_GET_HEAD:
- simcall->result.dp = SIMIX_rdv_get_head((smx_rdv_t) simcall->args[0].dp);
+ simcall->result.dp = SIMIX_rdv_get_head((smx_mailbox_t) simcall->args[0].dp);
SIMIX_simcall_answer(simcall);
break;
case SIMCALL_RDV_SET_RECEIVER:
- SIMIX_rdv_set_receiver((smx_rdv_t) simcall->args[0].dp,(smx_process_t) simcall->args[1].dp);
+ SIMIX_rdv_set_receiver((smx_mailbox_t) simcall->args[0].dp,(smx_process_t) simcall->args[1].dp);
SIMIX_simcall_answer(simcall);
break;
case SIMCALL_RDV_GET_RECEIVER:
- simcall->result.dp = SIMIX_rdv_get_receiver((smx_rdv_t) simcall->args[0].dp);
+ simcall->result.dp = SIMIX_rdv_get_receiver((smx_mailbox_t) simcall->args[0].dp);
SIMIX_simcall_answer(simcall);
break;
case SIMCALL_COMM_IPROBE:
- simcall->result.dp = simcall_HANDLER_comm_iprobe(simcall , (smx_rdv_t) simcall->args[0].dp, simcall->args[1].i, simcall->args[2].i, simcall->args[3].i, (simix_match_func_t) simcall->args[4].fp, simcall->args[5].dp);
+ simcall->result.dp = simcall_HANDLER_comm_iprobe(simcall , (smx_mailbox_t) simcall->args[0].dp, simcall->args[1].i, simcall->args[2].i, simcall->args[3].i, (simix_match_func_t) simcall->args[4].fp, simcall->args[5].dp);
SIMIX_simcall_answer(simcall);
break;
case SIMCALL_COMM_SEND:
- simcall_HANDLER_comm_send(simcall , (smx_process_t) simcall->args[0].dp, (smx_rdv_t) simcall->args[1].dp, simcall->args[2].d, simcall->args[3].d, simcall->args[4].dp, simcall->args[5].sz, (simix_match_func_t) simcall->args[6].fp, (simix_copy_data_func_t) simcall->args[7].fp, simcall->args[8].dp, simcall->args[9].d);
+ simcall_HANDLER_comm_send(simcall , (smx_process_t) simcall->args[0].dp, (smx_mailbox_t) simcall->args[1].dp, simcall->args[2].d, simcall->args[3].d, simcall->args[4].dp, simcall->args[5].sz, (simix_match_func_t) simcall->args[6].fp, (simix_copy_data_func_t) simcall->args[7].fp, simcall->args[8].dp, simcall->args[9].d);
break;
case SIMCALL_COMM_ISEND:
- simcall->result.dp = simcall_HANDLER_comm_isend(simcall , (smx_process_t) simcall->args[0].dp, (smx_rdv_t) simcall->args[1].dp, simcall->args[2].d, simcall->args[3].d, simcall->args[4].dp, simcall->args[5].sz, (simix_match_func_t) simcall->args[6].fp, (simix_clean_func_t) simcall->args[7].fp, (simix_copy_data_func_t) simcall->args[8].fp, simcall->args[9].dp, simcall->args[10].i);
+ simcall->result.dp = simcall_HANDLER_comm_isend(simcall , (smx_process_t) simcall->args[0].dp, (smx_mailbox_t) simcall->args[1].dp, simcall->args[2].d, simcall->args[3].d, simcall->args[4].dp, simcall->args[5].sz, (simix_match_func_t) simcall->args[6].fp, (simix_clean_func_t) simcall->args[7].fp, (simix_copy_data_func_t) simcall->args[8].fp, simcall->args[9].dp, simcall->args[10].i);
SIMIX_simcall_answer(simcall);
break;
case SIMCALL_COMM_RECV:
- simcall_HANDLER_comm_recv(simcall , (smx_process_t) simcall->args[0].dp, (smx_rdv_t) simcall->args[1].dp, simcall->args[2].dp, (size_t*) simcall->args[3].dp, (simix_match_func_t) simcall->args[4].fp, (simix_copy_data_func_t) simcall->args[5].fp, simcall->args[6].dp, simcall->args[7].d, simcall->args[8].d);
+ simcall_HANDLER_comm_recv(simcall , (smx_process_t) simcall->args[0].dp, (smx_mailbox_t) simcall->args[1].dp, simcall->args[2].dp, (size_t*) simcall->args[3].dp, (simix_match_func_t) simcall->args[4].fp, (simix_copy_data_func_t) simcall->args[5].fp, simcall->args[6].dp, simcall->args[7].d, simcall->args[8].d);
break;
case SIMCALL_COMM_IRECV:
- simcall->result.dp = simcall_HANDLER_comm_irecv(simcall , (smx_process_t) simcall->args[0].dp, (smx_rdv_t) simcall->args[1].dp, simcall->args[2].dp, (size_t*) simcall->args[3].dp, (simix_match_func_t) simcall->args[4].fp, (simix_copy_data_func_t) simcall->args[5].fp, simcall->args[6].dp, simcall->args[7].d);
+ simcall->result.dp = simcall_HANDLER_comm_irecv(simcall , (smx_process_t) simcall->args[0].dp, (smx_mailbox_t) simcall->args[1].dp, simcall->args[2].dp, (size_t*) simcall->args[3].dp, (simix_match_func_t) simcall->args[4].fp, (simix_copy_data_func_t) simcall->args[5].fp, simcall->args[6].dp, simcall->args[7].d);
SIMIX_simcall_answer(simcall);
break;
Proc - process_auto_restart_set (void) (process, void*, smx_process_t) (auto_restart, int)
Func H process_restart (void*, smx_process_t) (process, void*, smx_process_t)
-Func - rdv_create (void*, smx_rdv_t) (name, const char*)
-Proc - rdv_destroy (void) (rdv, void*, smx_rdv_t)
-Func - rdv_comm_count_by_host (unsigned int) (rdv, void*, smx_rdv_t) (host, void*, sg_host_t)
-Func - rdv_get_head (void*, smx_synchro_t) (rdv, void*, smx_rdv_t)
-Proc - rdv_set_receiver (void) (rdv, void*, smx_rdv_t) (receiver, void*, smx_process_t)
-Func - rdv_get_receiver (void*, smx_process_t) (rdv, void*, smx_rdv_t)
-
-Func H comm_iprobe (void*, smx_synchro_t) (rdv, void*, smx_rdv_t) (type, int) (src, int) (tag, int) (match_fun, FPtr, simix_match_func_t) (data, void*)
-Blck H comm_send (void) (sender, void*, smx_process_t) (rdv, void*, smx_rdv_t) (task_size, double) (rate, double) (src_buff, void*) (src_buff_size, size_t) (match_fun, FPtr, simix_match_func_t) (copy_data_fun, FPtr, simix_copy_data_func_t) (data, void*) (timeout, double)
-Func H comm_isend (void*, smx_synchro_t) (sender, void*, smx_process_t) (rdv, void*, smx_rdv_t) (task_size, double) (rate, double) (src_buff, void*) (src_buff_size, size_t) (match_fun, FPtr, simix_match_func_t) (clean_fun, FPtr, simix_clean_func_t) (copy_data_fun, FPtr, simix_copy_data_func_t) (data, void*) (detached, int)
-Blck H comm_recv (void) (receiver, void*, smx_process_t) (rdv, void*, smx_rdv_t) (dst_buff, void*) (dst_buff_size, void*, size_t*) (match_fun, FPtr, simix_match_func_t) (copy_data_fun, FPtr, simix_copy_data_func_t) (data, void*) (timeout, double) (rate, double)
-Func H comm_irecv (void*, smx_synchro_t) (receiver, void*, smx_process_t) (rdv, void*, smx_rdv_t) (dst_buff, void*) (dst_buff_size, void*, size_t*) (match_fun, FPtr, simix_match_func_t) (copy_data_fun, FPtr, simix_copy_data_func_t) (data, void*) (rate, double)
+Func - rdv_create (void*, smx_mailbox_t) (name, const char*)
+Proc - rdv_destroy (void) (rdv, void*, smx_mailbox_t)
+Func - rdv_comm_count_by_host (unsigned int) (rdv, void*, smx_mailbox_t) (host, void*, sg_host_t)
+Func - rdv_get_head (void*, smx_synchro_t) (rdv, void*, smx_mailbox_t)
+Proc - rdv_set_receiver (void) (rdv, void*, smx_mailbox_t) (receiver, void*, smx_process_t)
+Func - rdv_get_receiver (void*, smx_process_t) (rdv, void*, smx_mailbox_t)
+
+Func H comm_iprobe (void*, smx_synchro_t) (rdv, void*, smx_mailbox_t) (type, int) (src, int) (tag, int) (match_fun, FPtr, simix_match_func_t) (data, void*)
+Blck H comm_send (void) (sender, void*, smx_process_t) (rdv, void*, smx_mailbox_t) (task_size, double) (rate, double) (src_buff, void*) (src_buff_size, size_t) (match_fun, FPtr, simix_match_func_t) (copy_data_fun, FPtr, simix_copy_data_func_t) (data, void*) (timeout, double)
+Func H comm_isend (void*, smx_synchro_t) (sender, void*, smx_process_t) (rdv, void*, smx_mailbox_t) (task_size, double) (rate, double) (src_buff, void*) (src_buff_size, size_t) (match_fun, FPtr, simix_match_func_t) (clean_fun, FPtr, simix_clean_func_t) (copy_data_fun, FPtr, simix_copy_data_func_t) (data, void*) (detached, int)
+Blck H comm_recv (void) (receiver, void*, smx_process_t) (rdv, void*, smx_mailbox_t) (dst_buff, void*) (dst_buff_size, void*, size_t*) (match_fun, FPtr, simix_match_func_t) (copy_data_fun, FPtr, simix_copy_data_func_t) (data, void*) (timeout, double) (rate, double)
+Func H comm_irecv (void*, smx_synchro_t) (receiver, void*, smx_process_t) (rdv, void*, smx_mailbox_t) (dst_buff, void*) (dst_buff_size, void*, size_t*) (match_fun, FPtr, simix_match_func_t) (copy_data_fun, FPtr, simix_copy_data_func_t) (data, void*) (rate, double)
Proc - comm_cancel (void) (comm, void*, smx_synchro_t)
Blck H comm_waitany (int) (comms, void*, xbt_dynar_t)
Blck H comm_wait (void) (comm, void*, smx_synchro_t) (timeout, double)
#endif
simix_global->process_to_run = xbt_dynar_new(sizeof(smx_process_t), NULL);
simix_global->process_that_ran = xbt_dynar_new(sizeof(smx_process_t), NULL);
- simix_global->process_list =
- xbt_swag_new(xbt_swag_offset(proc, process_hookup));
- simix_global->process_to_destroy =
- xbt_swag_new(xbt_swag_offset(proc, destroy_hookup));
+ simix_global->process_list = xbt_swag_new(xbt_swag_offset(proc, process_hookup));
+ simix_global->process_to_destroy = xbt_swag_new(xbt_swag_offset(proc, destroy_hookup));
simix_global->maestro_process = NULL;
simix_global->registered_functions = xbt_dict_new_homogeneous(NULL);
#include "src/mc/mc_replay.h"
#include "xbt/dict.h"
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(simix_network, simix,
- "SIMIX network-related synchronization");
+XBT_LOG_NEW_DEFAULT_SUBCATEGORY(simix_network, simix, "SIMIX network-related synchronization");
static xbt_dict_t rdv_points = NULL;
XBT_EXPORT_NO_IMPORT(unsigned long int) smx_total_comms = 0;
static void SIMIX_waitany_remove_simcall_from_actions(smx_simcall_t simcall);
static void SIMIX_comm_copy_data(smx_synchro_t comm);
static smx_synchro_t SIMIX_comm_new(e_smx_comm_type_t type);
-static inline void SIMIX_rdv_push(smx_rdv_t rdv, smx_synchro_t comm);
+static inline void SIMIX_rdv_push(smx_mailbox_t rdv, smx_synchro_t comm);
static smx_synchro_t SIMIX_fifo_probe_comm(xbt_fifo_t fifo, e_smx_comm_type_t type,
int (*match_fun)(void *, void *,smx_synchro_t),
void *user_data, smx_synchro_t my_synchro);
/* Rendez-Vous Points */
/******************************************************************************/
-smx_rdv_t SIMIX_rdv_create(const char *name)
+smx_mailbox_t SIMIX_rdv_create(const char *name)
{
/* two processes may have pushed the same rdv_create simcall at the same time */
- smx_rdv_t rdv = name ? (smx_rdv_t) xbt_dict_get_or_null(rdv_points, name) : NULL;
+ smx_mailbox_t rdv = name ? (smx_mailbox_t) xbt_dict_get_or_null(rdv_points, name) : NULL;
if (!rdv) {
rdv = xbt_new0(s_smx_rvpoint_t, 1);
return rdv;
}
-void SIMIX_rdv_destroy(smx_rdv_t rdv)
+void SIMIX_rdv_destroy(smx_mailbox_t rdv)
{
if (rdv->name)
xbt_dict_remove(rdv_points, rdv->name);
void SIMIX_rdv_free(void *data)
{
XBT_DEBUG("rdv free %p", data);
- smx_rdv_t rdv = (smx_rdv_t) data;
+ smx_mailbox_t rdv = (smx_mailbox_t) data;
xbt_free(rdv->name);
xbt_fifo_free(rdv->comm_fifo);
xbt_fifo_free(rdv->done_comm_fifo);
return rdv_points;
}
-smx_rdv_t SIMIX_rdv_get_by_name(const char *name)
+smx_mailbox_t SIMIX_rdv_get_by_name(const char *name)
{
- return (smx_rdv_t) xbt_dict_get_or_null(rdv_points, name);
+ return (smx_mailbox_t) xbt_dict_get_or_null(rdv_points, name);
}
-int SIMIX_rdv_comm_count_by_host(smx_rdv_t rdv, sg_host_t host)
+int SIMIX_rdv_comm_count_by_host(smx_mailbox_t rdv, sg_host_t host)
{
smx_synchro_t comm = NULL;
xbt_fifo_item_t item = NULL;
return count;
}
-smx_synchro_t SIMIX_rdv_get_head(smx_rdv_t rdv)
+smx_synchro_t SIMIX_rdv_get_head(smx_mailbox_t rdv)
{
return (smx_synchro_t) xbt_fifo_get_item_content(
xbt_fifo_get_first_item(rdv->comm_fifo));
* \param rdv The rendez-vous point
* \return process The receiving process (NULL if not set)
*/
-smx_process_t SIMIX_rdv_get_receiver(smx_rdv_t rdv)
+smx_process_t SIMIX_rdv_get_receiver(smx_mailbox_t rdv)
{
return rdv->permanent_receiver;
}
* \param rdv The rendez-vous point
* \param process The receiving process
*/
-void SIMIX_rdv_set_receiver(smx_rdv_t rdv, smx_process_t process)
+void SIMIX_rdv_set_receiver(smx_mailbox_t rdv, smx_process_t process)
{
rdv->permanent_receiver=process;
}
* \param rdv The rendez-vous point
* \param comm The communication synchro
*/
-static inline void SIMIX_rdv_push(smx_rdv_t rdv, smx_synchro_t comm)
+static inline void SIMIX_rdv_push(smx_mailbox_t rdv, smx_synchro_t comm)
{
xbt_fifo_push(rdv->comm_fifo, comm);
comm->comm.rdv = rdv;
* \param rdv The rendez-vous point
* \param comm The communication synchro
*/
-void SIMIX_rdv_remove(smx_rdv_t rdv, smx_synchro_t comm)
+void SIMIX_rdv_remove(smx_mailbox_t rdv, smx_synchro_t comm)
{
xbt_fifo_remove(rdv->comm_fifo, comm);
comm->comm.rdv = NULL;
}
}
-void simcall_HANDLER_comm_send(smx_simcall_t simcall, smx_process_t src, smx_rdv_t rdv,
+void simcall_HANDLER_comm_send(smx_simcall_t simcall, smx_process_t src, smx_mailbox_t rdv,
double task_size, double rate,
void *src_buff, size_t src_buff_size,
int (*match_fun)(void *, void *,smx_synchro_t),
SIMCALL_SET_MC_VALUE(simcall, 0);
simcall_HANDLER_comm_wait(simcall, comm, timeout);
}
-smx_synchro_t simcall_HANDLER_comm_isend(smx_simcall_t simcall, smx_process_t src_proc, smx_rdv_t rdv,
+smx_synchro_t simcall_HANDLER_comm_isend(smx_simcall_t simcall, smx_process_t src_proc, smx_mailbox_t rdv,
double task_size, double rate,
void *src_buff, size_t src_buff_size,
int (*match_fun)(void *, void *,smx_synchro_t),
return (detached ? NULL : other_synchro);
}
-void simcall_HANDLER_comm_recv(smx_simcall_t simcall, smx_process_t receiver, smx_rdv_t rdv,
+void simcall_HANDLER_comm_recv(smx_simcall_t simcall, smx_process_t receiver, smx_mailbox_t rdv,
void *dst_buff, size_t *dst_buff_size,
int (*match_fun)(void *, void *, smx_synchro_t),
void (*copy_data_fun)(smx_synchro_t, void*, size_t),
simcall_HANDLER_comm_wait(simcall, comm, timeout);
}
-smx_synchro_t simcall_HANDLER_comm_irecv(smx_simcall_t simcall, smx_process_t receiver, smx_rdv_t rdv,
+smx_synchro_t simcall_HANDLER_comm_irecv(smx_simcall_t simcall, smx_process_t receiver, smx_mailbox_t rdv,
void *dst_buff, size_t *dst_buff_size,
int (*match_fun)(void *, void *, smx_synchro_t),
void (*copy_data_fun)(smx_synchro_t, void*, size_t),
return SIMIX_comm_irecv(receiver, rdv, dst_buff, dst_buff_size, match_fun, copy_data_fun, data, rate);
}
-smx_synchro_t SIMIX_comm_irecv(smx_process_t dst_proc, smx_rdv_t rdv, void *dst_buff, size_t *dst_buff_size,
+smx_synchro_t SIMIX_comm_irecv(smx_process_t dst_proc, smx_mailbox_t rdv, void *dst_buff, size_t *dst_buff_size,
int (*match_fun)(void *, void *, smx_synchro_t),
void (*copy_data_fun)(smx_synchro_t, void*, size_t), // used to copy data if not default one
void *data, double rate)
return other_synchro;
}
-smx_synchro_t simcall_HANDLER_comm_iprobe(smx_simcall_t simcall, smx_rdv_t rdv,
+smx_synchro_t simcall_HANDLER_comm_iprobe(smx_simcall_t simcall, smx_mailbox_t rdv,
int type, int src, int tag,
int (*match_fun)(void *, void *, smx_synchro_t),
void *data){
return SIMIX_comm_iprobe(simcall->issuer, rdv, type, src, tag, match_fun, data);
}
-smx_synchro_t SIMIX_comm_iprobe(smx_process_t dst_proc, smx_rdv_t rdv, int type, int src,
+smx_synchro_t SIMIX_comm_iprobe(smx_process_t dst_proc, smx_mailbox_t rdv, int type, int src,
int tag, int (*match_fun)(void *, void *, smx_synchro_t), void *data)
{
XBT_DEBUG("iprobe from %p %p", rdv, rdv->comm_fifo);
XBT_PUBLIC(int) SIMIX_comm_is_latency_bounded(smx_synchro_t comm);
#endif
-XBT_PRIVATE smx_rdv_t SIMIX_rdv_create(const char *name);
-XBT_PRIVATE void SIMIX_rdv_destroy(smx_rdv_t rdv);
-XBT_PRIVATE smx_rdv_t SIMIX_rdv_get_by_name(const char *name);
-XBT_PRIVATE void SIMIX_rdv_remove(smx_rdv_t rdv, smx_synchro_t comm);
-XBT_PRIVATE int SIMIX_rdv_comm_count_by_host(smx_rdv_t rdv, sg_host_t host);
-XBT_PRIVATE smx_synchro_t SIMIX_rdv_get_head(smx_rdv_t rdv);
-XBT_PRIVATE void SIMIX_rdv_set_receiver(smx_rdv_t rdv, smx_process_t proc);
-XBT_PRIVATE smx_process_t SIMIX_rdv_get_receiver(smx_rdv_t rdv);
-XBT_PRIVATE smx_synchro_t SIMIX_comm_irecv(smx_process_t dst_proc, smx_rdv_t rdv,
+XBT_PRIVATE smx_mailbox_t SIMIX_rdv_create(const char *name);
+XBT_PRIVATE void SIMIX_rdv_destroy(smx_mailbox_t rdv);
+XBT_PRIVATE smx_mailbox_t SIMIX_rdv_get_by_name(const char *name);
+XBT_PRIVATE void SIMIX_rdv_remove(smx_mailbox_t rdv, smx_synchro_t comm);
+XBT_PRIVATE int SIMIX_rdv_comm_count_by_host(smx_mailbox_t rdv, sg_host_t host);
+XBT_PRIVATE smx_synchro_t SIMIX_rdv_get_head(smx_mailbox_t rdv);
+XBT_PRIVATE void SIMIX_rdv_set_receiver(smx_mailbox_t rdv, smx_process_t proc);
+XBT_PRIVATE smx_process_t SIMIX_rdv_get_receiver(smx_mailbox_t rdv);
+XBT_PRIVATE smx_synchro_t SIMIX_comm_irecv(smx_process_t dst_proc, smx_mailbox_t rdv,
void *dst_buff, size_t *dst_buff_size,
int (*)(void *, void *, smx_synchro_t),
void (*copy_data_fun)(smx_synchro_t, void*, size_t),
void *data, double rate);
XBT_PRIVATE void SIMIX_comm_destroy(smx_synchro_t synchro);
XBT_PRIVATE void SIMIX_comm_destroy_internal_actions(smx_synchro_t synchro);
-XBT_PRIVATE smx_synchro_t SIMIX_comm_iprobe(smx_process_t dst_proc, smx_rdv_t rdv, int type, int src,
+XBT_PRIVATE smx_synchro_t SIMIX_comm_iprobe(smx_process_t dst_proc, smx_mailbox_t rdv, int type, int src,
int tag, int (*match_fun)(void *, void *, smx_synchro_t), void *data);
XBT_PRIVATE void SIMIX_post_comm(smx_synchro_t synchro);
XBT_PRIVATE void SIMIX_comm_cancel(smx_synchro_t synchro);
struct {
e_smx_comm_type_t type; /* Type of the communication (SIMIX_COMM_SEND or SIMIX_COMM_RECEIVE) */
- smx_rdv_t rdv; /* Rendez-vous where the comm is queued */
+ smx_mailbox_t rdv; /* Rendez-vous where the comm is queued */
#ifdef HAVE_MC
- smx_rdv_t rdv_cpy; /* Copy of the rendez-vous where the comm is queued, MC needs it for DPOR
+ smx_mailbox_t rdv_cpy; /* Copy of the rendez-vous where the comm is queued, MC needs it for DPOR
(comm.rdv set to NULL when the communication is removed from the mailbox
(used as garbage collector)) */
#endif
XBT_PRIVATE MPI_Comm smpi_process_comm_world(void);
XBT_PRIVATE MPI_Comm smpi_process_get_comm_intra(void);
XBT_PRIVATE void smpi_process_set_comm_intra(MPI_Comm comm);
-XBT_PRIVATE smx_rdv_t smpi_process_mailbox(void);
-XBT_PRIVATE smx_rdv_t smpi_process_remote_mailbox(int index);
-XBT_PRIVATE smx_rdv_t smpi_process_mailbox_small(void);
-XBT_PRIVATE smx_rdv_t smpi_process_remote_mailbox_small(int index);
+XBT_PRIVATE smx_mailbox_t smpi_process_mailbox(void);
+XBT_PRIVATE smx_mailbox_t smpi_process_remote_mailbox(int index);
+XBT_PRIVATE smx_mailbox_t smpi_process_mailbox_small(void);
+XBT_PRIVATE smx_mailbox_t smpi_process_remote_mailbox_small(int index);
XBT_PRIVATE xbt_mutex_t smpi_process_mailboxes_mutex(void);
XBT_PRIVATE xbt_mutex_t smpi_process_remote_mailboxes_mutex(int index);
XBT_PRIVATE xbt_os_timer_t smpi_process_timer(void);
void smpi_mpi_start(MPI_Request request)
{
- smx_rdv_t mailbox;
+ smx_mailbox_t mailbox;
xbt_assert(!request->action, "Cannot (re)start a non-finished communication");
request->flags &= ~PREPARED;
static int nsleeps = 1;
if(smpi_iprobe_sleep > 0) simcall_process_sleep(nsleeps*smpi_iprobe_sleep);
// behave like a receive, but don't do it
- smx_rdv_t mailbox;
+ smx_mailbox_t mailbox;
print_request("New iprobe", request);
// We have to test both mailboxes as we don't know if we will receive one one or another
double simulated;
int *argc;
char ***argv;
- smx_rdv_t mailbox;
- smx_rdv_t mailbox_small;
+ smx_mailbox_t mailbox;
+ smx_mailbox_t mailbox_small;
xbt_mutex_t mailboxes_mutex;
xbt_os_timer_t timer;
MPI_Comm comm_self;
return data ? *data->comm_world : MPI_COMM_NULL;
}
-smx_rdv_t smpi_process_mailbox(void)
+smx_mailbox_t smpi_process_mailbox(void)
{
smpi_process_data_t data = smpi_process_data();
return data->mailbox;
}
-smx_rdv_t smpi_process_mailbox_small(void)
+smx_mailbox_t smpi_process_mailbox_small(void)
{
smpi_process_data_t data = smpi_process_data();
return data->mailbox_small;
return data->mailboxes_mutex;
}
-smx_rdv_t smpi_process_remote_mailbox(int index)
+smx_mailbox_t smpi_process_remote_mailbox(int index)
{
smpi_process_data_t data = smpi_process_remote_data(index);
return data->mailbox;
}
-smx_rdv_t smpi_process_remote_mailbox_small(int index)
+smx_mailbox_t smpi_process_remote_mailbox_small(int index)
{
smpi_process_data_t data = smpi_process_remote_data(index);
return data->mailbox_small;