Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
fullduplex support
[simgrid.git] / src / simix / smx_action.c
index 7984882..ce3ba8a 100644 (file)
@@ -1,7 +1,5 @@
-/*     $Id$     */
-
-/* Copyright (c) 2007 Arnaud Legrand, Bruno Donnassolo.
-   All rights reserved.                                          */
+/* Copyright (c) 2007, 2009, 2010. The SimGrid Team.
+ * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -184,6 +182,36 @@ XBT_INLINE void SIMIX_action_set_priority(smx_action_t action, double priority)
   return;
 }
 
+/**
+ *     \brief Resumes the execution of an action.
+ *
+ *  This functions restarts the execution of an action. It just calls the right SURF function.
+ *  \param action The SIMIX action
+ *  \param priority The new priority
+ */
+XBT_INLINE void SIMIX_action_resume(smx_action_t action)
+{
+  xbt_assert0((action != NULL), "Invalid parameter");
+
+  surf_workstation_model->resume(action->surf_action);
+  return;
+}
+
+/**
+ *  \brief Suspends the execution of an action.
+ *
+ *  This functions suspends the execution of an action. It just calls the right SURF function.
+ *  \param action The SIMIX action
+ *  \param priority The new priority
+ */
+XBT_INLINE void SIMIX_action_suspend(smx_action_t action)
+{
+  xbt_assert0((action != NULL), "Invalid parameter");
+
+  surf_workstation_model->suspend(action->surf_action);
+  return;
+}
+
 /**
  *     \brief Destroys an action
  *
@@ -346,6 +374,12 @@ XBT_INLINE double SIMIX_action_get_remains(smx_action_t action)
   return surf_workstation_model->get_remains(action->surf_action);
 }
 
+XBT_INLINE int SIMIX_action_is_latency_bounded(smx_action_t action)
+{
+  xbt_assert0((action != NULL), "Invalid parameter");
+  return surf_workstation_model->get_latency_limited(action->surf_action);
+}
+
 smx_action_t SIMIX_action_parallel_execute(char *name, int host_nb,
                                            smx_host_t * host_list,
                                            double *computation_amount,