Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
SIMIX_mbox_get_head() -> simcall_mbox_front()
[simgrid.git] / src / simix / smx_network.cpp
index ff2dd37..7d0ffeb 100644 (file)
@@ -69,21 +69,6 @@ smx_mailbox_t SIMIX_mbox_get_by_name(const char *name)
   return (smx_mailbox_t) xbt_dict_get_or_null(mailboxes, name);
 }
 
-smx_synchro_t SIMIX_mbox_get_head(smx_mailbox_t mbox)
-{
-  return mbox->comm_queue->empty()? nullptr:mbox->comm_queue->front();
-}
-
-/**
- *  \brief get the receiver (process associated to the mailbox)
- *  \param mbox The rendez-vous point
- *  \return process The receiving process (NULL if not set)
- */
-smx_process_t SIMIX_mbox_get_receiver(smx_mailbox_t mbox)
-{
-  return mbox->permanent_receiver;
-}
-
 /**
  *  \brief set the receiver of the rendez vous point to allow eager sends
  *  \param mbox The rendez-vous point
@@ -361,7 +346,7 @@ smx_synchro_t SIMIX_comm_irecv(smx_process_t dst_proc, smx_mailbox_t mbox, void
     } else {
       simgrid::simix::Comm *other_comm = static_cast<simgrid::simix::Comm*>(other_synchro);
 
-      if(other_comm->surf_comm && SIMIX_comm_get_remains(other_comm)==0.0) {
+      if(other_comm->surf_comm && other_comm->remains()==0.0) {
         XBT_DEBUG("comm %p has been already sent, and is finished, destroy it",other_comm);
         other_comm->state = SIMIX_DONE;
         other_comm->type = SIMIX_COMM_DONE;
@@ -814,35 +799,6 @@ void SIMIX_post_comm(smx_synchro_t synchro)
 
 /************* synchro Getters **************/
 
-/**
- *  \brief get the amount remaining from the communication
- *  \param synchro The communication
- */
-double SIMIX_comm_get_remains(smx_synchro_t synchro)
-{
-  if(!synchro)
-    return 0;
-  simgrid::simix::Comm *comm = static_cast<simgrid::simix::Comm*>(synchro);
-
-  double remains;
-  switch (synchro->state) {
-
-  case SIMIX_RUNNING:
-    remains = comm->surf_comm->getRemains();
-    break;
-
-  case SIMIX_WAITING:
-  case SIMIX_READY:
-    remains = 0; /*FIXME: check what should be returned */
-    break;
-
-  default:
-    remains = 0; /*FIXME: is this correct? */
-    break;
-  }
-  return remains;
-}
-
 /**
  *  \brief Return the user data associated to the sender of the communication
  *  \param synchro The communication