Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Use a mallocator for SIMIX actions
[simgrid.git] / src / simix / smx_user.c
index 2bde738..5fd7b60 100644 (file)
@@ -567,12 +567,18 @@ void SIMIX_req_rdv_destroy(smx_rdv_t rdv)
 smx_rdv_t SIMIX_req_rdv_get_by_name(const char *name)
 {
   xbt_assert0(name != NULL, "Invalid parameter for SIMIX_req_rdv_get_by_name (name is NULL)");
-  smx_req_t req = SIMIX_req_mine();
 
+  /* FIXME: this is a horrible lost of performance, so we hack it out by
+   * skipping the request (for now). It won't work on distributed but
+   * probably we will change MSG for that. */
+/*
+  smx_req_t req = SIMIX_req_mine();
   req->call = REQ_RDV_GEY_BY_NAME;
   req->rdv_get_by_name.name = name;
   SIMIX_request_push();
-  return req->rdv_get_by_name.result;
+  return req->rdv_get_by_name.result;*/
+
+  return SIMIX_rdv_get_by_name(name);
 }
 
 /**
@@ -612,7 +618,8 @@ smx_action_t SIMIX_req_rdv_get_head(smx_rdv_t rdv)
 
 smx_action_t SIMIX_req_comm_isend(smx_rdv_t rdv, double task_size, double rate,
                               void *src_buff, size_t src_buff_size,
-                              int (*match_fun)(void *, void *), void *data)
+                              int (*match_fun)(void *, void *), void *data,
+                              int detached)
 {
   smx_req_t req = SIMIX_req_mine();
 
@@ -626,6 +633,7 @@ smx_action_t SIMIX_req_comm_isend(smx_rdv_t rdv, double task_size, double rate,
   req->comm_isend.src_buff_size = src_buff_size;
   req->comm_isend.match_fun = match_fun;
   req->comm_isend.data = data;
+  req->comm_isend.detached = detached;
 
   SIMIX_request_push();
   return req->comm_isend.result;
@@ -651,12 +659,19 @@ smx_action_t SIMIX_req_comm_irecv(smx_rdv_t rdv, void *dst_buff, size_t * dst_bu
 
 void SIMIX_req_comm_destroy(smx_action_t comm)
 {
+  xbt_assert0(comm, "Invalid parameter");
+
+  /* FIXME remove this request type: comms are auto-destroyed now,
+   * but what happens with unfinished comms? */
+
+  /*
   smx_req_t req = SIMIX_req_mine();
 
   req->call = REQ_COMM_DESTROY;
   req->comm_destroy.comm = comm;
 
   SIMIX_request_push();
+  */
 }
 
 void SIMIX_req_comm_cancel(smx_action_t comm)
@@ -783,50 +798,6 @@ void *SIMIX_req_comm_get_dst_data(smx_action_t comm)
   return req->comm_get_dst_data.result;
 }
 
-void *SIMIX_req_comm_get_src_buff(smx_action_t comm)
-{
-  smx_req_t req = SIMIX_req_mine();
-
-  req->call = REQ_COMM_GET_SRC_BUFF;
-  req->comm_get_src_buff.comm = comm;
-
-  SIMIX_request_push();
-  return req->comm_get_src_buff.result;
-}
-
-void *SIMIX_req_comm_get_dst_buff(smx_action_t comm)
-{
-  smx_req_t req = SIMIX_req_mine();
-
-  req->call = REQ_COMM_GET_DST_BUFF;
-  req->comm_get_dst_buff.comm = comm;
-
-  SIMIX_request_push();
-  return req->comm_get_dst_buff.result;
-}
-
-size_t SIMIX_req_comm_get_src_buff_size(smx_action_t comm)
-{
-  smx_req_t req = SIMIX_req_mine();
-
-  req->call = REQ_COMM_GET_SRC_BUFF_SIZE;
-  req->comm_get_src_buff_size.comm = comm;
-
-  SIMIX_request_push();
-  return req->comm_get_src_buff_size.result;
-}
-
-size_t SIMIX_req_comm_get_dst_buff_size(smx_action_t comm)
-{
-  smx_req_t req = SIMIX_req_mine();
-
-  req->call = REQ_COMM_GET_DST_BUFF_SIZE;
-  req->comm_get_dst_buff_size.comm = comm;
-
-  SIMIX_request_push();
-  return req->comm_get_dst_buff_size.result;
-}
-
 smx_process_t SIMIX_req_comm_get_src_proc(smx_action_t comm)
 {
   smx_req_t req = SIMIX_req_mine();