Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Remove features marked with XBT_ATTRIB_DEPRECATED_v325.
[simgrid.git] / src / msg / msg_comm.cpp
index d9bdac3..c386327 100644 (file)
@@ -28,19 +28,15 @@ bool Comm::test()
       /* I am the receiver */
       (*task_received)->set_not_used();
     }
-  } catch (const simgrid::TimeoutError&) {
+  } catch (const simgrid::TimeoutException&) {
     status_  = MSG_TIMEOUT;
     finished = true;
   } catch (const simgrid::CancelException&) {
     status_  = MSG_TASK_CANCELED;
     finished = true;
-  } catch (xbt_ex& e) {
-    if (e.category == network_error) {
-      status_  = MSG_TRANSFER_FAILURE;
-      finished = true;
-    } else {
-      throw;
-    }
+  } catch (const simgrid::NetworkFailureException&) {
+    status_  = MSG_TRANSFER_FAILURE;
+    finished = true;
   }
 
   return finished;
@@ -56,15 +52,12 @@ msg_error_t Comm::wait_for(double timeout)
     }
 
     /* FIXME: these functions are not traceable */
-  } catch (const simgrid::TimeoutError&) {
+  } catch (const simgrid::TimeoutException&) {
     status_ = MSG_TIMEOUT;
   } catch (const simgrid::CancelException&) {
     status_ = MSG_TASK_CANCELED;
-  } catch (xbt_ex& e) {
-    if (e.category == network_error)
-      status_ = MSG_TRANSFER_FAILURE;
-    else
-      throw;
+  } catch (const simgrid::NetworkFailureException&) {
+    status_ = MSG_TRANSFER_FAILURE;
   }
 
   return status_;
@@ -107,15 +100,13 @@ int MSG_comm_testany(xbt_dynar_t comms)
   msg_error_t status = MSG_OK;
   try {
     finished_index = simcall_comm_testany(s_comms.data(), s_comms.size());
-  } catch (simgrid::TimeoutError& e) {
+  } catch (const simgrid::TimeoutException& e) {
     finished_index = e.value;
     status         = MSG_TIMEOUT;
-  } catch (simgrid::CancelException& e) {
+  } catch (const simgrid::CancelException& e) {
     finished_index = e.value;
     status         = MSG_TASK_CANCELED;
-  } catch (xbt_ex& e) {
-    if (e.category != network_error)
-      throw;
+  } catch (const simgrid::NetworkFailureException& e) {
     finished_index = e.value;
     status         = MSG_TRANSFER_FAILURE;
   }
@@ -153,7 +144,7 @@ msg_error_t MSG_comm_wait(msg_comm_t comm, double timeout)
   return comm->wait_for(timeout);
 }
 
-/** @brief This function is called by a sender and permit to wait for each communication
+/** @brief This function is called by a sender and permits waiting for each communication
  *
  * @param comm a vector of communication
  * @param nb_elem is the size of the comm vector
@@ -186,19 +177,15 @@ int MSG_comm_waitany(xbt_dynar_t comms)
   msg_error_t status = MSG_OK;
   try {
     finished_index = simcall_comm_waitany(s_comms.data(), s_comms.size(), -1);
-  } catch (simgrid::TimeoutError& e) {
+  } catch (const simgrid::TimeoutException& e) {
     finished_index = e.value;
     status         = MSG_TIMEOUT;
-  } catch (simgrid::CancelException& e) {
+  } catch (const simgrid::CancelException& e) {
     finished_index = e.value;
     status         = MSG_TASK_CANCELED;
-  } catch (xbt_ex& e) {
-    if (e.category == network_error) {
-      finished_index = e.value;
-      status         = MSG_TRANSFER_FAILURE;
-    } else {
-      throw;
-    }
+  } catch (const simgrid::NetworkFailureException& e) {
+    finished_index = e.value;
+    status         = MSG_TRANSFER_FAILURE;
   }
 
   xbt_assert(finished_index != -1, "WaitAny returned -1");
@@ -237,21 +224,3 @@ msg_task_t MSG_comm_get_task(msg_comm_t comm)
 
   return comm->task_received ? *comm->task_received : comm->task_sent;
 }
-
-/**
- * @brief This function is called by SIMIX in kernel mode to copy the data of a comm.
- * @param comm the comm
- * @param buff the data copied
- * @param buff_size size of the buffer
- */
-// deprecated but used by MSG_set_copy_callback. Should be removed in v325
-void MSG_comm_copy_data_from_SIMIX(simgrid::kernel::activity::CommImpl* comm, void* buff, size_t buff_size)
-{
-  SIMIX_comm_copy_pointer_callback(comm, buff, buff_size);
-
-  // notify the user callback if any
-  if (msg_global->task_copy_callback) {
-    msg_task_t task = static_cast<msg_task_t>(buff);
-    msg_global->task_copy_callback(task, comm->src_actor_->ciface(), comm->dst_actor_->ciface());
-  }
-}