rdv_get_head True (void*, smx_action_t) (rdv, void*, smx_rdv_t)
rdv_set_receiver True (void) (rdv, void*, smx_rdv_t) (receiver, void*, smx_process_t)
rdv_get_receiver True (void*, smx_process_t) (rdv, void*, smx_rdv_t)
-comm_iprobe True (void*, smx_action_t) (rdv, void*, smx_rdv_t) (src, int) (tag, int) (match_fun, FPtr, simix_match_func_t) (data, void*)
+comm_iprobe True (void*, smx_action_t) (rdv, void*, smx_rdv_t) (type, int) (src, int) (tag, int) (match_fun, FPtr, simix_match_func_t) (data, void*)
comm_send False (void) (src, 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)
comm_isend True (void*, smx_action_t) (src, 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)
comm_recv False (void) (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)
static inline void simcall_comm_iprobe__set__rdv(smx_simcall_t simcall, void* arg){
simcall->args[0].dp = arg;
}
-static inline int simcall_comm_iprobe__get__src(smx_simcall_t simcall){
+static inline int simcall_comm_iprobe__get__type(smx_simcall_t simcall){
return simcall->args[1].i;
}
-static inline void simcall_comm_iprobe__set__src(smx_simcall_t simcall, int arg){
+static inline void simcall_comm_iprobe__set__type(smx_simcall_t simcall, int arg){
simcall->args[1].i = arg;
}
-static inline int simcall_comm_iprobe__get__tag(smx_simcall_t simcall){
+static inline int simcall_comm_iprobe__get__src(smx_simcall_t simcall){
return simcall->args[2].i;
}
-static inline void simcall_comm_iprobe__set__tag(smx_simcall_t simcall, int arg){
+static inline void simcall_comm_iprobe__set__src(smx_simcall_t simcall, int arg){
simcall->args[2].i = arg;
}
+static inline int simcall_comm_iprobe__get__tag(smx_simcall_t simcall){
+ return simcall->args[3].i;
+}
+static inline void simcall_comm_iprobe__set__tag(smx_simcall_t simcall, int arg){
+ simcall->args[3].i = arg;
+}
static inline simix_match_func_t simcall_comm_iprobe__get__match_fun(smx_simcall_t simcall){
- return (simix_match_func_t) simcall->args[3].fp;
+ return (simix_match_func_t) simcall->args[4].fp;
}
static inline void simcall_comm_iprobe__set__match_fun(smx_simcall_t simcall, FPtr arg){
- simcall->args[3].fp = arg;
+ simcall->args[4].fp = arg;
}
static inline void* simcall_comm_iprobe__get__data(smx_simcall_t simcall){
- return simcall->args[4].dp;
+ return simcall->args[5].dp;
}
static inline void simcall_comm_iprobe__set__data(smx_simcall_t simcall, void* arg){
- simcall->args[4].dp = arg;
+ simcall->args[5].dp = arg;
}
static inline smx_process_t simcall_comm_send__get__src(smx_simcall_t simcall){
return (smx_process_t) simcall->args[0].dp;
}
return self->simcall.result.dp;
}
- inline static smx_action_t simcall_BODY_comm_iprobe(smx_rdv_t rdv, int src, int tag, simix_match_func_t match_fun, void* data) {
+ inline static smx_action_t simcall_BODY_comm_iprobe(smx_rdv_t rdv, int type, int src, int tag, simix_match_func_t match_fun, void* data) {
smx_process_t self = SIMIX_process_self();
self->simcall.call = SIMCALL_COMM_IPROBE;
memset(&self->simcall.result, 0, sizeof(self->simcall.result));
memset(self->simcall.args, 0, sizeof(self->simcall.args));
self->simcall.args[0].dp = (void*) rdv;
- self->simcall.args[1].i = (int) src;
- self->simcall.args[2].i = (int) tag;
- self->simcall.args[3].fp = (FPtr) match_fun;
- self->simcall.args[4].dp = (void*) data;
+ self->simcall.args[1].i = (int) type;
+ self->simcall.args[2].i = (int) src;
+ self->simcall.args[3].i = (int) tag;
+ self->simcall.args[4].fp = (FPtr) match_fun;
+ self->simcall.args[5].dp = (void*) data;
if (self != simix_global->maestro_process) {
XBT_DEBUG("Yield process '%s' on simcall %s (%d)", self->name,
SIMIX_simcall_name(self->simcall.call), (int)self->simcall.call);
break;
case SIMCALL_COMM_IPROBE:
- simcall->result.dp = SIMIX_pre_comm_iprobe(simcall , (smx_rdv_t) simcall->args[0].dp, simcall->args[1].i, simcall->args[2].i, (simix_match_func_t) simcall->args[3].fp, simcall->args[4].dp);
+ simcall->result.dp = SIMIX_pre_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);
SIMIX_simcall_answer(simcall);
break;
other_action->state = SIMIX_DONE;
other_action->comm.type = SIMIX_COMM_DONE;
other_action->comm.rdv = NULL;
- //SIMIX_comm_destroy(this_action);
- //--smx_total_comms; // this creation was a pure waste
- //already_received=1;
- //other_action->comm.refcount--;
}/*else{
XBT_DEBUG("Not yet finished, we have to wait %d\n", xbt_fifo_size(rdv->comm_fifo));
}*/
}
smx_action_t SIMIX_pre_comm_iprobe(smx_simcall_t simcall, smx_rdv_t rdv,
- int src, int tag,
+ int type, int src, int tag,
int (*match_fun)(void *, void *, smx_action_t),
void *data){
- return SIMIX_comm_iprobe(simcall->issuer, rdv, src, tag, match_fun, data);
+ return SIMIX_comm_iprobe(simcall->issuer, rdv, type, src, tag, match_fun, data);
}
-smx_action_t SIMIX_comm_iprobe(smx_process_t dst_proc, smx_rdv_t rdv, int src,
+smx_action_t SIMIX_comm_iprobe(smx_process_t dst_proc, smx_rdv_t rdv, int type, int src,
int tag, int (*match_fun)(void *, void *, smx_action_t), void *data)
{
XBT_DEBUG("iprobe from %p %p\n", rdv, rdv->comm_fifo);
- smx_action_t this_action = SIMIX_comm_new(SIMIX_COMM_RECEIVE);
-
+ smx_action_t this_action;
+ int smx_type;
+ if(type == 1){
+ this_action=SIMIX_comm_new(SIMIX_COMM_SEND);
+ smx_type = SIMIX_COMM_RECEIVE;
+ } else{
+ this_action=SIMIX_comm_new(SIMIX_COMM_RECEIVE);
+ smx_type = SIMIX_COMM_SEND;
+ }
smx_action_t other_action=NULL;
if(rdv->permanent_receiver && xbt_fifo_size(rdv->done_comm_fifo)!=0){
//find a match in the already received fifo
XBT_DEBUG("first try in the perm recv mailbox \n");
- other_action = SIMIX_fifo_probe_comm(rdv->done_comm_fifo, SIMIX_COMM_SEND, match_fun, data, this_action);
+ other_action = SIMIX_fifo_probe_comm(rdv->done_comm_fifo, smx_type, match_fun, data, this_action);
}
// }else{
if(!other_action){
XBT_DEBUG("second try in the other mailbox");
- other_action = SIMIX_fifo_probe_comm(rdv->comm_fifo, SIMIX_COMM_SEND, match_fun, data, this_action);
+ other_action = SIMIX_fifo_probe_comm(rdv->comm_fifo, smx_type, match_fun, data, this_action);
}
// }
if(other_action)other_action->comm.refcount--;
void *data, double rate);
void SIMIX_comm_destroy(smx_action_t action);
void SIMIX_comm_destroy_internal_actions(smx_action_t action);
-smx_action_t SIMIX_comm_iprobe(smx_process_t dst_proc, smx_rdv_t rdv, int src,
+smx_action_t SIMIX_comm_iprobe(smx_process_t dst_proc, smx_rdv_t rdv, int type, int src,
int tag, int (*match_fun)(void *, void *, smx_action_t), void *data);
void SIMIX_pre_comm_wait(smx_simcall_t simcall, smx_action_t action, double timeout);
void SIMIX_pre_comm_waitany(smx_simcall_t simcall, xbt_dynar_t actions);
smx_process_t SIMIX_comm_get_dst_proc(smx_action_t action);
// pre prototypes
-smx_action_t SIMIX_pre_comm_iprobe(smx_simcall_t simcall, smx_rdv_t rdv,
- int src, int tag,
+smx_action_t SIMIX_pre_comm_iprobe(smx_simcall_t simcall, smx_rdv_t rdv,
+ int type,int src, int tag,
int (*match_fun)(void *, void *, smx_action_t),
void *data);
smx_rdv_t SIMIX_pre_rdv_create(smx_simcall_t simcall, const char *name);
/**
* \ingroup simix_comm_management
*/
-smx_action_t simcall_comm_iprobe(smx_rdv_t rdv, int src, int tag,
+smx_action_t simcall_comm_iprobe(smx_rdv_t rdv, int type, int src, int tag,
int (*match_fun)(void *, void *, smx_action_t), void *data)
{
xbt_assert(rdv, "No rendez-vous point defined for iprobe");
- return simcall_BODY_comm_iprobe(rdv, src, tag, match_fun, data);
+ return simcall_BODY_comm_iprobe(rdv, type, src, tag, match_fun, data);
}
/**
if (sg_cfg_get_int("smpi/async_small_thres")>0){
mailbox = smpi_process_mailbox_small();
XBT_DEBUG("trying to probe the perm recv mailbox");
- request->action = simcall_comm_iprobe(mailbox, request->src, request->tag, &match_recv, (void*)request);
+ request->action = simcall_comm_iprobe(mailbox, 0, request->src, request->tag, &match_recv, (void*)request);
}
if (request->action==NULL){
mailbox = smpi_process_mailbox();
XBT_DEBUG("trying to probe the other mailbox");
- request->action = simcall_comm_iprobe(mailbox, request->src, request->tag, &match_recv, (void*)request);
+ request->action = simcall_comm_iprobe(mailbox, 0, request->src,request->tag, &match_recv, (void*)request);
}
if(request->action){