#include "private.h"
XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(simix);
+
+static const char* request_names[] = {
+#undef SIMIX_REQ_ENUM_ELEMENT
+#define SIMIX_REQ_ENUM_ELEMENT(x) #x /* generate strings from the enumeration values */
+SIMIX_REQ_LIST
+#undef SIMIX_REQ_ENUM_ELEMENT
+};
+
/**
* \brief Returns a host given its name.
*
* \return A new SIMIX execution action
*/
smx_action_t SIMIX_req_host_execute(const char *name, smx_host_t host,
- double computation_amount)
+ double computation_amount,
+ double priority)
{
smx_req_t req = SIMIX_req_mine();
req->host_execute.name = name;
req->host_execute.host = host;
req->host_execute.computation_amount = computation_amount;
+ req->host_execute.priority = priority;
SIMIX_request_push();
return req->host_execute.result;
}
*
* \param execution The execution action
*/
-void SIMIX_req_host_execution_wait(smx_action_t execution)
+e_smx_state_t SIMIX_req_host_execution_wait(smx_action_t execution)
{
smx_req_t req = SIMIX_req_mine();
req->call = REQ_HOST_EXECUTION_WAIT;
req->host_execution_wait.execution = execution;
SIMIX_request_push();
+ return req->host_execution_wait.result;
}
/**
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();
req->call = REQ_RDV_GEY_BY_NAME;
*/
void SIMIX_req_set_category(smx_action_t action, const char *category)
{
+ if (category == NULL) {
+ return;
+ }
+
smx_req_t req = SIMIX_req_mine();
req->call = REQ_SET_CATEGORY;
SIMIX_request_push();
return req->sem_get_capacity.result;
}
+/* ************************************************************************** */
-
-
+/** @brief returns a printable string representing the request kind */
+const char *SIMIX_request_name(int kind) {
+ return request_names[kind];
+}