XBT_LOG_NEW_DEFAULT_SUBCATEGORY(simix_smurf, simix,
"Logging specific to SIMIX (SMURF)");
-/* FIXME: we may want to save the initialization of issuer... */
XBT_INLINE smx_req_t SIMIX_req_mine()
{
smx_process_t issuer = SIMIX_process_self();
return &issuer->request;
}
-void SIMIX_request_push()
+/**
+ * \brief Makes the current process do a request to the kernel and yields
+ * until completion.
+ * \param self the current process
+ */
+void SIMIX_request_push(smx_process_t self)
{
- smx_process_t issuer = SIMIX_process_self();
-
- if (issuer != simix_global->maestro_process){
- issuer->request.issuer = issuer;
- XBT_DEBUG("Yield process '%s' on request of type %s (%d)", issuer->name,
- SIMIX_request_name(issuer->request.call), issuer->request.call);
- SIMIX_process_yield();
+ if (self != simix_global->maestro_process) {
+ XBT_DEBUG("Yield process '%s' on request of type %s (%d)", self->name,
+ SIMIX_request_name(self->request.call), self->request.call);
+ SIMIX_process_yield(self);
} else {
- SIMIX_request_pre(&issuer->request, 0);
+ SIMIX_request_pre(&self->request, 0);
}
}
void SIMIX_request_pre(smx_req_t req, int value)
{
+ XBT_DEBUG("Handling request %p: %s", req, SIMIX_request_name(req->call));
switch (req->call) {
case REQ_COMM_TEST:
req->comm_send.src_buff,
req->comm_send.src_buff_size,
req->comm_send.match_fun,
+ NULL, /* no clean function since it's not detached */
req->comm_send.data,
0);
SIMIX_pre_comm_wait(req, comm, req->comm_send.timeout, 0);
req->comm_isend.src_buff,
req->comm_isend.src_buff_size,
req->comm_isend.match_fun,
+ req->comm_isend.clean_fun,
req->comm_isend.data,
req->comm_isend.detached);
SIMIX_request_answer(req);